Skip to main content
POST
/
api
/
v2
/
external
/
orgs
/
{slug}
/
api-keys
Create API key
curl --request POST \
  --url https://api.example.com/api/v2/external/orgs/{slug}/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "id": "<string>",
  "org_id": "<string>",
  "name": "<string>",
  "prefix": "<string>",
  "plaintext_key": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z"
}

Path Parameters

slug
string
required

Body

application/json
name
string
required
Required string length: 1 - 255
expires_at
string<date-time> | null

Response

Successful Response

Response for POST create — contains the plaintext key, shown once.

id
string
required
org_id
string
required
name
string
required
prefix
string
required
plaintext_key
string
required

The API key. Store it now — it will never be shown again.

created_at
string<date-time>
required
expires_at
string<date-time> | null