POST
/organization/admin_api_keysCreate an organization admin API key
Creates an organization admin API key. Provide a name and, optionally, expires_in_seconds to set the key's lifetime. The response includes the key value, which is returned only once when the key is created.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
The name for the admin API key and, optionally, its expiration period.
namestringrequired
The name to assign to the admin API key.
expires_in_secondsintegeroptional
The number of seconds until the API key expires. Omit this field for a key that does not expire.
200Returns the created admin API key, including its identifier, metadata, and key value. The key value is returned only once, in this creation response.
objectstringrequired
The object type, which is always `organization.admin_api_key`
idstringrequired
The identifier, which can be referenced in API endpoints
namestringoptional
The name of the API key
redacted_valuestringrequired
The redacted value of the API key
created_atintegerrequired
The Unix timestamp (in seconds) of when the API key was created
expires_atintegerrequired
The Unix timestamp (in seconds) of when the API key expires
last_used_atintegeroptional
The Unix timestamp (in seconds) of when the API key was last used
ownerobjectrequired
valuestringrequired
The value of the API key. Only shown on create.
400Returned when the API key creation request is invalid.
errorobjectrequired
403Returned when the caller does not have permission to perform this operation.
errorobjectrequired
Details about the permission error.
404Returned when the created API key cannot be found.
errorobjectrequired
Error handling
A 400 is returned when the API key creation request is invalid. A 403 is returned when the caller does not have permission to create an admin API key. A 404 is returned when the created API key cannot be found. name is required, and expires_in_seconds must be between 1 and 31,536,000 when provided.