Create Api Key
POST
/api/api-keys
const url = 'https://example.com/api/api-keys?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"description":"example","expires_at":"2026-04-15T12:00:00Z","name":"example","scopes":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://example.com/api/api-keys?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "description": "example", "expires_at": "2026-04-15T12:00:00Z", "name": "example", "scopes": [ "example" ] }'Create a new API key
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “ Query Parameters ” organization_id
required
Organization Id
string format: uuid
Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/json
APIKeyCreate
Create API key
object
Example generated
{ "description": "example", "expires_at": "2026-04-15T12:00:00Z", "name": "example", "scopes": [ "example" ]}Responses
Section titled “ Responses ”Successful Response
Media type application/json
APIKeyCreatedResponse
Response when API key is created (includes full key)
object
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
is_active
required
Is Active
boolean
key
required
Key
string
key_prefix
required
Key Prefix
string
name
required
Name
string
organization_id
required
Organization Id
string format: uuid
scopes
required
Scopes
Array<string>
Example generated
{ "created_at": "2026-04-15T12:00:00Z", "description": "example", "expires_at": "2026-04-15T12:00:00Z", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "is_active": true, "key": "example", "key_prefix": "example", "last_used_at": "2026-04-15T12:00:00Z", "name": "example", "organization_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scopes": [ "example" ], "user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}