{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clarifymedical/json-schema/clarifymedical-list-of-campaign-recipients-response-schema.json",
  "title": "ListOfCampaignRecipientsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clarifymedical-campaigns-api-openapi.yml#/components/schemas/ListOfCampaignRecipientsResponse",
  "type": "object",
  "properties": {
    "links": {
      "type": "object",
      "properties": {
        "next": {
          "type": [
            "string",
            "null"
          ],
          "description": "URL of the next page, or `null` on the last page."
        },
        "prev": {
          "type": [
            "string",
            "null"
          ],
          "description": "URL of the previous page, or `null` on the first page."
        }
      },
      "required": [
        "next",
        "prev"
      ],
      "description": "Pagination links."
    },
    "meta": {
      "type": "object",
      "properties": {
        "total_records": {
          "type": "number"
        },
        "total_pages": {
          "type": "number"
        },
        "total_unfiltered": {
          "type": "number"
        },
        "campaign_enabled": {
          "type": "boolean"
        },
        "list_evaluation_status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "idle",
            "evaluating",
            "error"
          ]
        },
        "list_member_count": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "total_records",
        "total_pages",
        "total_unfiltered",
        "campaign_enabled",
        "list_evaluation_status",
        "list_member_count"
      ]
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "campaign_recipient"
            ],
            "description": "The resource type; matches the `object` path parameter."
          },
          "id": {
            "type": "string",
            "description": "The unique ID of the resource."
          },
          "attributes": {
            "type": "object",
            "properties": {
              "workflow_run_id": {
                "type": "string",
                "description": "The ID of this recipient’s run through the campaign. Use it to fetch the full engagement timeline."
              },
              "person": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "_id": {
                    "type": "string",
                    "description": "The unique ID of the person record."
                  },
                  "name": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "first_name": {
                        "type": "string",
                        "description": "The person’s first name."
                      },
                      "last_name": {
                        "type": "string",
                        "description": "The person’s last name."
                      },
                      "full_name": {
                        "type": "string",
                        "description": "The person’s full name (first and last combined)."
                      }
                    },
                    "description": "The person’s name, or null when the record has no name set."
                  },
                  "email_addresses": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "items"
                    ],
                    "description": "The person’s email addresses. The campaign sends to the first item."
                  },
                  "avatar_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "URL of the person’s profile image, or null when they have none."
                  },
                  "job_title": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The person’s job title, or null when not known."
                  },
                  "company_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "ID of the company this person belongs to, or null when unaffiliated."
                  }
                },
                "required": [
                  "_id",
                  "name",
                  "email_addresses",
                  "avatar_url",
                  "job_title",
                  "company_id"
                ],
                "description": "The recipient. Null when the run has no linked person record, or that record no longer exists."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "running",
                  "success",
                  "failed",
                  "cancelled",
                  "skipped",
                  "waiting",
                  "retrying"
                ],
                "description": "The raw workflow-run state of this recipient’s campaign run. For the delivery status shown in the app, use `filter[status]` to query instead."
              },
              "resume_at": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Unix timestamp (ms) at which a waiting run resumes, or null when the run is not waiting."
              },
              "current_block_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The campaign step the recipient is currently waiting on, or null when the run is not waiting."
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the recipient entered the campaign."
              },
              "ended_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the recipient’s run finished, or null while still active."
              },
              "exit_reason": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the run ended (for example a reply or an unsubscribe), or null while still active."
              },
              "exit_block_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The campaign step at which the run ended, or null."
              },
              "has_opened": {
                "type": "boolean",
                "description": "Whether the recipient opened at least one campaign email."
              },
              "has_clicked": {
                "type": "boolean",
                "description": "Whether the recipient clicked a link in a campaign email."
              },
              "has_replied": {
                "type": "boolean",
                "description": "Whether the recipient replied to a campaign email."
              },
              "has_unsubscribed": {
                "type": "boolean",
                "description": "Whether the recipient unsubscribed."
              },
              "last_opened_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the recipient most recently opened, or null if never."
              },
              "last_clicked_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the recipient most recently clicked a link, or null if never."
              },
              "last_replied_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the recipient most recently replied, or null if never."
              },
              "_created_at": {
                "type": "string",
                "format": "date-time",
                "description": "When this recipient run was created."
              },
              "_updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "When this recipient run was last updated."
              }
            },
            "required": [
              "workflow_run_id",
              "person",
              "status",
              "resume_at",
              "current_block_id",
              "started_at",
              "ended_at",
              "exit_reason",
              "exit_block_id",
              "has_opened",
              "has_clicked",
              "has_replied",
              "has_unsubscribed",
              "last_opened_at",
              "last_clicked_at",
              "last_replied_at",
              "_created_at",
              "_updated_at"
            ],
            "description": "Field values keyed by field name; available fields depend on the object’s schema."
          },
          "relationships": {
            "type": "object",
            "properties": {},
            "description": "Related resources keyed by relationship name, present when requested via `include`."
          }
        },
        "required": [
          "type",
          "id",
          "attributes"
        ]
      },
      "description": "The page of resources."
    }
  },
  "required": [
    "links",
    "meta",
    "data"
  ]
}