{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/blackbaud/main/json-schema/blackbaud-edit-marketing-segment-schema.json",
  "title": "EditMarketingSegment",
  "description": "EditMarketingSegment",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blackbaud-altru-marketing-api-openapi.yml#/components/schemas/EditMarketingSegment",
  "type": "object",
  "properties": {
    "name": {
      "maxLength": 100,
      "minLength": 0,
      "type": "string",
      "description": "The name."
    },
    "description": {
      "maxLength": 255,
      "minLength": 0,
      "type": "string",
      "description": "The description."
    },
    "site_id": {
      "type": "string",
      "description": "The site."
    },
    "site_required": {
      "type": "boolean",
      "description": "Indicates whether site required?. Read-only in the SOAP API."
    },
    "segment_category": {
      "type": "string",
      "description": "The category. This code table can be queried at https://api.sky.blackbaud.com/alt-adnmg/codetables/mktsegmentcategorycode/entries"
    },
    "code": {
      "maxLength": 10,
      "minLength": 0,
      "type": "string",
      "description": "The code."
    },
    "segment_part_definition_id": {
      "type": "string",
      "description": "The segment part definition ID. Read-only in the SOAP API."
    },
    "code_value": {
      "type": "string",
      "description": "The code value ID. This simple list can be queried at https://api.sky.blackbaud.com/alt-adnmg/simplelists/78b8b763-9ba2-4bff-ba83-563edff889d8?parameters=part_definition_id,{segment_part_definition_id}&parameters=only_special_character_formats,{0}&parameters=valid_values_only,{1}."
    },
    "query_view_catalog": {
      "type": "string",
      "description": "The record source. This simple list can be queried at https://api.sky.blackbaud.com/alt-adnmg/simplelists/a8477659-6ee9-4b49-861e-41711df69c9b."
    },
    "selections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EditMarketingSegmentSelections"
      },
      "description": "Selections."
    },
    "groups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EditMarketingSegmentGroups"
      },
      "description": "Groups."
    },
    "smart_queries_exist": {
      "type": "boolean",
      "description": "Indicates whether smart queries exist. Read-only in the SOAP API."
    },
    "in_use": {
      "type": "boolean",
      "description": "Indicates whether is in use. Read-only in the SOAP API."
    },
    "date_changed": {
      "type": "string",
      "description": "The date changed. Read-only in the SOAP API. Uses the format YYYY-MM-DDThh:mm:ss. An example date: <i>1955-11-05T22:04:00</i>.",
      "format": "date-time"
    },
    "allow_code_update": {
      "type": "boolean",
      "description": "Indicates whether allows the client to indicate that the form is being launched in such a way that the segment's code cannot be updated without causing concurrency problems.."
    },
    "form_id": {
      "type": "string",
      "description": "The form ID. Read-only in the SOAP API."
    }
  },
  "additionalProperties": false,
  "x-display-name": "Constituent Segment Edit Form 2",
  "x-display-id": "Constituent Segment Edit Form 2",
  "$defs": {
    "EditMarketingSegmentGroups": {
      "type": "object",
      "properties": {
        "segment_group_id": {
          "type": "string",
          "description": "segmentgroupid"
        },
        "name": {
          "type": "string",
          "description": "name"
        },
        "sequence": {
          "type": "integer",
          "description": "sequence"
        }
      },
      "description": "EditMarketingSegmentGroups",
      "x-display-name": "groups",
      "x-display-id": "groups"
    },
    "EditMarketingSegmentSelections": {
      "type": "object",
      "properties": {
        "selection_id": {
          "type": "string",
          "description": "selectionid"
        },
        "name": {
          "type": "string",
          "description": "name"
        },
        "description": {
          "type": "string",
          "description": "description"
        },
        "record_type": {
          "type": "string",
          "description": "recordtype"
        },
        "record_type_id": {
          "type": "string",
          "description": "recordtypeid"
        },
        "query_view_id": {
          "type": "string",
          "description": "queryviewid"
        },
        "query_id": {
          "type": "string",
          "description": "queryid"
        },
        "query_type": {
          "type": "string",
          "description": "The querytype. Read-only in the SOAP API. Available values are <i>other</i>, <i>ad-hoc</i>, <i>smart</i>"
        },
        "can_edit": {
          "type": "boolean",
          "description": "canedit"
        },
        "user_granted_rights": {
          "type": "boolean",
          "description": "usergrantedrights"
        }
      },
      "description": "EditMarketingSegmentSelections",
      "x-display-name": "selections",
      "x-display-id": "selections"
    }
  }
}