{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://heartcortex.ai/schemas/1.0/consent.schema.json",
  "title": "consent",
  "type": "object",
  "required": [
    "id",
    "status"
  ],
  "properties": {
    "id": {
      "$ref": "common.schema.json#/$defs/uuid",
      "x-heart-privacy": "public"
    },
    "status": {
      "enum": [
        "granted",
        "withdrawn",
        "expired"
      ],
      "x-heart-privacy": "public"
    },
    "purpose": {
      "type": "string",
      "x-heart-privacy": "internal"
    },
    "recipient": {
      "type": "string",
      "x-heart-privacy": "internal",
      "description": "A kind of recipient (model-provider, subscriber, peer, gateway) or one recipient's name."
    },
    "grantedAt": {
      "$ref": "common.schema.json#/$defs/timestamp",
      "x-heart-privacy": "internal"
    },
    "expiresAt": {
      "$ref": "common.schema.json#/$defs/timestamp",
      "x-heart-privacy": "internal"
    },
    "withdrawnAt": {
      "$ref": "common.schema.json#/$defs/timestamp",
      "x-heart-privacy": "internal"
    },
    "subject": {
      "type": "string",
      "x-heart-privacy": "private"
    },
    "ext": {
      "$ref": "common.schema.json#/$defs/ext",
      "x-heart-privacy": "private"
    }
  }
}
