{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cotal-ai/json-schema/cotal-ai-consent-schema.json",
  "title": "Consent",
  "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/Consent",
  "type": "object",
  "properties": {
    "v": {
      "const": 1
    },
    "kind": {
      "const": "tool-result-consent"
    },
    "id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,200}$"
    },
    "space": {
      "type": "string"
    },
    "target": {
      "$ref": "#/$defs/LifecycleTarget"
    },
    "holder": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "pattern": "^u_[a-z2-7]{26}$"
        },
        "actor": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_]+$",
          "minLength": 1
        }
      },
      "required": [
        "owner",
        "actor"
      ],
      "additionalProperties": false
    },
    "iat": {
      "type": "integer",
      "minimum": 0
    },
    "exp": {
      "type": "integer",
      "minimum": 0
    },
    "issuer": {
      "type": "object",
      "properties": {
        "keyId": {
          "type": "string"
        }
      },
      "required": [
        "keyId"
      ],
      "additionalProperties": false
    },
    "sig": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    }
  },
  "required": [
    "v",
    "kind",
    "id",
    "space",
    "target",
    "holder",
    "iat",
    "exp",
    "issuer",
    "sig"
  ],
  "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
    }
  }
}