{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-create-api-key-response-schema.json",
  "title": "CreateApiKeyResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-api-keys-api-openapi.yml#/components/schemas/CreateApiKeyResponse",
  "type": "object",
  "required": [
    "id",
    "name",
    "scope",
    "scopes",
    "allowed_domains",
    "prefix",
    "token",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "scope": {
      "type": "string",
      "enum": [
        "full",
        "sending"
      ]
    },
    "scopes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApiScope"
      }
    },
    "allowed_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "test": {
      "type": "boolean",
      "description": "A test key (`gm_test_…`)."
    },
    "tenant": {
      "type": "string",
      "description": "The tenant this key is limited to (`external_id`). Present only on tenant keys."
    },
    "prefix": {
      "type": "string"
    },
    "token": {
      "type": "string",
      "description": "Full API key (`gm_…`, or `gm_test_…` for a test key), shown once at creation"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ApiScope": {
      "type": "string",
      "description": "A scope for API keys and OAuth tokens. `full` grants everything.",
      "enum": [
        "full",
        "emails:send",
        "emails:read",
        "domains:read",
        "domains:write",
        "webhooks:write",
        "templates:write",
        "suppressions:write",
        "account:read"
      ]
    }
  }
}