API Keys

Create an API key

Mint a new key for your workspace. The full token is returned once, so store it immediately. Requested scopes must be a subset of the calling key’s own scopes, and cannot include apikeys:manage.

Requires the apikeys:manage scope, which no wildcard grants and which can only be created from the dashboard.

post/v1/api-keys

Request

  • Base URL: https://api.mailbeast.ai
  • URL: https://api.mailbeast.ai/v1/api-keys
  • Auth: HTTP bearer

Request body

namestring required
scopesstring[] required

Granted scopes (least-privilege). Must be a subset of the caller.

environment'live' | 'test'
expiresAtstring date-time

ISO-8601 expiry; omit for a non-expiring key.

Example request

{
  "name": "CI pipeline",
  "scopes": [
    "campaigns:read",
    "usage:read"
  ]
}

Response

Key created; token returned once.

tokenstring required

The full secret token. Store it now - it is never retrievable again.

Example response

{
  "token": "mb_live_7Fq2Ka9Lm3Xb0ZpH_Ej3VcCSRq0qZHbFbi7GQwD… ",
  "apiKey": {
    "id": "5b8e1d90-3c47-4a26-9f01-7ea2c6d5b483",
    "name": "CI pipeline",
    "keyPrefix": "mb_live_7Fq2Ka9Lm3Xb0ZpH_••••",
    "scopes": [
      "campaigns:read",
      "usage:read"
    ],
    "environment": "live"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.