Skip to main content
POST
Create a new API key for programmatic access to the Butter AI API. API keys are scoped to both the creating user and the current organization.
The raw API key is only shown once in the response. Store it securely as it cannot be retrieved later.

Headers

string
required
Bearer token from Cognito authentication (JWT).
string
required
The organization ID.
string
required
Must be application/json.

Permissions

  • Only admin and agent_manager roles can create API keys.
  • You cannot create a key with a higher role than your own.

Request Body

string
required
A human-readable name for the API key (1-100 characters).
string
required
The role assigned to this API key. Must be one of: admin, agent_manager, user.
string
Optional ISO 8601 UTC datetime when the key should expire. If not provided, the key never expires.

Response

string
The full API key - shown once only. Store this securely.
object
The API key metadata.

Error Responses

Returned when the caller does not have permission to create API keys or is trying to create a key with a higher role than their own.
Returned when the role is invalid.