# API Keys Commands

> See [API Keys module docs](../../modules/api-keys) for permissions and data model.

# API Keys Commands

See [API Keys module docs](../../modules/api-keys) for permissions and data model.

### `soat list-api-keys`

List API keys

- Method: `GET`
- Path: `/api/v1/api-keys`

#### Usage

```bash
soat list-api-keys
```

#### Options

##### `--limit`

Maximum number of results to return

- Source: `query`
- Required: no
- Type: `integer`
- Default: `50`

##### `--offset`

Number of results to skip

- Source: `query`
- Required: no
- Type: `integer`
- Default: `0`

### `soat create-api-key`

Create an API key

- Method: `POST`
- Path: `/api/v1/api-keys`

#### Usage

```bash
soat create-api-key --name <string>
```

#### Options

##### `--name`

Key name for identification

- Source: `body`
- Required: yes
- Type: `string`
- Example: `CI/CD Pipeline`

##### `--project-id`

Optional project ID to scope the key to. Omit or set null to create an unscoped key that spans projects.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `proj_V1StGXR8Z5jdHi6B`

##### `--policy-ids`

Optional list of policy IDs to attach. Key permissions become the intersection of user policies and these policies.

- Source: `body`
- Required: no
- Type: `array<string>`
- Example: `["pol_V1StGXR8Z5jdHi6B"]`

### `soat get-api-key`

Get an API key

- Method: `GET`
- Path: `/api/v1/api-keys/{api_key_id}`

#### Usage

```bash
soat get-api-key --api-key-id <string>
```

#### Options

##### `--api-key-id`

API key public ID (key_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `key_V1StGXR8Z5jdHi6B`

### `soat update-api-key`

Update an API key

- Method: `PUT`
- Path: `/api/v1/api-keys/{api_key_id}`

#### Usage

```bash
soat update-api-key --api-key-id <string>
```

#### Options

##### `--api-key-id`

API key public ID (key_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `key_V1StGXR8Z5jdHi6B`

##### `--name`

—

- Source: `body`
- Required: no
- Type: `string`
- Example: `Updated Key Name`

##### `--project-id`

Re-scope the key to a different project, or set null to clear the scope (unscoped key). Omit to leave the scope unchanged.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `proj_V1StGXR8Z5jdHi6B`

##### `--policy-ids`

Replace the key's policy list (empty array removes all)

- Source: `body`
- Required: no
- Type: `array<string>`
- Example: `["pol_V1StGXR8Z5jdHi6B"]`

### `soat delete-api-key`

Delete an API key

- Method: `DELETE`
- Path: `/api/v1/api-keys/{api_key_id}`

#### Usage

```bash
soat delete-api-key --api-key-id <string>
```

#### Options

##### `--api-key-id`

API key public ID (key_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `key_V1StGXR8Z5jdHi6B`
