{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commsharbor/json-schema/commsharbor-campaign-schema.json",
  "title": "Campaign",
  "description": "A marketing send to an audience. Launching freezes the eligible recipients exactly once — the frozen set is what gets sent, no matter what changes afterwards.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commsharbor-organizations-api-openapi.yml#/components/schemas/Campaign",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Campaign ID."
    },
    "name": {
      "type": "string",
      "description": "Campaign name."
    },
    "status": {
      "type": "string",
      "description": "Where the campaign is."
    },
    "domain_id": {
      "type": "string",
      "description": "Domain it sends from."
    },
    "audience_id": {
      "type": "string",
      "description": "Audience it goes to."
    },
    "template_id": {
      "type": "string",
      "description": "Published marketing template used."
    },
    "template_version": {
      "type": "integer",
      "description": "Frozen template version."
    },
    "scheduled_for": {
      "type": [
        "string",
        "null"
      ],
      "description": "When it is scheduled, in the organization's timezone."
    },
    "frozen_recipients": {
      "type": [
        "integer",
        "null"
      ],
      "description": "How many recipients were frozen at launch."
    },
    "created_at": {
      "type": "string",
      "description": "Creation time (UTC)."
    }
  },
  "required": [
    "id",
    "name",
    "status",
    "domain_id",
    "audience_id",
    "template_id",
    "template_version",
    "scheduled_for",
    "frozen_recipients",
    "created_at"
  ]
}