{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reviewflowz-com/json-schema/reviewflowz-com-campaign-schema.json",
  "title": "Campaign",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reviewflowz-com-openapi.json#/components/schemas/Campaign",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms",
        "whatsapp"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "draft",
        "active",
        "paused"
      ]
    },
    "segment": {
      "type": [
        "string",
        "null"
      ],
      "description": "The segment whose new members get the request, or null for the campaign's own list (the people added to it with POST /v3/campaigns/{id}/contacts)."
    },
    "review_page_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "The page the request's button opens. It sends each customer on to one of `destinations`."
    },
    "destinations": {
      "type": "array",
      "description": "Where the review page sends customers, in order of preference. An account billed per location names platforms, and each customer's location picks its source there; any other account names sources.",
      "items": {
        "$ref": "#/$defs/CampaignDestination"
      }
    },
    "send_delay_minutes": {
      "type": [
        "integer",
        "null"
      ]
    },
    "throttle": {
      "type": [
        "object",
        "null"
      ],
      "description": "At most `limit` uploaded contacts let through every `period_minutes`, or null for no limit.",
      "properties": {
        "limit": {
          "type": "integer"
        },
        "period_minutes": {
          "type": "integer"
        }
      }
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "whatsapp"
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ]
          },
          "cta_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "sender": {
            "type": [
              "string",
              "null"
            ]
          },
          "reply_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "delay_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "complete": {
            "type": "boolean"
          }
        }
      }
    },
    "ready": {
      "type": "boolean"
    },
    "blockers": {
      "type": "array",
      "description": "What is missing before it can be turned on. Empty when `ready` is true.",
      "items": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "CampaignDestination": {
      "type": "object",
      "properties": {
        "platform": {
          "type": "string",
          "description": "A platform id (GET /v3/platforms), on accounts billed per location. Each customer is sent to that platform's source at their location. Absent when `source` is set."
        },
        "source": {
          "type": "string",
          "description": "A source id, on any other account. Absent when `platform` is set."
        },
        "goal": {
          "type": "string",
          "enum": [
            "most_reviews",
            "rating",
            "five_star_reviews"
          ],
          "description": "`most_reviews`: always send customers here. `rating`: send them here while its rating is under `target`. `five_star_reviews`: send them here until it has `target` 5-star reviews."
        },
        "target": {
          "type": [
            "number",
            "null"
          ],
          "description": "The rating (1 to 5) for `rating`, the number of 5-star reviews for `five_star_reviews`, null for `most_reviews`."
        },
        "button_text": {
          "type": [
            "string",
            "null"
          ],
          "description": "The button's words on the review page, or null for \"Review us on\" and the platform's name."
        }
      }
    }
  }
}