{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cotal-ai/json-schema/cotal-ai-consent-request-schema.json",
  "title": "ConsentRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cotal-ai-auth-host-openapi.yml#/components/schemas/ConsentRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,200}$"
    },
    "idpToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 16384
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "accountPublicKey": {
      "type": "string"
    },
    "holder": {
      "type": "object",
      "properties": {
        "actor": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_]+$",
          "minLength": 1
        },
        "lifecycleUid": {
          "type": "string",
          "pattern": "^[a-z0-9]{26,32}$"
        }
      },
      "required": [
        "actor",
        "lifecycleUid"
      ],
      "additionalProperties": false
    },
    "target": {
      "$ref": "#/$defs/LifecycleTarget"
    },
    "ttlMs": {
      "type": "integer",
      "minimum": 1,
      "maximum": 86400000
    }
  },
  "required": [
    "id",
    "idpToken",
    "subject",
    "accountPublicKey",
    "holder",
    "target",
    "ttlMs"
  ],
  "additionalProperties": false,
  "$defs": {
    "LifecycleTarget": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "pattern": "^u_[a-z2-7]{26}$"
        },
        "actor": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_]+$",
          "minLength": 1
        },
        "lifecycleUid": {
          "type": "string",
          "pattern": "^[a-z0-9]{26,32}$"
        }
      },
      "required": [
        "owner",
        "actor",
        "lifecycleUid"
      ],
      "additionalProperties": false
    }
  }
}