Skip to main content
POST
/
api
/
api-keys
Create Api Key
curl --request POST \
  --url https://api.example.com/api/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scopes": [
    "<string>"
  ],
  "expires_in_days": 183
}
'
{
  "id": 123,
  "uuid": "<string>",
  "name": "<string>",
  "key": "<string>",
  "key_preview": "<string>",
  "scopes": [
    "<string>"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-API-Key
string | null

Cookies

antidote_session
string | null

Body

application/json

Request to create a new API key.

name
string
required
Required string length: 1 - 255
scopes
string[]
expires_in_days
integer | null
Required range: 1 <= x <= 365

Response

Successful Response

Response when creating an API key - includes the full key (shown only once).

id
integer
required
uuid
string
required
name
string
required
key
string
required
key_preview
string
required
scopes
string[]
required
created_at
string<date-time>
required
expires_at
string<date-time> | null