Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

User API key: Authorization: Bearer mx_live_*. The X-API-KEY: mx_live_* header is also accepted.

X-Organization-ID
string
header
required

Required organization context for org-scoped endpoints.

Body

application/json
name
string
required

Friendly name (e.g. 'Production Server').

Required string length: 1 - 255
Example:

"Production API Key"

organization_id
string | null

Scope the key to one organization. If null, the key works for all the user's organizations.

expires_at
string<date-time> | null

Expiry (ISO 8601). If null, never expires.

rate_limit_per_minute
integer
default:60

Max requests per minute for this key.

Required range: 1 <= x <= 1000

Response

The created API key, including the one-time plaintext key.

API key details (without the secret).

key
string
required

Full API key, shown ONLY ONCE. Save it securely.

Example:

"mx_live_2J9vK4xM8nP3wQ7tR5sL1yB6cF0dG2h4vN8pX5mK9rT3wY7u"

id
string<uuid>
name
string
key_hint
string

First 8 characters of the key.

Example:

"2J9vK4xM"

masked_key
string
Example:

"mx_live_2J9vK4xM********"

organization_id
string | null

Organization scope (null = all orgs).

expires_at
string<date-time> | null
is_expired
boolean
is_active
boolean
rate_limit_per_minute
integer
last_used_at
string<date-time> | null
created_at
string<date-time>
revoked_at
string<date-time> | null