{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aimeat-io/json-schema/aimeat-io-consent-grant-schema.json",
  "title": "ConsentGrant",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aimeat-io-consent-api-openapi.yml#/components/schemas/ConsentGrant",
  "type": "object",
  "required": [
    "data_pattern",
    "recipient",
    "purpose"
  ],
  "properties": {
    "data_pattern": {
      "type": "string",
      "maxLength": 256
    },
    "recipient": {
      "type": "string",
      "maxLength": 256,
      "description": "Who receives access. Supported patterns:\n- `*` — any accessor (wildcard), the anonymous reader included\n- `agent#owner@node` — specific agent GAII\n- `organism.{id}` — all members of an organism\n- `ghii:username@node` — all agents of a GHII user\n- `domain:*.example.com` — all signed-in principals on matching node domains; never the anonymous reader, so `domain:*` is not `*`\n- `node:node-id` — all agents on a specific node\n"
    },
    "purpose": {
      "type": "string",
      "maxLength": 512
    },
    "scope": {
      "type": "string",
      "enum": [
        "local",
        "federation",
        "auth",
        "private",
        "dmz"
      ],
      "description": "The reach (AIMEAT Core 2026-11 AUTHZ-18). `local`: the recipient reads matching records on this node. `federation`: as local, and matching records that are also public may be replicated to peers and listed in the directory. `auth`: another node may sign the person in with the credentials this node holds. `private` and `dmz` are deprecated names for `local`, stored and answered as `local` (the answer carries the Deprecation headers). Absent: `federation` before node 4.0.0, `local` from it."
    },
    "expires": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "metadata": {
      "type": "object"
    }
  }
}