API Keys
Create API Key
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.
Headers
string
required
Bearer token from Cognito authentication (JWT).
string
required
The organization ID.
string
required
Must be
application/json.Permissions
- Only
adminandagent_managerroles 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
403 Forbidden
403 Forbidden
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.
400 Bad Request
400 Bad Request
Returned when the role is invalid.