{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/blackbaud/main/json-schema/blackbaud-constituent-consent-read-collection-schema.json",
  "title": "ConstituentConsentReadCollection",
  "description": "A collection of consent records.",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blackbaud-communication-preference-api-openapi.yml#/components/schemas/ConstituentConsentReadCollection",
  "type": "object",
  "properties": {
    "count": {
      "type": "integer",
      "description": "The number of consent records in the list.",
      "format": "int32",
      "readOnly": true
    },
    "value": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ConstituentConsentRead"
      },
      "description": "The set of consent records included in the response."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ConstituentConsentRead": {
      "required": [
        "channel",
        "consent_date",
        "constituent_consent_response",
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The immutable system record ID of the consent record."
        },
        "channel": {
          "type": "string",
          "description": "The channel that the consent response applies to. Available values can be obtained from the <a href=\"https://developer.sky.blackbaud.com/docs/services/communication-preference/operations/ListConsentChannels\">Consent Channels List</a>."
        },
        "category": {
          "type": [
            "string",
            "null"
          ],
          "description": "The category that the consent response applies to. Available values can be obtained from the <a href=\"https://developer.sky.blackbaud.com/docs/services/communication-preference/operations/ListConsentCategories\">Consent Categories List</a>."
        },
        "source": {
          "type": [
            "string",
            "null"
          ],
          "description": "The source of the consent response from the constituent. Available values can be obtained from the <a href=\"https://developer.sky.blackbaud.com/docs/services/communication-preference/operations/ListConsentSources\">Consent Sources List</a>."
        },
        "consent_date": {
          "type": "string",
          "description": "The date the consent response was received.",
          "format": "date-time"
        },
        "constituent_consent_response": {
          "title": "ConstituentConsentResponse",
          "enum": [
            "OptIn",
            "OptOut",
            "NoResponse"
          ],
          "type": "string",
          "description": "How the constituent responded to consent for the specified channel/category. Available values are <i>OptIn</i>, <i>OptOut</i>, and <i>NoResponse</i>."
        },
        "privacy_notice": {
          "maxLength": 7999,
          "type": [
            "string",
            "null"
          ],
          "description": "The privacy notice provided to the constituent."
        },
        "consent_statement": {
          "maxLength": 7999,
          "type": [
            "string",
            "null"
          ],
          "description": "The statement the constituent responded to when providing consent."
        },
        "date_added": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date the consent response was added.",
          "format": "date-time"
        },
        "user_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user that added the consent response."
        }
      },
      "additionalProperties": false,
      "description": "Represents a consent entity for a constituent."
    }
  }
}