Skip to content

Create key

Creates a new API key with an optional expiry. The full key value is only returned once in the response.

POST /v1/api-keys

Creates a new API key with an optional expiry. The full key value is only returned once in the response.

Request body

Content-Type: application/json

  • name (string) required
  • expiresIn (integer) — Days until expiry
  • scope (string) (enum: full, profiles) — 'full' grants access to all profiles (default), 'profiles' restricts to specific profiles
  • profileIds (array) — Profile IDs this key can access. Required when scope is 'profiles'.
  • permission (string) (enum: read-write, read) — 'read-write' allows all operations (default), 'read' restricts to GET requests only

Example:

json

{
  "name": "Analytics Read-Only Key",
  "scope": "profiles",
  "profileIds": [
    "6507a1b2c3d4e5f6a7b8c9d0"
  ],
  "permission": "read"
}

Responses

201 — Created

  • message (string)
  • apiKey ($ref)

400 — Invalid request (missing name

401