Create API key

  • POST /users/auth/keys
Auth

Creates a new API key.

Request body

The request to create the API key

description string required

API key description. Useful if there are multiple keys

expiration string

The optional expiration for the API key, provided as a duration (ex: '1d', '3h')

Responses

The API key is created and returned in the body of the response.

application/json
id string required

The API key ID.

user_id string

The user ID.

organization_id string

The organization ID linked to the API key

description string required

The API key description. TIP: Useful when you have multiple API keys.

key string

The API key. TIP: Since the API key is returned only once, save it in a safe place.

creation_date string · format: date-time required

The date/time for when the API key is created.

expiration_date string · format: date-time

The date/time when the API key expires.

role_assignments object

Roles assigned to users, API keys or organization invitations. Currently unavailable in self-hosted ECE.

Same fields as role_assignments