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

Body

application/json
name
string
required

Human-readable label

Required string length: 1 - 255
scopes
string[]
required

Granted scopes

Minimum array length: 1
key_type
string
default:human

Key type: 'human' or 'agent'

expires_at
string<date-time> | null

Optional expiry (UTC ISO 8601)

allowed_sources
string[] | null

Restrict ingestion to these source names (null = unrestricted)

Response

Successful Response

data
APIKeyCreated · object
required

Returned only by POST /v1/api-keys. Contains the full plain-text key (shown once).

meta
Meta · object