{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-role-schema.json",
  "title": "Role",
  "description": "A named bundle of permission policies. Read-only on `/v1`, and exposed so a machine\ncan discover the id to pass in `role_ids`. The seeded roles (`seeded: true`) are\nplatform-managed and cannot be renamed or recomposed; custom roles are being retired\nin favour of fixed roles and per-key permissions, so no new custom role can be\ncreated and only a seeded key role can be given to a new key.\n\nThe rules a role grants are deliberately NOT exposed — enumerating them would map\nthe tenant's authorization surface to every machine credential in it.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-api-keys-api-openapi.yml#/components/schemas/Role",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "description": "Display name. The seeded machine roles are `Key — Invoke`, `Key — Read-only`, `Key — Editor` and `Key — Infrastructure`."
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "applies_to": {
      "type": "array",
      "description": "Which subject kinds this role may be assigned to. `role_ids` accepts a role only when this includes `api_key` AND `seeded` is true.",
      "items": {
        "type": "string",
        "enum": [
          "user",
          "api_key"
        ]
      }
    },
    "is_default": {
      "type": "boolean",
      "description": "Whether the admin UI prefills this role when creating a new key."
    },
    "seeded": {
      "type": "boolean",
      "description": "True for roles the platform creates and maintains (they cannot be deleted, renamed or recomposed). Only a seeded key role is accepted in `role_ids`; custom roles (`false`) are being retired."
    }
  }
}