{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dotsy-ai/json-schema/dotsy-ai-api-key-schema.json",
  "title": "ApiKey",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dotsy-ai-account-api-openapi.yml#/components/schemas/ApiKey",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": [
        "string",
        "null"
      ]
    },
    "scope": {
      "type": "string",
      "enum": [
        "read",
        "content",
        "write",
        "admin",
        "monitor"
      ],
      "description": "`read` can only GET. `content` can change text and images on pages and save drafts, never publish (Studio plan and up). `write` can also change sites. `admin` can also manage API keys. `monitor` is platform-admin only and can only call the bug-monitor routes."
    },
    "siteSlugs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The sites the key is limited to, or null for all sites."
    },
    "createdAt": {
      "type": "number",
      "description": "Creation time, Unix ms."
    },
    "secret": {
      "type": [
        "string",
        "null"
      ],
      "description": "The key itself (`pga_…`). Null for an old key whose secret was never stored."
    },
    "personal": {
      "type": "boolean",
      "description": "True for a personal key: a workspace Member made it for themselves. It can do no more than that Member — `read` or `write` scope, edit-level on sites — and stops working when they leave the workspace."
    },
    "owner": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "userId": {
          "type": "string"
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "userId",
        "email",
        "name"
      ],
      "description": "Who a personal key belongs to. Null for a workspace key."
    }
  },
  "required": [
    "id",
    "label",
    "scope",
    "siteSlugs",
    "createdAt",
    "secret",
    "personal",
    "owner"
  ]
}