Skip to main content
POST
/
api
/
v1
/
auth
/
api-keys
Create Api Key
curl --request POST \
  --url https://api.example.com/api/v1/auth/api-keys \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "scopes": [
    "<string>"
  ],
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "key_prefix": "<string>",
  "scopes": [
    "<string>"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "key": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-Key
string
header
required

Body

application/json

Request schema for creating an API key.

name
string
required
Required string length: 1 - 255
scopes
string[] | null
expires_at
string<date-time> | null

Response

Successful Response

Response schema for API key.

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