{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pushary-com/json-schema/pushary-com-campaign-schema.json",
  "title": "Campaign",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pushary-com-openapi.json#/components/schemas/Campaign",
  "type": "object",
  "required": [
    "id",
    "siteId",
    "name",
    "title",
    "body",
    "status",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Campaign identifier."
    },
    "siteId": {
      "type": "string",
      "description": "The site this campaign belongs to."
    },
    "name": {
      "type": "string",
      "description": "Internal name."
    },
    "title": {
      "type": "string",
      "description": "Notification title."
    },
    "body": {
      "type": "string",
      "description": "Notification body."
    },
    "iconUrl": {
      "type": "string",
      "description": "Icon image URL.",
      "format": "uri"
    },
    "imageUrl": {
      "type": "string",
      "description": "Hero image URL.",
      "format": "uri"
    },
    "actionUrl": {
      "type": "string",
      "description": "Where a click should land.",
      "format": "uri"
    },
    "status": {
      "type": "string",
      "description": "Lifecycle state.",
      "enum": [
        "draft",
        "scheduled",
        "sending",
        "active",
        "paused",
        "completed",
        "cancelled"
      ]
    },
    "scheduledAt": {
      "type": "string",
      "description": "When the campaign is due to send.",
      "format": "date-time"
    },
    "totalTargeted": {
      "type": "integer",
      "description": "Recipients selected."
    },
    "totalSent": {
      "type": "integer",
      "description": "Recipients the push service accepted."
    },
    "totalDelivered": {
      "type": "integer",
      "description": "Deliveries confirmed by the service worker."
    },
    "totalClicked": {
      "type": "integer",
      "description": "Clicks recorded."
    },
    "createdAt": {
      "type": "string",
      "description": "When the campaign was created.",
      "format": "date-time"
    }
  }
}