# spin api-key

**Spinbox is experimental: APIs change and data may be lost.** What is built and what proves it is on [Status](https://spin-stack.github.io/website/reference/status.md); what Spinbox does not do is on [Limitations](https://spin-stack.github.io/website/overview/limitations.md).

> spin api-key: Manage API keys.

<!-- Generated by tools/refgen from spin:cmd/cli. Edit the source, not this file. -->

```
Manage API keys for programmatic access.

API keys can be used to authenticate with the Spinbox API without
needing an interactive login. Keys can be scoped to limit their
permissions.

Usage:
  spin api-key [flags]
  spin api-key [command]

Available Commands:
  create      Create a new API key
  list        List your API keys
  revoke      Revoke an API key

Flags:
  -h, --help   help for api-key

Global Flags:
      --config string    config file (default is $HOME/.spin/config.yaml)
  -o, --output string    text for a person, or json: one document of what the API answered, and no prose (default "text")
      --profile string   named profile to use; SPIN_PROFILE names it when this flag does not (default "default")

Use "spin api-key [command] --help" for more information about a command.
```

### spin api-key create

```
Create a new API key for programmatic access.

The secret key will only be shown once. Make sure to save it securely.

A key can do only what its scopes name, and needs at least one. It can never
create API keys, confirm a login, or administer the instance.

Available scopes:
  workspace:read   - Read workspaces, snapshots and ports
  workspace:write  - Create, start, stop and change workspaces; open a terminal
  workspace:delete - Delete workspaces
  team:read        - Read teams and their members
  team:write       - Manage teams and members
  settings:read    - Read user settings and SSH keys
  settings:write   - Update user settings and SSH keys

Examples:
  spin api-key create "Deploy Bot" --scope workspace:read --scope workspace:write
  spin api-key create "Read Only" --scope workspace:read --expires 30d

Usage:
  spin api-key create <name> [flags]

Flags:
      --expires string   How long the key lasts, at most a year: a whole number of d, w or y (30d, 2w, 1y), or a duration like 36h (default "90d")
  -h, --help             help for create
      --scope strings    Scopes for the key (can be repeated)

Global Flags:
      --config string    config file (default is $HOME/.spin/config.yaml)
  -o, --output string    text for a person, or json: one document of what the API answered, and no prose (default "text")
      --profile string   named profile to use; SPIN_PROFILE names it when this flag does not (default "default")
```

### spin api-key list

```
List your API keys

Usage:
  spin api-key list [flags]

Flags:
  -h, --help   help for list

Global Flags:
      --config string    config file (default is $HOME/.spin/config.yaml)
  -o, --output string    text for a person, or json: one document of what the API answered, and no prose (default "text")
      --profile string   named profile to use; SPIN_PROFILE names it when this flag does not (default "default")
```

### spin api-key revoke

```
Revoke an API key

Usage:
  spin api-key revoke <key-id> [flags]

Flags:
  -h, --help   help for revoke
  -y, --yes    Skip confirmation

Global Flags:
      --config string    config file (default is $HOME/.spin/config.yaml)
  -o, --output string    text for a person, or json: one document of what the API answered, and no prose (default "text")
      --profile string   named profile to use; SPIN_PROFILE names it when this flag does not (default "default")
```
