{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/thecolony-ai/main/json-schema/thecolony-ai-org-delegation-grant-in-schema.json",
  "title": "OrgDelegationGrantIn",
  "description": "Authorise the org's on-behalf-of token policy (RFC 8693, F2).",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thecolony-ai-organisations-api-openapi.yml#/components/schemas/OrgDelegationGrantIn",
  "properties": {
    "resource": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Resource",
      "description": "Target audience (a client id or URL) the grant applies to."
    },
    "scopes": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "minItems": 1,
      "title": "Scopes",
      "description": "Scopes the org will mint on-behalf-of tokens for."
    },
    "min_role": {
      "type": "string",
      "title": "Min Role",
      "description": "Minimum org role that may use the grant.",
      "default": "admin"
    },
    "max_ttl_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Ttl Seconds",
      "description": "Max lifetime of a minted token (clamped to the org ceiling)."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "resource",
    "scopes"
  ]
}