{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-campaign-recipient-page-schema.json",
  "title": "CampaignRecipientPage",
  "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/CampaignRecipientPage",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/CampaignRecipientId"
          },
          "runId": {
            "$ref": "#/$defs/CampaignRunId"
          },
          "contactId": {
            "$ref": "#/$defs/ContactId"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "dispatching",
              "dispatched",
              "failed",
              "skipped"
            ]
          },
          "messageId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "skippedReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "unsubscribed",
                  "blocked",
                  "suppressed",
                  "opted_out",
                  "unreachable",
                  "no_identity",
                  "inactive",
                  "run_cancelled",
                  "run_failed",
                  "missing_merge_field"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "runId",
          "contactId",
          "status",
          "messageId",
          "failureReason",
          "skippedReason",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$defs": {
    "CampaignRecipientId": {
      "type": "string",
      "pattern": "^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "CampaignRecipientId"
    },
    "CampaignRunId": {
      "type": "string",
      "pattern": "^crun_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "CampaignRunId"
    },
    "ContactId": {
      "type": "string",
      "pattern": "^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "ContactId"
    }
  }
}