api.clay.com/public/v0). The secret is returned only at creation — store it immediately, because it cannot be retrieved later. List existing keys with clay api-keys list.
Flags
| Flag | Description |
|---|---|
--name <name> | Human-readable name for the API key. |
Output
| Field | Type | Description |
|---|---|---|
id | string | API key id. Pass it to update or delete. |
name | string | The name you supplied. |
scopes | string[] | Scopes granted to the key. |
workspaceId | number | undefined | Workspace the key is scoped to, when set. |
createdAt | string | ISO 8601 creation timestamp. |
updatedAt | string | ISO 8601 last-updated timestamp. |
apiKey | string | The secret. Returned only once, at creation — store it now; it cannot be fetched again. |
Errors
| Code | Exit | Notes |
|---|---|---|
validation_error | 2 | --name is missing or empty. |
auth_forbidden | 3 | The key lacks permission to create API keys. |

