Draft v0.1 — published for review. Not final until approved; may change incompatibly before 1.0.

Isto Intents Consent

consent.schema.json · raw JSON · JSON Schema 2020-12

What the buyer agreed to, once for all channels (spec §7).

$id: https://istointents.org/schemas/0.1/consent.schema.json

Fields#

fieldtyperequireddescription
specVersioncommon › versionyes
type"consent"yes
idcommon › idyes
createdcommon › timestampyes
holdercommon › partyyes
subjectstringyesbuyer pseudonym
purposesarray of anyOf: "delivery" | "aggregate-demand" | "pseudonymous-visibility", string (pattern ^x-), string (uri, pattern ^https?://)yes
textobjectyes
channelsarray of objectyes
grantedAtcommon › timestampyes
validUntilcommon › timestampyes
withdrawnAtcommon › timestamp
extensionscommon › extensions

Examples#

Full schema#

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://istointents.org/schemas/0.1/consent.schema.json",
  "title": "Isto Intents Consent",
  "description": "What the buyer agreed to, once for all channels (spec §7).",
  "type": "object",
  "required": [
    "specVersion",
    "type",
    "id",
    "created",
    "holder",
    "subject",
    "purposes",
    "text",
    "channels",
    "grantedAt",
    "validUntil"
  ],
  "properties": {
    "specVersion": {
      "$ref": "common.schema.json#/$defs/version"
    },
    "type": {
      "const": "consent"
    },
    "id": {
      "$ref": "common.schema.json#/$defs/id"
    },
    "created": {
      "$ref": "common.schema.json#/$defs/timestamp"
    },
    "holder": {
      "$ref": "common.schema.json#/$defs/party"
    },
    "subject": {
      "type": "string",
      "minLength": 8,
      "description": "buyer pseudonym"
    },
    "purposes": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "anyOf": [
          {
            "enum": [
              "delivery",
              "aggregate-demand",
              "pseudonymous-visibility"
            ]
          },
          {
            "type": "string",
            "pattern": "^x-"
          },
          {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://"
          }
        ]
      }
    },
    "text": {
      "type": "object",
      "required": [
        "uri",
        "version",
        "sha256"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri"
        },
        "version": {
          "type": "string"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": false
    },
    "channels": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "kind",
          "verifiedAt"
        ],
        "properties": {
          "kind": {
            "enum": [
              "email",
              "telegram",
              "push",
              "mcp-client",
              "web"
            ]
          },
          "verifiedAt": {
            "$ref": "common.schema.json#/$defs/timestamp"
          }
        },
        "additionalProperties": false
      }
    },
    "grantedAt": {
      "$ref": "common.schema.json#/$defs/timestamp"
    },
    "validUntil": {
      "$ref": "common.schema.json#/$defs/timestamp"
    },
    "withdrawnAt": {
      "$ref": "common.schema.json#/$defs/timestamp"
    },
    "extensions": {
      "$ref": "common.schema.json#/$defs/extensions"
    }
  },
  "additionalProperties": false
}