{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postzen-dev/json-schema/postzen-dev-api-key-create-request-schema.json",
  "title": "ApiKeyCreateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postzen-dev-api-keys-api-openapi.yml#/components/schemas/ApiKeyCreateRequest",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "Human-readable label for the key."
    },
    "scope": {
      "type": "string",
      "enum": [
        "full",
        "profiles"
      ],
      "default": "full",
      "description": "`full` grants access to all profiles; `profiles` restricts the key to `profileIds`."
    },
    "profileIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "PostZen profile ids. Required when `scope` is `profiles`, and forbidden when `scope` is `full`."
    },
    "permission": {
      "type": "string",
      "enum": [
        "read-write",
        "read"
      ],
      "default": "read-write",
      "description": "`read` keys may only call `GET` endpoints."
    }
  }
}