Skip to main content
Rename an API key you own. Find the id with clay api-keys list. Only the name can be changed; the secret and scopes are unchanged.
clay api-keys update <apiKeyId> --name <name>

Arguments

ArgumentDescription
apiKeyIdAPI key id, e.g. the id returned by clay api-keys list.

Flags

FlagDescription
--name <name>New name for the API key.

Output

{
  "id": "ak_abc123",
  "name": "Renamed key",
  "scopes": ["cli:all"],
  "workspaceId": 12345,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "updatedAt": "2026-01-02T00:00:00.000Z"
}
FieldTypeDescription
idstringAPI key id.
namestringThe updated name.
scopesstring[]Scopes granted to the key.
workspaceIdnumber | undefinedWorkspace the key is scoped to, when set.
createdAtstringISO 8601 creation timestamp.
updatedAtstringISO 8601 last-updated timestamp.
The secret is never returned by update — it is shown only once, at creation.

Errors

CodeExitNotes
validation_error2--name is missing or empty.
not_found6No API key with that id found.
auth_forbidden3You do not have permission to manage API keys.

Examples

clay api-keys update ak_abc123 --name "Renamed key"
clay api-keys list | jq -r '.data[0].id' | xargs -I{} clay api-keys update {} --name "Renamed key"