{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/blackbaud/main/json-schema/blackbaud-consent-channel-category-write-schema.json",
  "title": "ConsentChannelCategoryWrite",
  "description": "Represents a request to configure a consent channel category.",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blackbaud-consent-api-openapi.yml#/components/schemas/ConsentChannelCategoryWrite",
  "required": [
    "category",
    "channel"
  ],
  "type": "object",
  "properties": {
    "channel": {
      "enum": [
        "Email",
        "Mail",
        "SMS",
        "Phone",
        "AutoPhone",
        "Social",
        "DataProcessing",
        "Other"
      ],
      "type": "string",
      "description": "The channel<p>Members:</p><ul><li><i>Email</i> - Email</li><li><i>Mail</i> - Mail</li><li><i>SMS</i> - SMS</li><li><i>Phone</i> - Phone</li><li><i>AutoPhone</i> - AutoPhone</li><li><i>Social</i> - Social media</li><li><i>DataProcessing</i> - Data processing</li><li><i>Other</i> - Other</li></ul>"
    },
    "category": {
      "type": "string",
      "description": "The category name or system identifier"
    },
    "solicit_code_assignments": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ConsentSolicitCodeAssignmentWrite"
      },
      "description": "Collection of consent solicit code assignments to be configured for the channel category."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ConsentSolicitCodeAssignmentWrite": {
      "required": [
        "add_remove",
        "response",
        "solicit_code"
      ],
      "type": "object",
      "properties": {
        "response": {
          "enum": [
            "OptIn",
            "OptOut",
            "NoResponse"
          ],
          "type": "string",
          "description": "The consent response that will trigger this solicit code assignment<p>Members:</p><ul><li><i>OptIn</i> - Opt-in</li><li><i>OptOut</i> - Opt-out</li><li><i>NoResponse</i> - No response</li></ul>"
        },
        "add_remove": {
          "enum": [
            "Add",
            "Remove"
          ],
          "type": "string",
          "description": "Add/Remove the solicit code when the given consent response is received.<p>Members:</p><ul><li><i>Add</i> - Add.</li><li><i>Remove</i> - Remove.</li></ul>"
        },
        "solicit_code": {
          "type": "string",
          "description": "The solicit code name"
        },
        "sequence": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Optional sequence number for the solicit code assignment.",
          "format": "int32"
        }
      },
      "additionalProperties": false,
      "description": "Represents a request to write a consent solicit code assignment."
    }
  }
}