{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-campaign-audience-schema.json",
  "title": "CampaignAudience",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-campaigns-api-openapi.yml#/components/schemas/CampaignAudience",
  "type": "object",
  "properties": {
    "topicId": {
      "$ref": "#/$defs/TopicId"
    },
    "includeTags": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "excludeTags": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "contactIds": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContactId"
          },
          "maxItems": 25000
        },
        {
          "type": "null"
        }
      ]
    },
    "groupIds": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContactGroupId"
          },
          "maxItems": 100
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "topicId"
  ],
  "additionalProperties": false,
  "$defs": {
    "ContactGroupId": {
      "type": "string",
      "pattern": "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "ContactGroupId"
    },
    "ContactId": {
      "type": "string",
      "pattern": "^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "ContactId"
    },
    "TopicId": {
      "type": "string",
      "pattern": "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "TopicId"
    }
  }
}