{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendly-now/json-schema/sendly-now-create-api-key-body-schema.json",
  "title": "CreateApiKeyBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendly-now-api-keys-api-openapi.yml#/components/schemas/CreateApiKeyBody",
  "properties": {
    "domainId": {
      "format": "uuid",
      "type": [
        "string",
        "null"
      ]
    },
    "legacyGrantPreset": {
      "enum": [
        "FULL",
        "SENDING_ONLY"
      ],
      "type": "string"
    },
    "mode": {
      "description": "`LIVE` (default) or `TEST`. A test key can only send from the project's sandbox address, which accepts only the project's own verified account addresses as recipients, so it cannot reach a customer. Its sends are real sends down the same pipeline and are marked `sentInTestMode`. Fixed at creation.",
      "enum": [
        "LIVE",
        "TEST"
      ],
      "type": "string"
    },
    "name": {
      "maxLength": 120,
      "minLength": 1,
      "type": "string"
    },
    "scopes": {
      "description": "The explicit grant the new key will carry. Omitted ⇒ materialised from `legacyGrantPreset`. A `SENDING_ONLY` key may carry only `emails:send`.",
      "items": {
        "enum": [
          "emails:send",
          "emails:read",
          "contacts:read",
          "contacts:write",
          "campaigns:read",
          "campaigns:write",
          "segments:read",
          "segments:write",
          "workflows:read",
          "workflows:write",
          "templates:read",
          "templates:write",
          "domains:read",
          "domains:write",
          "webhooks:read",
          "webhooks:write",
          "suppression:read",
          "suppression:write",
          "analytics:read",
          "usage:read",
          "events:read",
          "events:write",
          "projects:read",
          "projects:write",
          "api-keys:read",
          "api-keys:write",
          "campaigns:send",
          "mailboxes:read",
          "mailboxes:write",
          "emails:test",
          "deliverability:read",
          "mailboxes:send",
          "validation:read",
          "validation:write",
          "topics:read",
          "topics:write",
          "lists:read",
          "lists:write",
          "mailbox-conversations:read",
          "mailbox-conversations:reply",
          "billing:read",
          "billing:write",
          "account:read",
          "account:write",
          "members:read",
          "members:write",
          "connections:read",
          "connections:write",
          "support:read",
          "support:write"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "tiers": {
      "description": "Permission groups: the key carries every scope of each named tier. Send `tiers` or `scopes`, not both (`422`).",
      "items": {
        "enum": [
          "read",
          "write",
          "destructive",
          "billing",
          "account",
          "team",
          "connections",
          "support",
          "keys"
        ],
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "name"
  ],
  "type": "object"
}