{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/epicdirectories/json-schema/epicdirectories-create-api-key-dto-schema.json",
  "title": "CreateApiKeyDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/epicdirectories-api-keys-api-openapi.yml#/components/schemas/CreateApiKeyDto",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name for the API key"
    },
    "directoryId": {
      "type": "string",
      "description": "Restrict the key to a single directory. Accepts either the directory UUID or its slug. Omit for an account-wide key."
    },
    "scopes": {
      "type": "array",
      "description": "Scopes granted to this key. Required — pass `[]` for a read-only key (published listings only). Known scopes: `write` (allow POST/PATCH/PUT/DELETE on listings, attributes, terms, snapshots, webhooks); `read:drafts` (allow read endpoints to surface non-published listings — drafts and hidden); `submissions` (read/action the anonymous submission queue); `reviews` (read/moderate the public review and page-comment queues — approving, and replying to a comment, also need `write`).",
      "items": {
        "type": "string",
        "enum": [
          "write",
          "read:drafts",
          "submissions",
          "reviews",
          "payments"
        ]
      }
    },
    "expiresAt": {
      "type": "string",
      "description": "Expiration date (ISO 8601)"
    }
  },
  "required": [
    "name",
    "scopes"
  ]
}