v32

latestOpenAPI 3.1.0MITraw.githubusercontent.com2026-07-312881,4162.7 MB

Create admin API key

Create an organization admin API key

post/organization/admin_api_keys

Request body

namestring required
expires_in_secondsinteger

The number of seconds until the API key expires. Omit this field for a key that does not expire.

Example request

{
  "name": "New Admin Key",
  "expires_in_seconds": 2592000
}

Response

The newly created admin API key.

object'organization.admin_api_key' required

The object type, which is always organization.admin_api_key

idstring required

The identifier, which can be referenced in API endpoints

namestring nullable

The name of the API key

redacted_valuestring required

The redacted value of the API key

created_atinteger required

The Unix timestamp (in seconds) of when the API key was created

expires_atinteger nullable required

The Unix timestamp (in seconds) of when the API key expires

last_used_atinteger nullable

The Unix timestamp (in seconds) of when the API key was last used

valuestring required

The value of the API key. Only shown on create.

Example response

{
  "id": "key_abc",
  "name": "Administration Key",
  "redacted_value": "sk-admin...def",
  "created_at": 1711471533,
  "expires_at": 1714063533,
  "last_used_at": 1711471534,
  "owner": {
    "type": "user",
    "object": "organization.user",
    "id": "sa_456",
    "name": "My Service Account",
    "created_at": 1711471533,
    "role": "owner"
  },
  "value": "sk-admin-1234abcd"
}