{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/blackbaud/main/json-schema/blackbaud-constituent-consent-add-schema.json",
  "title": "ConstituentConsentAdd",
  "description": "Represents the consent entity to add to the specified constituent.",
  "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/ConstituentConsentAdd",
  "required": [
    "channel",
    "consent_date",
    "constituent_consent_response",
    "constituent_id"
  ],
  "type": "object",
  "properties": {
    "constituent_id": {
      "type": "string",
      "description": "The immutable system record ID of the constituent associated with 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."
    },
    "user_name": {
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ],
      "description": "The user name associated with the consent. If not supplied, will have a default set based on the user's account."
    }
  },
  "additionalProperties": false
}