# Campaigns

A campaign returned by Platform list, get, create and update. `sendWindow` is null when sending is unrestricted by local hours.

## Endpoints

- `POST /messaging/projects/{projectSlug}/campaigns/{id}/test-send`: [Send project campaign test](https://docs.polymorfa.com/api/campaigns/send-project-campaign-test) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns`: [Create project campaign](https://docs.polymorfa.com/api/campaigns/create-project-campaign) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaign-reply-flows`: [Create project campaign reply flow](https://docs.polymorfa.com/api/campaigns/create-project-campaign-reply-flow) (Messaging API)
- `POST /platform/campaigns`: [Create campaign](https://docs.polymorfa.com/api/campaigns/create-campaign) (Platform API)
- `POST /platform/campaign-reply-flows`: [Create campaign reply flow](https://docs.polymorfa.com/api/campaigns/create-campaign-reply-flow) (Platform API)
- `GET /messaging/projects/{projectSlug}/campaigns`: [List project campaigns](https://docs.polymorfa.com/api/campaigns/list-project-campaigns) (Messaging API)
- `GET /messaging/projects/{projectSlug}/campaigns/{id}/recipients`: [List project campaign recipients](https://docs.polymorfa.com/api/campaigns/list-project-campaign-recipients) (Messaging API)
- `GET /platform/campaigns`: [List campaigns](https://docs.polymorfa.com/api/campaigns/list-campaigns) (Platform API)
- `GET /platform/campaigns/{campaignId}/events`: [List campaign events](https://docs.polymorfa.com/api/campaigns/list-campaign-events) (Platform API)
- `GET /platform/campaigns/{campaignId}/recipients`: [List campaign recipients](https://docs.polymorfa.com/api/campaigns/list-campaign-recipients) (Platform API)
- `GET /platform/campaigns/{campaignId}/approvals`: [List campaign launch approvals](https://docs.polymorfa.com/api/campaigns/list-campaign-launch-approvals) (Platform API)
- `GET /messaging/projects/{projectSlug}/campaigns/{id}`: [Get project campaign](https://docs.polymorfa.com/api/campaigns/get-project-campaign) (Messaging API)
- `GET /messaging/projects/{projectSlug}/campaigns/{id}/analytics`: [Get project campaign analytics](https://docs.polymorfa.com/api/campaigns/get-project-campaign-analytics) (Messaging API)
- `GET /messaging/projects/{projectSlug}/campaigns/{id}/links`: [Get project campaign links](https://docs.polymorfa.com/api/campaigns/get-project-campaign-links) (Messaging API)
- `GET /messaging/projects/{projectSlug}/campaign-reply-flows/{id}`: [Get project campaign reply flow](https://docs.polymorfa.com/api/campaigns/get-project-campaign-reply-flow) (Messaging API)
- `GET /platform/campaigns/{campaignId}`: [Get campaign](https://docs.polymorfa.com/api/campaigns/get-campaign) (Platform API)
- `GET /platform/campaign-reply-flows/{replyFlowId}`: [Get campaign reply flow](https://docs.polymorfa.com/api/campaigns/get-campaign-reply-flow) (Platform API)
- `GET /platform/campaigns/{campaignId}/analytics`: [Get campaign analytics](https://docs.polymorfa.com/api/campaigns/get-campaign-analytics) (Platform API)
- `GET /platform/campaigns/{campaignId}/links`: [Get campaign links](https://docs.polymorfa.com/api/campaigns/get-campaign-links) (Platform API)
- `PATCH /messaging/projects/{projectSlug}/campaigns/{id}`: [Update project campaign](https://docs.polymorfa.com/api/campaigns/update-project-campaign) (Messaging API)
- `PATCH /platform/campaigns/{campaignId}`: [Update campaign](https://docs.polymorfa.com/api/campaigns/update-campaign) (Platform API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/enrollments`: [Enroll project campaign contact](https://docs.polymorfa.com/api/campaigns/enroll-project-campaign-contact) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/launch`: [Launch project campaign](https://docs.polymorfa.com/api/campaigns/launch-project-campaign) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/pause`: [Pause project campaign](https://docs.polymorfa.com/api/campaigns/pause-project-campaign) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/resume`: [Resume project campaign](https://docs.polymorfa.com/api/campaigns/resume-project-campaign) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/reschedule`: [Reschedule project campaign](https://docs.polymorfa.com/api/campaigns/reschedule-project-campaign) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/requeue`: [Requeue campaign](https://docs.polymorfa.com/api/campaigns/requeue-campaign) (Messaging API)
- `PUT /messaging/projects/{projectSlug}/campaigns/{id}/reply-flow`: [Set project campaign reply flow](https://docs.polymorfa.com/api/campaigns/set-project-campaign-reply-flow) (Messaging API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/recipients`: [Add project campaign recipients](https://docs.polymorfa.com/api/campaigns/add-project-campaign-recipients) (Messaging API)
- `GET /messaging/projects/{projectSlug}/campaigns/{id}/recipients/export`: [Export project campaign recipients](https://docs.polymorfa.com/api/campaigns/export-project-campaign-recipients) (Messaging API)
- `POST /platform/campaigns/{campaignId}/launch`: [Launch campaign](https://docs.polymorfa.com/api/campaigns/launch-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/pause`: [Pause campaign](https://docs.polymorfa.com/api/campaigns/pause-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/resume`: [Resume campaign](https://docs.polymorfa.com/api/campaigns/resume-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/reschedule`: [Reschedule campaign](https://docs.polymorfa.com/api/campaigns/reschedule-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/archive`: [Archive campaign](https://docs.polymorfa.com/api/campaigns/archive-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/duplicate`: [Duplicate campaign](https://docs.polymorfa.com/api/campaigns/duplicate-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/requeue`: [Requeue failed campaign](https://docs.polymorfa.com/api/campaigns/requeue-failed-campaign) (Platform API)
- `POST /platform/campaigns/{campaignId}/enrollments`: [Enroll campaign contact](https://docs.polymorfa.com/api/campaigns/enroll-campaign-contact) (Platform API)
- `POST /platform/campaigns/{campaignId}/test-send`: [Test send campaign](https://docs.polymorfa.com/api/campaigns/test-send-campaign) (Platform API)
- `PUT /platform/campaigns/{campaignId}/reply-flow`: [Set campaign reply flow](https://docs.polymorfa.com/api/campaigns/set-campaign-reply-flow) (Platform API)
- `POST /platform/campaigns/{campaignId}/recipients`: [Add campaign recipients](https://docs.polymorfa.com/api/campaigns/add-campaign-recipients) (Platform API)
- `GET /platform/campaigns/{campaignId}/recipients/export`: [Export campaign recipients](https://docs.polymorfa.com/api/campaigns/export-campaign-recipients) (Platform API)
- `POST /messaging/projects/{projectSlug}/campaigns/{id}/stop`: [Stop project campaign](https://docs.polymorfa.com/api/campaigns/stop-project-campaign) (Messaging API)
- `POST /platform/campaigns/{campaignId}/stop`: [Stop campaign](https://docs.polymorfa.com/api/campaigns/stop-campaign) (Platform API)
- `DELETE /platform/campaigns/{campaignId}`: [Delete campaign](https://docs.polymorfa.com/api/campaigns/delete-campaign) (Platform API)

## The campaign object

A campaign returned by Platform list, get, create and update. `sendWindow` is null when sending is unrestricted by local hours.

### Attributes

- `id` (string (uuid), required, format uuid). Identifier for this resource.
- `name` (string, required). Human-readable name for this resource.
- `status` (string, required). Current status of this resource or operation.
- `templateId` (string (uuid), required, nullable, format uuid). Identifier of the message template.
- `recipientListId` (string (uuid), required, nullable, format uuid). Identifier for the recipient list.
- `recipientCount` (integer, required, min 0). Number of recipients.
- `sentCount` (integer, required, min 0). Number of sents.
- `deliveredCount` (integer, required, min 0). Number of delivereds.
- `readCount` (integer, required, min 0). Number of reads.
- `failedCount` (integer, required, min 0). Number of faileds.
- `skippedCount` (integer, required, min 0). Number of skippeds.
- `scheduledAt` (integer, required, nullable). Scheduled start in Unix milliseconds.
- `launchedAt` (integer, required, nullable). Launch time in Unix milliseconds.
- `completedAt` (integer, required, nullable). Completion time in Unix milliseconds.
- `createdAt` (integer, required). Creation time in Unix milliseconds.
- `updatedAt` (integer, required). Last update in Unix milliseconds.
- `sendWindow` (object, required, nullable). Specifies send window for this management platform campaign.
  - `timeZone` (string, required). IANA time zone the window is written in.
  - `days` (array of string, required). Days associated with this management campaign send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
  - `hours` (array of object, required). Hours associated with this management campaign send window.
    - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
    - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `recipientTimeZone` (boolean, required). Whether recipient time zone.
  - `timeZoneVariable` (string, required). Specifies time zone variable for this management campaign send window.
- `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
  - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
  - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
- `variableMapping` (object, nullable, max properties 50). How each content variable is filled; null when the campaign has no mapping.
- `drip` (object, required, nullable). Specifies drip for this management platform campaign.
  - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
  - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
  - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
- `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
- `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
- `followUp` (object, required, nullable). Specifies follow up for this management platform campaign.
  - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
  - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
  - `message` (object, required). Human-readable message associated with this result.
    - One of:
      - `text` (object).
        - `type` (string, required). Type discriminator for this object. Values: `text`.
        - `text` (string, required, length 1–16384). Text content carried by this object.
      - `template` (object).
        - `type` (string, required). Type discriminator for this object. Values: `template`.
        - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
- `composerBlueprint` (any). Specifies composer blueprint for this management platform campaign.
- `messages` (any). Specifies messages for this management platform campaign.
- `audienceRef` (any). Specifies audience ref for this management platform campaign.
- `senderConfig` (any). Specifies sender config for this management platform campaign.
- `complianceConfig` (any). Specifies compliance config for this management platform campaign.
- `variants` (array of object, nullable). The A/B variants; null for a broadcast.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
  - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
  - `blueprint` (object, required). The message this variant sends, in the composed-message format.
    - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
    - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
- `variantStrategy` (object, nullable). How the A/B test runs; null for a broadcast.
  - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
  - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
  - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
  - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
  - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
- `experimentOutcome` (object, required, nullable). The saved A/B result, or null before a decision and for a broadcast.
  - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
  - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
  - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
- `messageVariations` (array of object, nullable, items 2–5). Weighted message alternatives, or null when the campaign sends one message.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
  - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
  - `blueprint` (object, required). Structured blueprint values for this message variation.
    - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
    - `source` (string, required, length 1–4096). Specifies source for this blueprint.
- `segmentId` (string (uuid), nullable, format uuid). Saved audience segment the campaign evaluates at launch, or null.
- `segmentSnapshot` (object, nullable). What launch froze from the segment: its revision, the evaluation time in Unix milliseconds and the matching profile count. Null before a segment launch.
  - `revision` (integer, required, min 1). Segment revision that launch evaluated.
  - `evaluatedAt` (integer, required, min 0). Time launch evaluated the segment, in Unix milliseconds.
  - `matchedCount` (integer, required, min 0). Profiles that matched at launch, before opt-outs and withheld consent were removed.
- `frequencyCap` (object, required, nullable). This campaign's own contact frequency cap; null when only the team cap applies.
  - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
  - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.
```json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "status": "string",
  "templateId": "00000000-0000-4000-8000-000000000000",
  "recipientListId": "00000000-0000-4000-8000-000000000000",
  "recipientCount": 0,
  "sentCount": 0,
  "deliveredCount": 0,
  "readCount": 0,
  "failedCount": 0,
  "skippedCount": 0,
  "scheduledAt": 0,
  "launchedAt": 0,
  "completedAt": 0,
  "createdAt": 0,
  "updatedAt": 0,
  "sendWindow": {
    "timeZone": "string",
    "days": [
      "monday"
    ],
    "hours": [
      {
        "start": "09:00",
        "end": "18:00"
      }
    ],
    "recipientTimeZone": true,
    "timeZoneVariable": "string"
  },
  "trackedLinks": [
    {
      "key": "offer",
      "url": "https://example.com/spring-sale"
    }
  ],
  "variableMapping": {},
  "drip": {
    "enrollment": "audience",
    "exitOnReply": true,
    "exitOnLinkClick": false
  },
  "enrollmentOpen": true,
  "pauseReason": "string",
  "followUp": {
    "delaySeconds": 86400,
    "expirySeconds": 604800,
    "message": {
      "type": "text",
      "text": "string"
    }
  },
  "composerBlueprint": null,
  "messages": null,
  "audienceRef": null,
  "senderConfig": null,
  "complianceConfig": null,
  "variants": [
    {
      "key": "a",
      "label": "string",
      "weight": 1,
      "blueprint": {
        "version": 2,
        "source": "string"
      }
    }
  ],
  "variantStrategy": {
    "winnerCriterion": "delivery",
    "holdoutPercent": 0,
    "testSlicePercent": 20,
    "autoPromote": true,
    "testWindowMinutes": 15
  },
  "experimentOutcome": {
    "state": "promoted",
    "winnerKey": "string",
    "reason": "insufficient_evidence"
  },
  "messageVariations": [
    {
      "key": "string",
      "weight": 1,
      "blueprint": {
        "version": 2,
        "source": "string"
      }
    }
  ],
  "segmentId": "00000000-0000-4000-8000-000000000000",
  "segmentSnapshot": {
    "revision": 1,
    "evaluatedAt": 0,
    "matchedCount": 0
  },
  "frequencyCap": {
    "maxPer24Hours": 1,
    "maxPer7Days": 1
  }
}
```

## The Messaging API campaign object

### Attributes

- `id` (string, required). Identifier for this resource.
- `name` (string, required). Human-readable name for this resource.
- `status` (string, required). Current status of this resource or operation.
- `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
- `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
- `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
  - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
    - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
    - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
- `recipientListId` (string, required, nullable). Identifier for the recipient list.
- `recipientCount` (number, required). Number of recipients.
- `sentCount` (number, required). Number of sents.
- `deliveredCount` (number, required). Number of delivereds.
- `readCount` (number, required). Number of reads.
- `failedCount` (number, required). Number of faileds.
- `skippedCount` (number, required). Number of skippeds.
- `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
- `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
- `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
- `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
- `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
- `variants` (array of object, nullable). The A/B variants; null for a broadcast.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
  - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
  - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
    - `version` (integer, required). Specifies version for this native campaign variant message.
    - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
- `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
  - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
  - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
  - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
  - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
  - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
- `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
  - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
  - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
  - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
- `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
  - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
  - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
  - `message` (object, required). Human-readable message associated with this result.
    - One of:
      - `text` (object).
        - `type` (string, required). Type discriminator for this object. Values: `text`.
        - `text` (string, required, length 1–16384). Text content carried by this object.
      - `template` (object).
        - `type` (string, required). Type discriminator for this object. Values: `template`.
        - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
- `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
  - `timeZone` (string, required). IANA time zone the window is written in.
  - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
  - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
    - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
    - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
  - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
- `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
  - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
  - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
- `drip` (object, required, nullable). Specifies drip for this native campaign.
  - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
  - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
  - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
- `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
- `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
- `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
- `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
  - `revision` (integer, required). Segment revision that launch evaluated.
  - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
  - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
- `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
  - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
  - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
```json
{
  "id": "string",
  "name": "string",
  "status": "string",
  "templateId": "string",
  "variableMapping": {},
  "messageVariations": [
    {
      "key": "short",
      "weight": 50,
      "blueprint": {
        "version": 0,
        "source": "string"
      }
    }
  ],
  "recipientListId": "string",
  "recipientCount": 0,
  "sentCount": 0,
  "deliveredCount": 0,
  "readCount": 0,
  "failedCount": 0,
  "skippedCount": 0,
  "scheduledAt": 0,
  "launchedAt": 0,
  "completedAt": 0,
  "createdAt": 0,
  "updatedAt": 0,
  "variants": [
    {
      "key": "a",
      "label": "Short intro",
      "weight": 50,
      "blueprint": {
        "version": 0,
        "source": "Hi {{first_name}}, your offer is ready."
      }
    }
  ],
  "variantStrategy": {
    "winnerCriterion": "delivery",
    "holdoutPercent": 0,
    "testSlicePercent": 20,
    "autoPromote": true,
    "testWindowMinutes": 15
  },
  "experimentOutcome": {
    "state": "promoted",
    "winnerKey": "string",
    "reason": "insufficient_evidence"
  },
  "followUp": {
    "delaySeconds": 86400,
    "expirySeconds": 604800,
    "message": {
      "type": "text",
      "text": "string"
    }
  },
  "sendWindow": {
    "timeZone": "America/Sao_Paulo",
    "days": [
      "monday",
      "tuesday",
      "wednesday",
      "thursday",
      "friday"
    ],
    "hours": [
      {
        "start": "09:00",
        "end": "18:00"
      }
    ],
    "recipientTimeZone": true,
    "timeZoneVariable": "timeZone"
  },
  "trackedLinks": [
    {
      "key": "offer",
      "url": "https://example.com/spring-sale"
    }
  ],
  "drip": {
    "enrollment": "audience",
    "exitOnReply": true,
    "exitOnLinkClick": true
  },
  "enrollmentOpen": true,
  "pauseReason": "string",
  "segmentId": "string",
  "segmentSnapshot": {
    "revision": 0,
    "evaluatedAt": 0,
    "matchedCount": 0
  },
  "frequencyCap": {
    "maxPer24Hours": 1,
    "maxPer7Days": 1
  }
}
```

## Send project campaign test

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/test-send` (Messaging API)

**Required scopes (all):** `campaigns:manage` · `campaigns:read`

Requires campaigns:manage and campaigns:read because the test can use stored recipient samples. Sends one copy of a draft campaign's content to a seed recipient, through the same rendering, sending, and BanSafe checks as a launched campaign. The seed recipient must be a number connected to your team. A test is not a campaign recipient and is not counted in the campaign's statistics or webhooks. A team can send 20 tests an hour, and at most 5 an hour to one seed recipient.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Body

- `sessionId` (string (uuid), required, format uuid). The number to send the test from. It must be connected, on a plan that includes Campaigns, and, when the campaign selects numbers, one of them.
- `to` (string, required, length 1–32). The seed recipient in international format. It must be the phone of a number connected to your team.
- `sampleRecipientId` (string (uuid), format uuid). A recipient of this campaign whose variables fill the content. Without it and without `variables`, the campaign's first recipient, or its audience's first member, is the sample.
- `variables` (object, max properties 50). Variable values for the test, at most 50. They override the sample recipient's values; without `sampleRecipientId`, only these values are used.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/test-send" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "sessionId": "00000000-0000-4000-8000-000000000000",
  "to": "+5511999990000"
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). The test send's ID.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `status` (string, required). Current status of this resource or operation. Values: `sent`.
  - `from` (object, required). The number the test was sent from.
    - `sessionId` (string (uuid), required, format uuid). Identifier of the connected Polymorfa session.
    - `phone` (string, required). Phone number in international format.
  - `to` (string, required). The seed recipient, in E.164 format.
  - `messageId` (string, required, nullable). The WhatsApp message ID, when the send path returned one.
  - `variables` (object, required). The variable values the content was rendered with.
  - `createdAt` (number, required). When the test was admitted, in epoch milliseconds.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "status": "sent",
    "from": {
      "sessionId": "00000000-0000-4000-8000-000000000000",
      "phone": "string"
    },
    "to": "string",
    "messageId": "string",
    "variables": {},
    "createdAt": 0
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 402

`campaigns_not_entitled`: the sending number's plan does not include Campaigns.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "billing_error",
    "code": "campaigns_not_entitled",
    "message": "This number’s plan does not include Campaigns.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaigns-not-entitled"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: The campaign is not a draft or has A/B or weighted content alternatives, the sending number is a Hybrid Link number, or the seed recipient opted out. `bansafe_cold_held`: the seed recipient has never written to the sending number and the campaign holds first messages. The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

`campaign_variables_missing`: the selected sample and explicit values cannot fill a variable in the content. The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "campaign_variables_missing",
    "message": "A recipient has no value and no fallback for a variable in the campaign content.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaign-variables-missing"
}
```

#### 429

The team or seed recipient reached its test-send limit (`rate_limit_exceeded`), or BanSafe is pacing the sending number. Follow `Retry-After`.
Same fields as 400.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before retrying.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "The request limit was reached. Follow Retry-After when supplied.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 502

`upstream_failure`: the send path reported that the test could not be sent.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "upstream_error",
    "code": "upstream_failure",
    "message": "The messaging provider could not complete the request.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
```

#### 503

The test was not sent: the sending number is not connected (`session_not_ready`), test sends or the send path are unavailable (`service_unavailable`, `command_dispatch_failed`), or the sending number's allowance could not be checked (`bansafe_accounting_unavailable`). Retry later. For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

#### 504

`result_unknown`: the outcome was not received in time. The test may still arrive.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "result_unknown",
    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
}
```

## Create project campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Creates a draft campaign on any plan. `senderConfig.sessionIds` may name numbers that are not yet on a plan that includes Campaigns; launch checks the selection. It is refused with `403 bansafe_team_suspended` while the team is suspended and `400` when `senderConfig.sessionIds` is malformed or a per-number cap is above its safety ceiling.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Body

- `name` (string, required, min length 1). Human-readable name for this resource.
- `templateId` (string (uuid), format uuid). Template in this project to send instead of composed messages. On Cloud API numbers it must be approved by WhatsApp on every number the campaign can send from before launch.
- `variableMapping` (object, max properties 50). Specifies variable mapping for this native create campaign request.
- `variants` (array of object, nullable, items 2–4). Two to four messages to test. Requires `variantStrategy` and cannot be combined with `templateId`. A/B tests are a beta; a team that is not enrolled gets `403 feature_unavailable`. Omit, or send null with a null `variantStrategy`, for a broadcast.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
  - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
  - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
    - `version` (integer, required). Specifies version for this native campaign variant message.
    - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
- `variantStrategy` (object, nullable). Specifies variant strategy for this native create campaign request.
  - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
  - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
  - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
  - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
  - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
- `messageVariations` (array of object, nullable, items 2–5). Two to five message alternatives for linked-device numbers. Each recipient receives one, chosen by weight, and keeps it across retries. Cannot be combined with composed messages, a template or an A/B test. A beta; a team that is not enrolled gets `403 feature_unavailable`.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
  - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
    - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
    - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
- `recipientListId` (string). Identifier for the recipient list.
- `senderConfig` (object). Structured sender config values for this native create campaign request.
- `scheduledAt` (number). Unix timestamp in milliseconds when this operation is scheduled to start.
- `sendWindow` (object, nullable). Specifies send window for this native create campaign request.
  - `timeZone` (string, length 1–64). IANA time zone the window is written in, such as `America/Sao_Paulo`. When omitted, the team's time zone is stored, or `UTC` when the team has none.
  - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
  - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
    - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
    - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `recipientTimeZone` (boolean). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`. Default: `false`.
  - `timeZoneVariable` (string, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true. Default: `"timeZone"`.
- `drip` (object, nullable). Specifies drip for this native create campaign request.
  - `enrollment` (string). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
  - `exitOnReply` (boolean). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
  - `exitOnLinkClick` (boolean). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
- `trackedLinks` (array of object, nullable, max items 5). Beta. Links to track, at most 5. Each message reference `{{link:<key>}}` is replaced with a short link per recipient that redirects to `url`. Only campaigns sent from linked-device numbers track links. Setting links requires the campaign link tracking beta (`403 feature_unavailable` otherwise); `null` or `[]` removes them.
  - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
  - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
- `frequencyCap` (object, nullable). Specifies frequency cap for this native create campaign request.
  - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
  - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
- `followUp` (object, nullable). One optional follow-up. A beta; a team that is not enrolled gets `403 feature_unavailable`. Requires a single first message: a campaign with a composed message sequence cannot launch with a follow-up. Follow-up text cannot contain tracked links.
  - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
  - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
  - `message` (object, required). Human-readable message associated with this result.
    - One of:
      - `text` (object).
        - `type` (string, required). Type discriminator for this object. Values: `text`.
        - `text` (string, required, length 1–16384). Text content carried by this object.
      - `template` (object).
        - `type` (string, required). Type discriminator for this object. Values: `template`.
        - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
- `recipients` (array of object, max items 1000). Recipients to add inline, at most 1,000. Every entry must be valid or the campaign is not created; a repeated phone is kept once. Combine with `recipientListId` to add an audience at launch; add more with the add-recipients endpoint while the campaign is a draft.
  - `phone` (string, required, length 1–64). Phone number in international format, for example `+14155550100`. Spaces, dots, hyphens and parentheses are ignored; a leading `00` is read as `+`.
  - `variables` (object). Template variables for this recipient. At most 50; names use letters, digits, `_`, `.` or `-`; values are stored as strings of at most 1,024 characters.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "idempotency_in_progress",
    "message": "A request with this Idempotency-Key is still in progress. Check again after Retry-After with the same key within the documented receipt window. Exact response data may be unavailable.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-in-progress"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request. Use a new key for a different request.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "idempotency_replay_unavailable",
    "message": "The exact response for this Idempotency-Key is unavailable. The request was not repeated. Keep the first response and reconcile events or the resource. Waiting does not guarantee replay data becomes available; do not switch keys to resend.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-replay-unavailable"
}
```

## Create project campaign reply flow

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaign-reply-flows` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Creates an immutable reply flow revision: the steps a campaign runs when a recipient replies. Each step can send a text, reply buttons, a list, or a Flow form, and branches on the button or list row chosen, an exact keyword, or a Flow form submission. Beta.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.

### Body

- `name` (string, required, length 1–128). Human-readable name for this resource.
- `flowKey` (string (uuid), format uuid). Existing flow key to add a revision to. Omit to start a new reply flow.
- `revision` (integer, range 1–1000000). Revision number. Defaults to 1; each key and revision can be created once.
- `definition` (object, required). Structured definition for this resource.
  - `entryNodeId` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for the entry node.
  - `nodes` (array of object, required, items 2–12). Nodes associated with this native campaign reply flow definition.
    - `id` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for this resource.
    - `send` (object). Specifies send for this native campaign reply flow node.
      - One of:
        - `text` (object).
          - `kind` (string, required). Kind discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–4096). Text content carried by this object.
        - `buttons` (object).
          - `kind` (string, required). Kind discriminator for this object. Values: `buttons`.
          - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
          - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
          - `buttons` (array of object, required, items 1–3). Interactive buttons displayed with the message.
        - `list` (object).
          - `kind` (string, required). Kind discriminator for this object. Values: `list`.
          - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
          - `buttonText` (string, required, length 1–20). Text displayed on the action button.
          - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
          - `rows` (array of object, required, items 1–10). Rows associated with this one of.
        - `flow_form` (object). A published WhatsApp Flow form. Official numbers only.
          - `kind` (string, required). Kind discriminator for this object. Values: `flow_form`.
          - `flowId` (string (uuid), required, format uuid). Identifier for the flow.
          - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
          - `buttonText` (string, required, length 1–20). Text displayed on the action button.
          - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
          - `screen` (string, required, pattern ^[A-Za-z0-9_]{1,64}$). Flow screen opened when the recipient activates the message.
    - `edges` (array of object, required, max items 3). Edges associated with this native campaign reply flow node.
      - `match` (object, required). Specifies match for this edge.
        - One of:
          - `choice` (object).
          - `keyword` (object).
          - `flow_submission` (object).
      - `to` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Specifies to for this edge.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaign-reply-flows" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "definition": {
    "entryNodeId": "string",
    "nodes": [
      {
        "id": "string",
        "edges": [
          {
            "match": null,
            "to": "string"
          }
        ]
      }
    ]
  }
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `flowKey` (string (uuid), required, format uuid). Groups the revisions of one reply flow.
  - `revision` (integer, required). Specifies revision for this native campaign reply flow.
  - `name` (string, required). Human-readable name for this resource.
  - `definition` (object, required). Structured definition for this resource.
    - `entryNodeId` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for the entry node.
    - `nodes` (array of object, required, items 2–12). Nodes associated with this native campaign reply flow definition.
      - `id` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for this resource.
      - `send` (object). Specifies send for this native campaign reply flow node.
        - One of:
          - `text` (object).
            - `kind` (string, required). Kind discriminator for this object. Values: `text`.
            - `text` (string, required, length 1–4096). Text content carried by this object.
          - `buttons` (object).
            - `kind` (string, required). Kind discriminator for this object. Values: `buttons`.
            - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
            - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
            - `buttons` (array of object, required, items 1–3). Interactive buttons displayed with the message.
          - `list` (object).
            - `kind` (string, required). Kind discriminator for this object. Values: `list`.
            - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
            - `buttonText` (string, required, length 1–20). Text displayed on the action button.
            - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
            - `rows` (array of object, required, items 1–10). Rows associated with this one of.
          - `flow_form` (object). A published WhatsApp Flow form. Official numbers only.
            - `kind` (string, required). Kind discriminator for this object. Values: `flow_form`.
            - `flowId` (string (uuid), required, format uuid). Identifier for the flow.
            - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
            - `buttonText` (string, required, length 1–20). Text displayed on the action button.
            - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
            - `screen` (string, required, pattern ^[A-Za-z0-9_]{1,64}$). Flow screen opened when the recipient activates the message.
      - `edges` (array of object, required, max items 3). Edges associated with this native campaign reply flow node.
        - `match` (one of, required). Specifies match for this edge.
        - `to` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Specifies to for this edge.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "flowKey": "00000000-0000-4000-8000-000000000000",
    "revision": 0,
    "name": "string",
    "definition": {
      "entryNodeId": "string",
      "nodes": [
        {
          "id": "string",
          "edges": [
            {
              "match": null,
              "to": null
            }
          ]
        }
      ]
    },
    "createdAt": 0
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

`missing_scope`, or `feature_unavailable` when campaign reply flows are not enabled for the team.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "missing_scope",
    "message": "The credential lacks a required API scope.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#missing-scope"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: this flow key and revision already exist.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Create campaign

`POST https://api.polymorfa.com/platform/campaigns` (Platform API)

Required permission: `campaigns:manage`

Creates a draft campaign on any plan. `messagesArray` holds up to 10 composed messages, with each `delayAfterSec` from 0 to 86400, or 2592000 for a drip. `drip` requires the default-off drip sequences beta (`403 feature_unavailable`). Only an unlaunched draft can change drip settings, except a running or paused continuous drip can close enrollment by setting enrollment to audience with the same exit settings. `senderConfig.sessionIds` may name numbers that are not yet on a plan that includes Campaigns; launch checks the selection. `templateId` must name a template in the campaign's project, and a malformed `variableMapping` answers `400 invalid_parameter` naming the field. It is refused with `403 bansafe_team_suspended` while the team is suspended, `400 invalid_parameter` when `senderConfig.sessionIds` is malformed, and `400 campaign_throughput_capped` when a per-number cap is above its safety ceiling. Setting `trackedLinks` requires the campaign link tracking beta and otherwise answers `403 feature_unavailable`. `variants` and `variantStrategy` make an A/B test, a beta: without enrollment it answers `403 feature_unavailable`, and a template with variants answers `400 invalid_parameter`.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Body

- `name` (string, required, length 1–200). Campaign name, trimmed before validation. Must not be blank.
- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.
- `templateId` (string (uuid), format uuid). Template in the campaign's project to send instead of composed messages. On Cloud API numbers it must be approved by WhatsApp before launch.
- `variableMapping` (object, max properties 50). Specifies variable mapping for this management create platform campaign request.
- `recipientListId` (string (uuid), format uuid). Audience in the same team whose members are copied when the campaign launches.
- `segmentId` (string (uuid), format uuid). Beta. Saved audience segment evaluated once when the campaign launches; the matching profiles become its recipients. Cannot be combined with `recipientListId`. Requires a team API key or the dashboard and the audience segments beta.
- `senderConfig` (object). Structured sender config values for this management create platform campaign request.
- `scheduledAt` (number). Scheduled start time in Unix milliseconds.
- `sendWindow` (object, nullable). Specifies send window for this management create platform campaign request.
  - `timeZone` (string, length 1–64). IANA time zone the window is written in, such as `America/Sao_Paulo`. When omitted, the team's time zone is stored, or `UTC` when the team has none.
  - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
  - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
    - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
    - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `recipientTimeZone` (boolean). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`. Default: `false`.
  - `timeZoneVariable` (string, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true. Launch rejects more than 5,000 distinct nonempty values with `400 invalid_parameter`. Default: `"timeZone"`.
- `trackedLinks` (array of object, nullable, max items 5). Beta. Links to track, at most 5. Each message reference `{{link:<key>}}` is replaced with a short link per recipient that redirects to `url`. Only campaigns sent from linked-device numbers track links. `null` or `[]` stores none.
  - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
  - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
- `drip` (object, nullable). Beta access is required. Defaults to audience enrollment, exit on reply true and exit on link open false. Null creates an ordinary campaign.
  - `enrollment` (string). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
  - `exitOnReply` (boolean). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
  - `exitOnLinkClick` (boolean). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
- `frequencyCap` (object, nullable). Beta. This campaign's own contact frequency cap, counted over every campaign message the team sent to the phone number. Each limit applies together with the team cap and the lower one wins, so a campaign cap can only make sending stricter. A message over a limit is skipped with `frequency_cap_exceeded`; later sequence messages stop for that recipient. `null` uses the team cap alone. Setting a cap requires the contact frequency caps beta and otherwise answers `403 feature_unavailable`.
  - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
  - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.
- `followUp` (object, nullable). Specifies follow up for this management create platform campaign request.
  - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
  - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
  - `message` (object, required). Human-readable message associated with this result.
    - One of:
      - `text` (object).
        - `type` (string, required). Type discriminator for this object. Values: `text`.
        - `text` (string, required, length 1–16384). Text content carried by this object.
      - `template` (object).
        - `type` (string, required). Type discriminator for this object. Values: `template`.
        - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
- `recipients` (array of object, items 0–1000). At most 1,000 recipients per request.
  - `phone` (string, required, length 1–64). Number in international format, for example `+14155550100`. Spaces, dots, hyphens and parentheses are ignored; a leading `00` is read as `+`; digits without `+` are read as including the country code.
  - `variables` (object, max properties 50). Template variables. Names use letters, digits, `_`, `.` or `-` (at most 64 characters). Values are stored as strings.
- `recipientCount` (number). Ignored when inline recipients are provided; their stored count is authoritative.
- `composerBlueprint` (any). Specifies composer blueprint for this management create platform campaign request.
- `messagesArray` (array of object, max items 10). The messages each recipient receives, in order, when the campaign has no `templateId`. With a template, the template is the only message. A message with no text, media, link or call button, footer or Flow form is not sent.
  - `version` (integer). Specifies version for this management campaign message. Values: `2`.
  - `source` (string). Message text. `{{name}}` inserts a recipient variable and `{{name | fallback}}` uses the fallback when the variable is missing or empty. WhatsApp formatting such as `*bold*` is kept.
  - `media` (object). Reference to the media attached to this message.
    - `kind` (string, required). Kind discriminator for this object. Values: `image`, `video`, `audio`, `document`.
    - `url` (string (uri), required, format uri). Public https URL the sending number downloads the file from. Launch is refused with `400 invalid_parameter` when an attachment has no URL.
    - `filename` (string). Filename presented for the media attachment.
    - `caption` (string). Used as the caption when `source` is empty.
  - `buttons` (array of object). On WhatsApp numbers, link and call buttons are sent as text lines and quick replies are left out.
    - `kind` (string, required). Kind discriminator for this object. Values: `reply`, `link`, `call`.
    - `label` (string, required). Specifies label for this button.
    - `url` (string). URL associated with this resource.
    - `phone` (string). Phone number in international format.
  - `footer` (string). Supplementary footer text shown below the primary content.
  - `delayUnit` (string). Display unit. delayAfterSec must be a whole multiple of this unit. Values: `minutes`, `hours`, `days`.
  - `sendWindow` (object, nullable). Drip steps after the first only. Replaces the campaign weekdays and hours for this step, retaining its time zone settings. Without a campaign window, uses the team time zone saved when the drip was configured.
    - `days` (array of string, required, min items 1, unique items). Days associated with this send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Hours associated with this send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `delayAfterSec` (integer, range 0–2592000). A drip allows up to 30 days; other campaigns allow up to 86400 seconds. Minimum seconds between the previous message being accepted by WhatsApp and this message being sent. Ignored on the first message. Pacing, caps and a paused campaign can make the wait longer.
- `audienceRef` (any). Specifies audience ref for this management create platform campaign request.
- `complianceConfig` (any). Specifies compliance config for this management create platform campaign request.
- `variants` (array of object, items 2–4). Two to four messages to test. Requires `variantStrategy` and cannot be combined with `templateId`. A/B tests are a beta; a team that is not enrolled gets `403 feature_unavailable`.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
  - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
  - `blueprint` (object, required). The message this variant sends, in the composed-message format.
    - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
    - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
- `variantStrategy` (object). Specifies variant strategy for this management create platform campaign request.
  - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
  - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
  - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
  - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
  - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
- `messageVariations` (array of object, items 2–5). Two to five message alternatives for linked-device numbers. Each recipient receives one, chosen by weight, and keeps it across retries. Cannot be combined with composed messages, a template or an A/B test. A beta; a team that is not enrolled gets `403 feature_unavailable`.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
  - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
  - `blueprint` (object, required). Structured blueprint values for this management campaign message variation.
    - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
    - `source` (string, required, length 1–4096). Specifies source for this blueprint.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string (uuid), required, nullable, format uuid). Identifier of the message template.
  - `recipientListId` (string (uuid), required, nullable, format uuid). Identifier for the recipient list.
  - `recipientCount` (integer, required, min 0). Number of recipients.
  - `sentCount` (integer, required, min 0). Number of sents.
  - `deliveredCount` (integer, required, min 0). Number of delivereds.
  - `readCount` (integer, required, min 0). Number of reads.
  - `failedCount` (integer, required, min 0). Number of faileds.
  - `skippedCount` (integer, required, min 0). Number of skippeds.
  - `scheduledAt` (integer, required, nullable). Scheduled start in Unix milliseconds.
  - `launchedAt` (integer, required, nullable). Launch time in Unix milliseconds.
  - `completedAt` (integer, required, nullable). Completion time in Unix milliseconds.
  - `createdAt` (integer, required). Creation time in Unix milliseconds.
  - `updatedAt` (integer, required). Last update in Unix milliseconds.
  - `sendWindow` (object, required, nullable). Specifies send window for this management platform campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required). Days associated with this management campaign send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required). Hours associated with this management campaign send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Whether recipient time zone.
    - `timeZoneVariable` (string, required). Specifies time zone variable for this management campaign send window.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
  - `variableMapping` (object, nullable, max properties 50). How each content variable is filled; null when the campaign has no mapping.
  - `drip` (object, required, nullable). Specifies drip for this management platform campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `followUp` (object, required, nullable). Specifies follow up for this management platform campaign.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `composerBlueprint` (any). Specifies composer blueprint for this management platform campaign.
  - `messages` (any). Specifies messages for this management platform campaign.
  - `audienceRef` (any). Specifies audience ref for this management platform campaign.
  - `senderConfig` (any). Specifies sender config for this management platform campaign.
  - `complianceConfig` (any). Specifies compliance config for this management platform campaign.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). The message this variant sends, in the composed-message format.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). How the A/B test runs; null for a broadcast.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
  - `experimentOutcome` (object, required, nullable). The saved A/B result, or null before a decision and for a broadcast.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `messageVariations` (array of object, nullable, items 2–5). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
    - `blueprint` (object, required). Structured blueprint values for this message variation.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). Specifies source for this blueprint.
  - `segmentId` (string (uuid), nullable, format uuid). Saved audience segment the campaign evaluates at launch, or null.
  - `segmentSnapshot` (object, nullable). What launch froze from the segment: its revision, the evaluation time in Unix milliseconds and the matching profile count. Null before a segment launch.
    - `revision` (integer, required, min 1). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required, min 0). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required, min 0). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). This campaign's own contact frequency cap; null when only the team cap applies.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "name": "string",
    "status": "string",
    "templateId": "00000000-0000-4000-8000-000000000000",
    "recipientListId": "00000000-0000-4000-8000-000000000000",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "sendWindow": {
      "timeZone": "string",
      "days": [
        "monday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "string"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": false
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "experimentOutcome": {
      "state": "promoted"
    },
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## Create campaign reply flow

`POST https://api.polymorfa.com/platform/campaign-reply-flows` (Platform API)

Required permission: `campaigns:manage`

Creates an immutable reply flow revision: the steps a campaign runs when a recipient replies. Each step can send a text, reply buttons, a list, or a Flow form (Official numbers only), and branches on the button or list row chosen, an exact keyword, or a Flow form submission. Beta: returns `403` unless campaign reply flows are enabled for the team. `409` means this flow key and revision already exist.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Body

- `name` (string, required, length 1–128). Human-readable name for this resource.
- `flowKey` (string (uuid), format uuid). Existing flow key to add a revision to. Omit to start a new reply flow.
- `revision` (integer, range 1–1000000). Defaults to 1; each key and revision can be created once.
- `definition` (object, required). Structured definition for this resource.
  - `entryNodeId` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for the entry node.
  - `nodes` (array of object, required, items 2–12). Nodes associated with this management platform campaign reply flow definition.
    - `id` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for this resource.
    - `send` (object). `text` (`text`), `buttons` (`body`, up to 3 `buttons` with `id` and `text`), `list` (`body`, `buttonText`, up to 10 `rows`), or `flow_form` (`flowId`, `body`, `buttonText`, `screen`; Official numbers only).
      - `kind` (string, required). Kind discriminator for this object. Values: `text`, `buttons`, `list`, `flow_form`.
    - `edges` (array of object, required, max items 3). Edges associated with this node.
      - `match` (object, required). `choice` (`replyKind` `button` or `list`, `id`), `keyword` (`value`), or `flow_submission`.
        - `kind` (string, required). Kind discriminator for this object. Values: `choice`, `keyword`, `flow_submission`.
      - `to` (string, required). Specifies to for this edge.
- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaign-reply-flows" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "definition": {
    "entryNodeId": "string",
    "nodes": [
      {
        "id": "string",
        "edges": [
          {
            "match": {
              "kind": "choice"
            },
            "to": "string"
          }
        ]
      }
    ]
  }
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `flowKey` (string (uuid), required, format uuid). Groups the revisions of one reply flow.
  - `revision` (integer, required). Specifies revision for this management platform campaign reply flow.
  - `name` (string, required). Human-readable name for this resource.
  - `definition` (object, required). Structured definition for this resource.
    - `entryNodeId` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for the entry node.
    - `nodes` (array of object, required, items 2–12). Nodes associated with this management platform campaign reply flow definition.
      - `id` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for this resource.
      - `send` (object). `text` (`text`), `buttons` (`body`, up to 3 `buttons` with `id` and `text`), `list` (`body`, `buttonText`, up to 10 `rows`), or `flow_form` (`flowId`, `body`, `buttonText`, `screen`; Official numbers only).
        - `kind` (string, required). Kind discriminator for this object. Values: `text`, `buttons`, `list`, `flow_form`.
      - `edges` (array of object, required, max items 3). Edges associated with this node.
        - `match` (object, required). `choice` (`replyKind` `button` or `list`, `id`), `keyword` (`value`), or `flow_submission`.
        - `to` (string, required). Specifies to for this edge.
  - `createdAt` (integer, required). Unix milliseconds.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "flowKey": "00000000-0000-4000-8000-000000000000",
    "revision": 0,
    "name": "string",
    "definition": {
      "entryNodeId": "string",
      "nodes": [
        {
          "id": "string",
          "edges": [
            {
              "match": null,
              "to": null
            }
          ]
        }
      ]
    },
    "createdAt": 0
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

## List project campaigns

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (array of object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": [
    {
      "id": "string",
      "name": "string",
      "status": "string",
      "templateId": "string",
      "recipientListId": "string",
      "recipientCount": 0,
      "sentCount": 0,
      "deliveredCount": 0,
      "readCount": 0,
      "failedCount": 0,
      "skippedCount": 0,
      "scheduledAt": 0,
      "launchedAt": 0,
      "completedAt": 0,
      "createdAt": 0,
      "updatedAt": 0,
      "experimentOutcome": {
        "state": "promoted"
      },
      "followUp": {
        "message": {
          "type": "text",
          "text": "string"
        }
      },
      "sendWindow": {
        "timeZone": "America/Sao_Paulo",
        "days": [
          "monday",
          "tuesday",
          "wednesday",
          "thursday",
          "friday"
        ],
        "hours": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ],
        "recipientTimeZone": true,
        "timeZoneVariable": "timeZone"
      },
      "trackedLinks": [
        {
          "key": "offer",
          "url": "https://example.com/spring-sale"
        }
      ],
      "drip": {
        "enrollment": "audience",
        "exitOnReply": true,
        "exitOnLinkClick": true
      },
      "enrollmentOpen": true,
      "pauseReason": "string",
      "frequencyCap": {
        "maxPer24Hours": 1,
        "maxPer7Days": 1
      }
    }
  ]
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## List project campaign recipients

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/recipients` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

Lists a campaign's recipients in queue order with cursor pagination. Filter by `status`, by `reason`, or both: for example `status=skipped&reason=opted_out` lists recipients skipped because they opted out. `failureReason` gives the stable reason a recipient was not sent.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Query parameters

- `status` (string). Current status of this resource or operation. Values: `queued`, `sending`, `sent`, `delivered`, `read`, `failed`, `skipped`.
- `reason` (string). Reason for the reported state or outcome. Values: `opted_out`, `cold_held`, `campaign_cancelled`, `invalid_recipient`, `session_not_connected`, `ack_timeout`, `blocked_by_safety`, `send_failed`, `missing_variable`, `frequency_cap`, `other`.
- `cursor` (string, max length 256). Specifies cursor for this query parameter.
- `limit` (integer, range 1–100). Specifies limit for this query parameter.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/recipients" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (array of object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `phone` (string, required). Phone number in international format.
  - `variables` (object, required). Structured variables values for this native campaign recipient.
  - `variantKey` (string, required, nullable). Specifies variant key for this native campaign recipient.
  - `status` (string, required). Current status of this resource or operation. Values: `queued`, `sending`, `sent`, `delivered`, `read`, `failed`, `skipped`.
  - `attempts` (integer, required). Specifies attempts for this native campaign recipient.
  - `lastError` (string, required, nullable). Legacy alias of the normalized `failureReason` code. Raw stored errors are never returned.
  - `failureReason` (string, required, nullable). Why the recipient was not sent, or why its last attempt did not succeed. Null when nothing went wrong. `opted_out`: the number is on the team's opt-out list. `cold_held`: the number never wrote to the sending number and the campaign holds cold sends. `campaign_cancelled`: the campaign was stopped before this recipient was sent. `invalid_recipient`: the number is not a valid WhatsApp address. `session_not_connected`: the sending number was not connected. `ack_timeout`: WhatsApp did not acknowledge the send in time. `blocked_by_safety`: a safety check refused the send before it was attempted; the recipient waits for the campaign to resume. `send_failed`: WhatsApp refused the send, or its outcome could not be confirmed. `missing_variable`: the campaign was launched with `skipMissingVariables` and the recipient had no value and no fallback for a variable. `frequency_cap`: the recipient reached the team's or campaign's rolling contact frequency cap. `other`: any other reason. New codes may be added. Values: `opted_out`, `cold_held`, `campaign_cancelled`, `invalid_recipient`, `session_not_connected`, `ack_timeout`, `blocked_by_safety`, `send_failed`, `missing_variable`, `frequency_cap`, `other`.
  - `externalMessageId` (string, required, nullable). Identifier for the external message.
  - `queuedAt` (number, required). Timestamp for queued at.
  - `sentAt` (number, required, nullable). Timestamp for sent at.
  - `deliveredAt` (number, required, nullable). Timestamp for delivered at.
  - `readAt` (number, required, nullable). Timestamp for read at.
  - `failedAt` (number, required, nullable). Timestamp for failed at.
  - `respondedAt` (number, required, nullable). Timestamp for responded at.
  - `messagesSent` (integer, required, min 0). Messages of the campaign's message sequence this recipient has been sent. `status`, `sentAt`, `deliveredAt` and `readAt` describe the first message.
  - `nextMessageAt` (number, required, nullable). Earliest time the next message is sent, in Unix milliseconds. Null when no message is waiting.
  - `sequenceError` (string, required, nullable). Why the remaining messages will not be sent: `opted_out`, `campaign_cancelled`, `sender_unavailable`, or the failure class of the message that failed, such as `conversation_window_closed`. Null otherwise.
  - `followUp` (object, required, nullable). Structured follow up values for this native campaign recipient.
    - `id` (string (uuid), required, format uuid). Identifier for this resource.
    - `numberId` (string (uuid), required, format uuid). Identifier for the number.
    - `status` (string, required). Current status of this resource or operation. Values: `waiting_receipt`, `scheduled`, `sending`, `sent`, `cancelled`, `expired`, `failed`, `outcome_unknown`.
    - `anchorKind` (string, required, nullable). Category assigned to anchor. Values: `delivered`, `read`.
    - `firstDeliveredAt` (number, required, nullable). Timestamp for first delivered at.
    - `firstReadAt` (number, required, nullable). Timestamp for first read at.
    - `dueAt` (number, required, nullable). Timestamp for due at.
    - `expiresAt` (number, required). Unix timestamp in milliseconds when this resource expires.
    - `sentAt` (number, required, nullable). Timestamp for sent at.
    - `deliveredAt` (number, required, nullable). Timestamp for delivered at.
    - `readAt` (number, required, nullable). Timestamp for read at.
    - `repliedAt` (number, required, nullable). Timestamp for replied at.
    - `reason` (string, required, nullable). Reason for the reported state or outcome.
    - `commandId` (string (uuid), required, nullable, format uuid). Identifier for the command.
- `page` (object, required). Specifies page for this native list campaign recipients response.
  - `nextCursor` (string, required, nullable). Specifies next cursor for this native campaign recipient page info.
  - `hasMore` (boolean, required). Whether more.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": [
    {
      "id": "string",
      "phone": "string",
      "variables": {},
      "variantKey": "string",
      "status": "queued",
      "attempts": 0,
      "lastError": "string",
      "failureReason": "opted_out",
      "externalMessageId": "string",
      "queuedAt": 0,
      "sentAt": 0,
      "deliveredAt": 0,
      "readAt": 0,
      "failedAt": 0,
      "respondedAt": 0,
      "messagesSent": 0,
      "nextMessageAt": 0,
      "sequenceError": "string",
      "followUp": {
        "id": "00000000-0000-4000-8000-000000000000",
        "numberId": "00000000-0000-4000-8000-000000000000",
        "status": "waiting_receipt",
        "anchorKind": "delivered",
        "firstDeliveredAt": 0,
        "firstReadAt": 0,
        "dueAt": 0,
        "expiresAt": 0,
        "sentAt": 0,
        "deliveredAt": 0,
        "readAt": 0,
        "repliedAt": 0,
        "reason": "string",
        "commandId": "00000000-0000-4000-8000-000000000000"
      }
    }
  ],
  "page": {
    "nextCursor": "string",
    "hasMore": true
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## List campaigns

`GET https://api.polymorfa.com/platform/campaigns` (Platform API)

Required permission: `campaigns:read`

Lists campaigns in the selected project, including each campaign's stored send window and delivery counts.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Query parameters

- `projectId` (string, required). Identifier of the Polymorfa project that owns this resource.
- `projectSlug` (string). Specifies project slug for this query parameter.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns?projectId=<projectId>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (array of object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string (uuid), required, nullable, format uuid). Identifier of the message template.
  - `recipientListId` (string (uuid), required, nullable, format uuid). Identifier for the recipient list.
  - `recipientCount` (integer, required, min 0). Number of recipients.
  - `sentCount` (integer, required, min 0). Number of sents.
  - `deliveredCount` (integer, required, min 0). Number of delivereds.
  - `readCount` (integer, required, min 0). Number of reads.
  - `failedCount` (integer, required, min 0). Number of faileds.
  - `skippedCount` (integer, required, min 0). Number of skippeds.
  - `scheduledAt` (integer, required, nullable). Scheduled start in Unix milliseconds.
  - `launchedAt` (integer, required, nullable). Launch time in Unix milliseconds.
  - `completedAt` (integer, required, nullable). Completion time in Unix milliseconds.
  - `createdAt` (integer, required). Creation time in Unix milliseconds.
  - `updatedAt` (integer, required). Last update in Unix milliseconds.
  - `sendWindow` (object, required, nullable). Specifies send window for this management platform campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required). Days associated with this management campaign send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required). Hours associated with this management campaign send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Whether recipient time zone.
    - `timeZoneVariable` (string, required). Specifies time zone variable for this management campaign send window.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
  - `variableMapping` (object, nullable, max properties 50). How each content variable is filled; null when the campaign has no mapping.
  - `drip` (object, required, nullable). Specifies drip for this management platform campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `followUp` (object, required, nullable). Specifies follow up for this management platform campaign.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `composerBlueprint` (any). Specifies composer blueprint for this management platform campaign.
  - `messages` (any). Specifies messages for this management platform campaign.
  - `audienceRef` (any). Specifies audience ref for this management platform campaign.
  - `senderConfig` (any). Specifies sender config for this management platform campaign.
  - `complianceConfig` (any). Specifies compliance config for this management platform campaign.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). The message this variant sends, in the composed-message format.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). How the A/B test runs; null for a broadcast.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
  - `experimentOutcome` (object, required, nullable). The saved A/B result, or null before a decision and for a broadcast.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `messageVariations` (array of object, nullable, items 2–5). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
    - `blueprint` (object, required). Structured blueprint values for this message variation.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). Specifies source for this blueprint.
  - `segmentId` (string (uuid), nullable, format uuid). Saved audience segment the campaign evaluates at launch, or null.
  - `segmentSnapshot` (object, nullable). What launch froze from the segment: its revision, the evaluation time in Unix milliseconds and the matching profile count. Null before a segment launch.
    - `revision` (integer, required, min 1). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required, min 0). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required, min 0). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). This campaign's own contact frequency cap; null when only the team cap applies.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "status": "string",
      "templateId": "00000000-0000-4000-8000-000000000000",
      "recipientListId": "00000000-0000-4000-8000-000000000000",
      "recipientCount": 0,
      "sentCount": 0,
      "deliveredCount": 0,
      "readCount": 0,
      "failedCount": 0,
      "skippedCount": 0,
      "scheduledAt": 0,
      "launchedAt": 0,
      "completedAt": 0,
      "createdAt": 0,
      "updatedAt": 0,
      "sendWindow": {
        "timeZone": "string",
        "days": [
          "monday"
        ],
        "hours": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ],
        "recipientTimeZone": true,
        "timeZoneVariable": "string"
      },
      "trackedLinks": [
        {
          "key": "offer",
          "url": "https://example.com/spring-sale"
        }
      ],
      "drip": {
        "enrollment": "audience",
        "exitOnReply": true,
        "exitOnLinkClick": false
      },
      "enrollmentOpen": true,
      "pauseReason": "string",
      "followUp": {
        "message": {
          "type": "text",
          "text": "string"
        }
      },
      "experimentOutcome": {
        "state": "promoted"
      },
      "frequencyCap": {
        "maxPer24Hours": 1,
        "maxPer7Days": 1
      }
    }
  ]
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## List campaign events

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}/events` (Platform API)

Required permission: `campaigns:read`

Public Management API. Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>/events" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (any, required). Operation result.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": null
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

## List campaign recipients

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}/recipients` (Platform API)

Required permission: `campaigns:read`

Lists a campaign's recipients in queue order with cursor pagination. Filter by `status`, by `reason`, or both: for example `status=skipped&reason=opted_out` lists recipients skipped because the number opted out. `failureReason` gives the stable reason a recipient was not sent.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string (uuid), format uuid). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.
- `status` (string). Current status of this resource or operation. Values: `queued`, `sending`, `sent`, `delivered`, `read`, `failed`, `skipped`.
- `reason` (string). Only recipients whose `failureReason` is this code. Values: `opted_out`, `cold_held`, `campaign_cancelled`, `invalid_recipient`, `session_not_connected`, `ack_timeout`, `blocked_by_safety`, `send_failed`, `missing_variable`, `frequency_cap`, `other`.
- `cursor` (string, length 1–256). Specifies cursor for this query parameter.
- `limit` (integer, range 1–100). Specifies limit for this query parameter. Default: `25`.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>/recipients" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (array of object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `phone` (string, required). Phone number in international format.
  - `variables` (object, required). Structured variables values for this management campaign recipient.
  - `variantKey` (string, required, nullable). Specifies variant key for this management campaign recipient.
  - `status` (string, required). Current status of this resource or operation. Values: `queued`, `sending`, `sent`, `delivered`, `read`, `failed`, `skipped`.
  - `attempts` (integer, required, min 0). Specifies attempts for this management campaign recipient.
  - `lastError` (string, required, nullable). Legacy alias of the normalized `failureReason` code. Raw stored errors are never returned.
  - `failureReason` (string, required, nullable). Specifies failure reason for this management campaign recipient. Values: `opted_out`, `cold_held`, `campaign_cancelled`, `invalid_recipient`, `session_not_connected`, `ack_timeout`, `blocked_by_safety`, `send_failed`, `missing_variable`, `frequency_cap`, `other`.
  - `externalMessageId` (string, required, nullable). Identifier for the external message.
  - `queuedAt` (integer, required). Timestamp for queued at.
  - `sentAt` (integer, required, nullable). Timestamp for sent at.
  - `deliveredAt` (integer, required, nullable). Timestamp for delivered at.
  - `readAt` (integer, required, nullable). Timestamp for read at.
  - `failedAt` (integer, required, nullable). Timestamp for failed at.
  - `respondedAt` (integer, required, nullable). Timestamp for responded at.
  - `messagesSent` (integer, required, min 0). Messages of the campaign's message sequence this recipient has been sent. `status`, `sentAt`, `deliveredAt` and `readAt` describe the first message.
  - `nextMessageAt` (integer, required, nullable). Earliest time the next message is sent, in Unix milliseconds. Null when no message is waiting.
  - `sequenceError` (string, required, nullable). Why the remaining messages will not be sent: `opted_out`, `campaign_cancelled`, `sender_unavailable`, or the failure class of the message that failed, such as `conversation_window_closed`. Null otherwise.
  - `followUp` (object, required, nullable). Receipt-timed follow-up for this recipient; null when none was admitted.
    - `id` (string (uuid), required, format uuid). Identifier for this resource.
    - `numberId` (string (uuid), required, format uuid). Identifier for the number.
    - `status` (string, required). Current status of this resource or operation. Values: `waiting_receipt`, `scheduled`, `sending`, `sent`, `cancelled`, `expired`, `failed`, `outcome_unknown`.
    - `anchorKind` (string, required, nullable). Category assigned to anchor. Values: `delivered`, `read`.
    - `firstDeliveredAt` (number, required, nullable). Unix milliseconds.
    - `firstReadAt` (number, required, nullable). Unix milliseconds.
    - `dueAt` (number, required, nullable). Unix milliseconds.
    - `sentAt` (number, required, nullable). Unix milliseconds.
    - `deliveredAt` (number, required, nullable). Unix milliseconds.
    - `readAt` (number, required, nullable). Unix milliseconds.
    - `repliedAt` (number, required, nullable). Unix milliseconds.
    - `expiresAt` (number, required). Unix milliseconds.
    - `reason` (string, required, nullable). Reason for the reported state or outcome.
    - `commandId` (string (uuid), required, nullable, format uuid). Identifier for the command.
- `page` (object, required). Specifies page for this schema.
  - `nextCursor` (string, required, nullable). Specifies next cursor for this management cursor page metadata.
  - `hasMore` (boolean, required). Whether more.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "phone": "string",
      "variables": {},
      "variantKey": "string",
      "status": "queued",
      "attempts": 0,
      "lastError": "string",
      "failureReason": "opted_out",
      "externalMessageId": "string",
      "queuedAt": 0,
      "sentAt": 0,
      "deliveredAt": 0,
      "readAt": 0,
      "failedAt": 0,
      "respondedAt": 0,
      "messagesSent": 0,
      "nextMessageAt": 0,
      "sequenceError": "string",
      "followUp": {
        "id": "00000000-0000-4000-8000-000000000000",
        "numberId": "00000000-0000-4000-8000-000000000000",
        "status": "waiting_receipt",
        "anchorKind": "delivered",
        "firstDeliveredAt": 0,
        "firstReadAt": 0,
        "dueAt": 0,
        "sentAt": 0,
        "deliveredAt": 0,
        "readAt": 0,
        "repliedAt": 0,
        "expiresAt": 0,
        "reason": "string",
        "commandId": "00000000-0000-4000-8000-000000000000"
      }
    }
  ],
  "page": {
    "nextCursor": "string",
    "hasMore": true
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## List campaign launch approvals

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}/approvals` (Platform API)

Required permission: `campaigns:read`

Lists a campaign's approval requests, newest first, at most 20. A request is created when a launch is held by the team's approval threshold, or when an AI agent asks through the hosted MCP server to launch, resume or move the start (`reasons` says which). `action` is the requested step. It records the frozen recipient count and the requested start time. `status` is `pending` until a team owner or admin approves or rejects it, `superseded` when a later launch request or a change to the campaign replaced it, and `expired` 72 hours after it was requested.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>/approvals" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (array of object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `action` (string, required). The held command. Approving it runs that command. Values: `launch`, `resume`, `reschedule`.
  - `status` (string, required). Current status of this resource or operation. Values: `pending`, `approved`, `rejected`, `superseded`, `expired`.
  - `reasons` (array of string, required). Why the command was held. `audience_threshold`: a launch would send to more recipients than the team's threshold. `agent_request`: an AI agent asked through the hosted MCP server. Values: `audience_threshold`, `agent_request`.
  - `recipientCount` (integer, required, min 0). Recipients the command would send to: the frozen audience after opt-outs for a launch, the queued recipients for a resume or new start time.
  - `scheduledAt` (integer, required, nullable, format int64). Requested start in Unix milliseconds; null starts when approved. Null for a resume.
  - `requestedBy` (object, required). Structured requested by values for this management campaign launch approval.
    - `type` (string, required). Type discriminator for this object.
    - `id` (string, required). Identifier for this resource.
  - `requestedAt` (integer, required, format int64). Timestamp for requested at.
  - `expiresAt` (integer, required, format int64). Unix timestamp in milliseconds when this resource expires.
  - `decidedBy` (string, required, nullable). The owner or admin who approved or rejected it.
  - `decidedAt` (integer, required, nullable, format int64). Timestamp for decided at.
  - `operationId` (string (uuid), required, nullable, format uuid). The launch operation an approval started.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "campaignId": "00000000-0000-4000-8000-000000000000",
      "action": "launch",
      "status": "pending",
      "reasons": [
        "audience_threshold"
      ],
      "recipientCount": 0,
      "scheduledAt": 0,
      "requestedBy": {
        "type": "string",
        "id": "string"
      },
      "requestedAt": 0,
      "expiresAt": 0,
      "decidedBy": "string",
      "decidedAt": 0,
      "operationId": "00000000-0000-4000-8000-000000000000"
    }
  ]
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## Get project campaign

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Get project campaign analytics

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/analytics` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/analytics" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string, required). Identifier for the campaign.
  - `recipientCount` (integer, required). Number of recipients.
  - `sentCount` (integer, required). Number of sents.
  - `deliveredCount` (integer, required). Number of delivereds.
  - `readCount` (integer, required). Number of reads.
  - `failedCount` (integer, required). Number of faileds.
  - `skippedCount` (integer, required). Number of skippeds.
  - `respondedCount` (integer, required). Number of respondeds.
  - `responseRate` (number, required). `respondedCount` divided by `sentCount`; 0 before the first send.
  - `averageResponseTimeMs` (number, required, nullable). Mean time from send to first reply in milliseconds; null before the first reply.
  - `minResponseTimeMs` (number, required, nullable). Specifies min response time ms for this native campaign analytic.
  - `maxResponseTimeMs` (number, required, nullable). Specifies max response time ms for this native campaign analytic.
  - `experiment` (object, required, nullable). Specifies experiment for this native campaign analytic.
    - `criterion` (string, required). Specifies criterion for this native campaign experiment result. Values: `delivery`, `read`, `reply`.
    - `outcome` (object, required, nullable). Specifies outcome for this native campaign experiment result.
      - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
      - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
      - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
    - `holdoutCount` (integer, required). Recipients held out; they receive no message.
    - `reserveCount` (integer, required). Recipients who wait for the winner.
    - `variants` (array of object, required). Variants associated with this native campaign experiment result.
      - `key` (string, required). Specifies key for this variant.
      - `label` (string, required). Specifies label for this variant.
      - `weight` (integer, required). Specifies weight for this variant.
      - `assigned` (integer, required). Test recipients assigned this variant.
      - `sent` (integer, required). Specifies sent for this variant.
      - `delivered` (integer, required). Specifies delivered for this variant.
      - `read` (integer, required). Specifies read for this variant.
      - `replied` (integer, required). Specifies replied for this variant.
      - `outcomeRate` (number, required). The `criterion` count divided by `sent`, counting every result received so far.
  - `drip` (object, required, nullable). Specifies drip for this native campaign analytic.
    - `enrollment` (string, required). Specifies enrollment for this native campaign drip stat. Values: `audience`, `continuous`.
    - `enrolled` (integer, required). Contacts in the drip, from the audience and the enrollment endpoint.
    - `enrolledByApi` (integer, required). Contacts added through the enrollment endpoint.
    - `active` (integer, required). Contacts still owed a step.
    - `completed` (integer, required). Contacts sent every step.
    - `exited` (integer, required). Contacts who left early: a reply, an opt-out or an opened tracked link.
    - `steps` (array of object, required). Steps associated with this native campaign drip stat.
      - `step` (integer, required). Step position, from 0.
      - `entered` (integer, required). Contacts who reached this step: its delay started. Every contact enters step 0.
      - `waiting` (integer, required). Contacts waiting for this step or being sent it now.
      - `sent` (integer, required). Specifies sent for this native campaign drip step stat.
      - `delivered` (integer, required). Specifies delivered for this native campaign drip step stat.
      - `read` (integer, required). Specifies read for this native campaign drip step stat.
      - `replied` (integer, required). Contacts whose first reply after this step came within 7 days of it, before the next step.
      - `exited` (integer, required). Contacts who left the drip while waiting for this step: they replied, opted out or opened a tracked link.
      - `failed` (integer, required). Contacts whose step could not be sent. Their remaining steps stop.
  - `frequencyCap` (object, required). Specifies frequency cap for this native campaign analytic.
    - `skippedRecipientCount` (integer, required). Recipients whose first, sequence or follow-up message was skipped by the cap.
  - `followUps` (object, required). Specifies follow ups for this native campaign analytic.
    - `total` (integer, required, min 0). Final total for this order or price summary.
    - `waiting` (integer, required, min 0). Specifies waiting for this native campaign follow up report.
    - `scheduled` (integer, required, min 0). Specifies scheduled for this native campaign follow up report.
    - `sending` (integer, required, min 0). Specifies sending for this native campaign follow up report.
    - `sent` (integer, required, min 0). Specifies sent for this native campaign follow up report.
    - `delivered` (integer, required, min 0). Specifies delivered for this native campaign follow up report.
    - `read` (integer, required, min 0). Specifies read for this native campaign follow up report.
    - `replied` (integer, required, min 0). Specifies replied for this native campaign follow up report.
    - `cancelled` (integer, required, min 0). Specifies cancelled for this native campaign follow up report.
    - `expired` (integer, required, min 0). Specifies expired for this native campaign follow up report.
    - `failed` (integer, required, min 0). Specifies failed for this native campaign follow up report.
    - `unknown` (integer, required, min 0). Specifies unknown for this native campaign follow up report.
    - `nextDueAt` (number, required, nullable). Timestamp for next due at.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "campaignId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "respondedCount": 0,
    "responseRate": 0,
    "averageResponseTimeMs": 0,
    "minResponseTimeMs": 0,
    "maxResponseTimeMs": 0,
    "experiment": {
      "criterion": "delivery",
      "outcome": {
        "state": "promoted"
      },
      "holdoutCount": 0,
      "reserveCount": 0,
      "variants": [
        {
          "key": "string",
          "label": "string",
          "weight": 0,
          "assigned": 0,
          "sent": 0,
          "delivered": 0,
          "read": 0,
          "replied": 0,
          "outcomeRate": 0
        }
      ]
    },
    "drip": {
      "enrollment": "audience",
      "enrolled": 0,
      "enrolledByApi": 0,
      "active": 0,
      "completed": 0,
      "exited": 0,
      "steps": [
        {
          "step": 0,
          "entered": 0,
          "waiting": 0,
          "sent": 0,
          "delivered": 0,
          "read": 0,
          "replied": 0,
          "exited": 0,
          "failed": 0
        }
      ]
    },
    "frequencyCap": {
      "skippedRecipientCount": 0
    },
    "followUps": {
      "total": 0,
      "waiting": 0,
      "scheduled": 0,
      "sending": 0,
      "sent": 0,
      "delivered": 0,
      "read": 0,
      "replied": 0,
      "cancelled": 0,
      "expired": 0,
      "failed": 0,
      "unknown": 0,
      "nextDueAt": 0
    }
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Get project campaign links

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/links` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

Beta. Opens of each tracked link, in the campaign's link order. An open is a request to the short link: a person, or an app or security scanner previewing the link. It is not proof of a click. Requires the campaign link tracking beta (`403 feature_unavailable` otherwise).

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/links" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (array of object, required). Structured data carried by this object.
  - `key` (string, required). Tracked link key.
  - `url` (string, required). Destination of the tracked link.
  - `uniqueOpens` (integer, required, min 0). Recipients who opened the link at least once.
  - `totalOpens` (integer, required, min 0). Every recorded open, including repeat opens.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": [
    {
      "key": "offer",
      "url": "https://example.com/spring-sale",
      "uniqueOpens": 0,
      "totalOpens": 0
    }
  ]
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Get project campaign reply flow

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaign-reply-flows/{id}` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string (uuid), required, format uuid). Identifier for this resource.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaign-reply-flows/<id>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `flowKey` (string (uuid), required, format uuid). Groups the revisions of one reply flow.
  - `revision` (integer, required). Specifies revision for this native campaign reply flow.
  - `name` (string, required). Human-readable name for this resource.
  - `definition` (object, required). Structured definition for this resource.
    - `entryNodeId` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for the entry node.
    - `nodes` (array of object, required, items 2–12). Nodes associated with this native campaign reply flow definition.
      - `id` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for this resource.
      - `send` (object). Specifies send for this native campaign reply flow node.
        - One of:
          - `text` (object).
            - `kind` (string, required). Kind discriminator for this object. Values: `text`.
            - `text` (string, required, length 1–4096). Text content carried by this object.
          - `buttons` (object).
            - `kind` (string, required). Kind discriminator for this object. Values: `buttons`.
            - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
            - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
            - `buttons` (array of object, required, items 1–3). Interactive buttons displayed with the message.
          - `list` (object).
            - `kind` (string, required). Kind discriminator for this object. Values: `list`.
            - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
            - `buttonText` (string, required, length 1–20). Text displayed on the action button.
            - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
            - `rows` (array of object, required, items 1–10). Rows associated with this one of.
          - `flow_form` (object). A published WhatsApp Flow form. Official numbers only.
            - `kind` (string, required). Kind discriminator for this object. Values: `flow_form`.
            - `flowId` (string (uuid), required, format uuid). Identifier for the flow.
            - `body` (string, required, length 1–1024). Primary text content shown to the recipient.
            - `buttonText` (string, required, length 1–20). Text displayed on the action button.
            - `footer` (string, max length 60). Supplementary footer text shown below the primary content.
            - `screen` (string, required, pattern ^[A-Za-z0-9_]{1,64}$). Flow screen opened when the recipient activates the message.
      - `edges` (array of object, required, max items 3). Edges associated with this native campaign reply flow node.
        - `match` (one of, required). Specifies match for this edge.
        - `to` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Specifies to for this edge.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "flowKey": "00000000-0000-4000-8000-000000000000",
    "revision": 0,
    "name": "string",
    "definition": {
      "entryNodeId": "string",
      "nodes": [
        {
          "id": "string",
          "edges": [
            {
              "match": null,
              "to": null
            }
          ]
        }
      ]
    },
    "createdAt": 0
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

`missing_scope`, or `feature_unavailable` when campaign reply flows are not enabled for the team.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "missing_scope",
    "message": "The credential lacks a required API scope.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#missing-scope"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Get campaign

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}` (Platform API)

Required permission: `campaigns:read`

Returns one campaign and its stored send window, or null when no matching campaign exists in the selected project.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (object, required, nullable). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string (uuid), required, nullable, format uuid). Identifier of the message template.
  - `recipientListId` (string (uuid), required, nullable, format uuid). Identifier for the recipient list.
  - `recipientCount` (integer, required, min 0). Number of recipients.
  - `sentCount` (integer, required, min 0). Number of sents.
  - `deliveredCount` (integer, required, min 0). Number of delivereds.
  - `readCount` (integer, required, min 0). Number of reads.
  - `failedCount` (integer, required, min 0). Number of faileds.
  - `skippedCount` (integer, required, min 0). Number of skippeds.
  - `scheduledAt` (integer, required, nullable). Scheduled start in Unix milliseconds.
  - `launchedAt` (integer, required, nullable). Launch time in Unix milliseconds.
  - `completedAt` (integer, required, nullable). Completion time in Unix milliseconds.
  - `createdAt` (integer, required). Creation time in Unix milliseconds.
  - `updatedAt` (integer, required). Last update in Unix milliseconds.
  - `sendWindow` (object, required, nullable). Specifies send window for this management platform campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required). Days associated with this management campaign send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required). Hours associated with this management campaign send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Whether recipient time zone.
    - `timeZoneVariable` (string, required). Specifies time zone variable for this management campaign send window.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
  - `variableMapping` (object, nullable, max properties 50). How each content variable is filled; null when the campaign has no mapping.
  - `drip` (object, required, nullable). Specifies drip for this management platform campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `followUp` (object, required, nullable). Specifies follow up for this management platform campaign.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `composerBlueprint` (any). Specifies composer blueprint for this management platform campaign.
  - `messages` (any). Specifies messages for this management platform campaign.
  - `audienceRef` (any). Specifies audience ref for this management platform campaign.
  - `senderConfig` (any). Specifies sender config for this management platform campaign.
  - `complianceConfig` (any). Specifies compliance config for this management platform campaign.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). The message this variant sends, in the composed-message format.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). How the A/B test runs; null for a broadcast.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
  - `experimentOutcome` (object, required, nullable). The saved A/B result, or null before a decision and for a broadcast.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `messageVariations` (array of object, nullable, items 2–5). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
    - `blueprint` (object, required). Structured blueprint values for this message variation.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). Specifies source for this blueprint.
  - `segmentId` (string (uuid), nullable, format uuid). Saved audience segment the campaign evaluates at launch, or null.
  - `segmentSnapshot` (object, nullable). What launch froze from the segment: its revision, the evaluation time in Unix milliseconds and the matching profile count. Null before a segment launch.
    - `revision` (integer, required, min 1). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required, min 0). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required, min 0). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). This campaign's own contact frequency cap; null when only the team cap applies.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "name": "string",
    "status": "string",
    "templateId": "00000000-0000-4000-8000-000000000000",
    "recipientListId": "00000000-0000-4000-8000-000000000000",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "sendWindow": {
      "timeZone": "string",
      "days": [
        "monday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "string"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": false
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "experimentOutcome": {
      "state": "promoted"
    },
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## Get campaign reply flow

`GET https://api.polymorfa.com/platform/campaign-reply-flows/{replyFlowId}` (Platform API)

Required permission: `campaigns:read`

Gets one reply flow revision in a project. Beta: returns `403` unless campaign reply flows are enabled for the team.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `replyFlowId` (string, required). Identifier for the reply flow.

### Query parameters

- `projectId` (string). Identifier of the Polymorfa project that owns this resource.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaign-reply-flows/<replyFlowId>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `flowKey` (string (uuid), required, format uuid). Groups the revisions of one reply flow.
  - `revision` (integer, required). Specifies revision for this management platform campaign reply flow.
  - `name` (string, required). Human-readable name for this resource.
  - `definition` (object, required). Structured definition for this resource.
    - `entryNodeId` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for the entry node.
    - `nodes` (array of object, required, items 2–12). Nodes associated with this management platform campaign reply flow definition.
      - `id` (string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$). Identifier for this resource.
      - `send` (object). `text` (`text`), `buttons` (`body`, up to 3 `buttons` with `id` and `text`), `list` (`body`, `buttonText`, up to 10 `rows`), or `flow_form` (`flowId`, `body`, `buttonText`, `screen`; Official numbers only).
        - `kind` (string, required). Kind discriminator for this object. Values: `text`, `buttons`, `list`, `flow_form`.
      - `edges` (array of object, required, max items 3). Edges associated with this node.
        - `match` (object, required). `choice` (`replyKind` `button` or `list`, `id`), `keyword` (`value`), or `flow_submission`.
        - `to` (string, required). Specifies to for this edge.
  - `createdAt` (integer, required). Unix milliseconds.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "flowKey": "00000000-0000-4000-8000-000000000000",
    "revision": 0,
    "name": "string",
    "definition": {
      "entryNodeId": "string",
      "nodes": [
        {
          "id": "string",
          "edges": [
            {
              "match": null,
              "to": null
            }
          ]
        }
      ]
    },
    "createdAt": 0
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## Get campaign analytics

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}/analytics` (Platform API)

Required permission: `campaigns:read`

Returns the campaign's delivery funnel, reply timing, for an A/B campaign results by variant with the saved outcome, and a separate follow-up report. Follow-up counts never change the first-message counts.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>/analytics" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `recipientCount` (integer, required). Number of recipients.
  - `sentCount` (integer, required). Number of sents.
  - `deliveredCount` (integer, required). Number of delivereds.
  - `readCount` (integer, required). Number of reads.
  - `failedCount` (integer, required). Number of faileds.
  - `skippedCount` (integer, required). Number of skippeds.
  - `respondedCount` (integer, required). Number of respondeds.
  - `responseRate` (number, required). `respondedCount` divided by `sentCount`; 0 before the first send.
  - `averageResponseTimeMs` (number, required, nullable). Mean time from send to first reply in milliseconds; null before the first reply.
  - `minResponseTimeMs` (number, required, nullable). Specifies min response time ms for this management platform campaign analytic.
  - `maxResponseTimeMs` (number, required, nullable). Specifies max response time ms for this management platform campaign analytic.
  - `experiment` (object, required, nullable). A/B results by variant; null for a broadcast. The decision counts only results received by the test deadline, so `outcomeRate` can differ from the rate the decision used.
    - `criterion` (string, required). Specifies criterion for this experiment. Values: `delivery`, `read`, `reply`.
    - `outcome` (object, required, nullable). The saved A/B result. `promoted` names the variant sent to the reserve. `inconclusive` means the test paused the campaign with the reserve unsent; the campaign cannot resume, so stop it or duplicate it.
      - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
      - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
      - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
    - `holdoutCount` (integer, required). Recipients held out; they receive no message.
    - `reserveCount` (integer, required). Recipients who wait for the winner.
    - `variants` (array of object, required). Variants associated with this experiment.
      - `key` (string, required). Specifies key for this variant.
      - `label` (string, required). Specifies label for this variant.
      - `weight` (integer, required). Specifies weight for this variant.
      - `assigned` (integer, required). Test recipients assigned this variant.
      - `sent` (integer, required). Specifies sent for this variant.
      - `delivered` (integer, required). Specifies delivered for this variant.
      - `read` (integer, required). Specifies read for this variant.
      - `replied` (integer, required). Specifies replied for this variant.
      - `outcomeRate` (number, required). The `criterion` count divided by `sent`, counting every result received so far.
  - `drip` (object, required, nullable). Specifies drip for this management platform campaign analytic.
    - `enrollment` (string, required). Specifies enrollment for this management campaign drip stat. Values: `audience`, `continuous`.
    - `enrolled` (integer, required). Specifies enrolled for this management campaign drip stat.
    - `enrolledByApi` (integer, required). Specifies enrolled by api for this management campaign drip stat.
    - `active` (integer, required). Specifies active for this management campaign drip stat.
    - `completed` (integer, required). Specifies completed for this management campaign drip stat.
    - `exited` (integer, required). Specifies exited for this management campaign drip stat.
    - `steps` (array of object, required). Steps associated with this management campaign drip stat.
      - `step` (integer, required). Specifies step for this step.
      - `entered` (integer, required). Specifies entered for this step.
      - `waiting` (integer, required). Specifies waiting for this step.
      - `sent` (integer, required). Specifies sent for this step.
      - `delivered` (integer, required). Specifies delivered for this step.
      - `read` (integer, required). Specifies read for this step.
      - `replied` (integer, required). Specifies replied for this step.
      - `exited` (integer, required). Specifies exited for this step.
      - `failed` (integer, required). Specifies failed for this step.
  - `frequencyCap` (object, required). Recipients with a message skipped by the contact frequency cap.
    - `skippedRecipientCount` (integer, required, min 0). Recipients whose first, sequence or follow-up message was skipped by the cap.
  - `followUps` (object, required). Follow-up outcomes, counted separately from the first message. All zero when the campaign has no follow-up.
    - `total` (integer, required, min 0). Final total for this order or price summary.
    - `waiting` (integer, required, min 0). Specifies waiting for this management campaign follow up report.
    - `scheduled` (integer, required, min 0). Specifies scheduled for this management campaign follow up report.
    - `sending` (integer, required, min 0). Specifies sending for this management campaign follow up report.
    - `sent` (integer, required, min 0). Specifies sent for this management campaign follow up report.
    - `delivered` (integer, required, min 0). Specifies delivered for this management campaign follow up report.
    - `read` (integer, required, min 0). Specifies read for this management campaign follow up report.
    - `replied` (integer, required, min 0). Specifies replied for this management campaign follow up report.
    - `cancelled` (integer, required, min 0). Specifies cancelled for this management campaign follow up report.
    - `expired` (integer, required, min 0). Specifies expired for this management campaign follow up report.
    - `failed` (integer, required, min 0). Specifies failed for this management campaign follow up report.
    - `unknown` (integer, required, min 0). Specifies unknown for this management campaign follow up report.
    - `nextDueAt` (number, required, nullable). Unix milliseconds.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "respondedCount": 0,
    "responseRate": 0,
    "averageResponseTimeMs": 0,
    "minResponseTimeMs": 0,
    "maxResponseTimeMs": 0,
    "experiment": {
      "criterion": "delivery",
      "outcome": {
        "state": "promoted"
      },
      "holdoutCount": 0,
      "reserveCount": 0,
      "variants": [
        {
          "key": "string",
          "label": "string",
          "weight": 0,
          "assigned": 0,
          "sent": 0,
          "delivered": 0,
          "read": 0,
          "replied": 0,
          "outcomeRate": 0
        }
      ]
    },
    "drip": {
      "enrollment": "audience",
      "enrolled": 0,
      "enrolledByApi": 0,
      "active": 0,
      "completed": 0,
      "exited": 0,
      "steps": [
        {
          "step": 0,
          "entered": 0,
          "waiting": 0,
          "sent": 0,
          "delivered": 0,
          "read": 0,
          "replied": 0,
          "exited": 0,
          "failed": 0
        }
      ]
    },
    "frequencyCap": {
      "skippedRecipientCount": 0
    },
    "followUps": {
      "total": 0,
      "waiting": 0,
      "scheduled": 0,
      "sending": 0,
      "sent": 0,
      "delivered": 0,
      "read": 0,
      "replied": 0,
      "cancelled": 0,
      "expired": 0,
      "failed": 0,
      "unknown": 0,
      "nextDueAt": 0
    }
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## Get campaign links

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}/links` (Platform API)

Required permission: `campaigns:read`

Beta: requires team enrollment in campaign link tracking. Returns opens of each tracked link in the campaign's link order. An open is a request to the short link from a person, or from an app or security scanner previewing the link; it is not proof of a click. `uniqueOpens` counts recipients who opened the link at least once; `totalOpens` counts every open. A team without the beta answers `403 feature_unavailable`.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>/links" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (array of object, required). Structured data carried by this object.
  - `key` (string, required). Tracked link key.
  - `url` (string, required). Destination of the tracked link.
  - `uniqueOpens` (integer, required, min 0). Recipients who opened the link at least once.
  - `totalOpens` (integer, required, min 0). Every recorded open, including repeat opens.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": [
    {
      "key": "offer",
      "url": "string",
      "uniqueOpens": 0,
      "totalOpens": 0
    }
  ]
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

## Update project campaign

`PATCH https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Updates the fields you send and leaves the rest unchanged. On an unlaunched draft, a new `senderConfig` passes the same checks as create, on any plan; launch checks the selection against live plans. Once the campaign has launched, including a scheduled launch that has not started, a new `senderConfig` must pass the launch checks and can answer `402 campaigns_not_entitled` or `400 invalid_parameter`. `recipientListId`, a different `scheduledAt`, and a changed `templateId` or `variableMapping` are accepted only while the campaign is an unlaunched draft; afterwards they answer `409`. Sending the stored value again is not a change. `trackedLinks` changes only while draft, including while waiting for a scheduled start; afterwards it answers `409`. A sender change to a draft that launches while the change is being saved also answers `409`. `sendWindow` changes only while draft or paused; a paused edit answers `409` while sends are in progress. A non-null `scheduledAt` must be integer Unix milliseconds within the JavaScript Date range.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string (uuid), required, format uuid). Identifier for this resource.

### Body

- `name` (string, length 1–200). New name, 1 to 200 characters after trimming.
- `followUp` (object, nullable). One follow-up, editable only before launch. Null removes it. A beta; a team that is not enrolled gets `403 feature_unavailable` when setting one. The first read takes precedence over the first delivery; replies and opt-outs cancel; an expired wait never sends.
  - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
  - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
  - `message` (object, required). Human-readable message associated with this result.
    - One of:
      - `text` (object).
        - `type` (string, required). Type discriminator for this object. Values: `text`.
        - `text` (string, required, length 1–16384). Text content carried by this object.
      - `template` (object).
        - `type` (string, required). Type discriminator for this object. Values: `template`.
        - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
- `recipientListId` (string (uuid), nullable, format uuid). Audience to send to, or null for none. Only an unlaunched draft can change it; the campaign's current recipients are replaced by the audience's members at launch.
- `senderConfig` (object). Replaces the sender selection and throughput. On an unlaunched draft it passes the same checks as create. Once the campaign has launched it must pass the launch checks.
- `scheduledAt` (integer, nullable, range 0–8640000000000000). Start time in milliseconds since the Unix epoch, or null to start at launch. Only an unlaunched draft can change it.
- `sendWindow` (object, nullable). Specifies send window for this native update campaign request.
  - `timeZone` (string, length 1–64). IANA time zone the window is written in, such as `America/Sao_Paulo`. When omitted, the team's time zone is stored, or `UTC` when the team has none.
  - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
  - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
    - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
    - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `recipientTimeZone` (boolean). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`. Default: `false`.
  - `timeZoneVariable` (string, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true. Default: `"timeZone"`.
- `drip` (object, nullable). Specifies drip for this native update campaign request.
  - `enrollment` (string). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
  - `exitOnReply` (boolean). When true, a contact who replies to the sending number gets no further steps.
  - `exitOnLinkClick` (boolean). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
- `frequencyCap` (object, nullable). Specifies frequency cap for this native update campaign request.
  - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
  - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
- `trackedLinks` (array of object, nullable, max items 5). Beta. Links to track, at most 5. Each message reference `{{link:<key>}}` is replaced with a short link per recipient that redirects to `url`. Only campaigns sent from linked-device numbers track links. Setting links requires the campaign link tracking beta (`403 feature_unavailable` otherwise); `null` or `[]` removes them. Only a draft, including one waiting for its scheduled start, can change them; a launched campaign must still define every link its messages reference.
  - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
  - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
- `templateId` (string (uuid), nullable, format uuid). Template in this project to send instead of composed messages, or null to send the composed messages. Only an unlaunched draft can change it.
- `variableMapping` (object, nullable, max properties 50). Replaces the whole variable mapping; null clears it. Only an unlaunched draft can change it.
- `messageVariations` (array of object, nullable, items 2–5). Replaces the weighted message alternatives; null clears them. Only an unlaunched draft can change it.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
  - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
    - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
    - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
- `variants` (array of object, nullable, items 2–4). Replaces the A/B variants. Null, together with a null `variantStrategy`, makes the draft a broadcast. Only an unlaunched draft can change it.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
  - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
  - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
    - `version` (integer, required). Specifies version for this native campaign variant message.
    - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
- `variantStrategy` (object, nullable). Specifies variant strategy for this native update campaign request.
  - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
  - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
  - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
  - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
  - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.

### Request

```bash
curl -X PATCH "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "followUp": {
    "message": {
      "type": "text",
      "text": "string"
    }
  },
  "recipientListId": "00000000-0000-4000-8000-000000000000",
  "senderConfig": {},
  "scheduledAt": 0,
  "sendWindow": {
    "days": [
      "monday",
      "tuesday",
      "wednesday",
      "thursday",
      "friday"
    ],
    "hours": [
      {
        "start": "09:00",
        "end": "18:00"
      }
    ]
  },
  "drip": {
    "enrollment": "audience",
    "exitOnReply": true,
    "exitOnLinkClick": true
  },
  "frequencyCap": {
    "maxPer24Hours": 1,
    "maxPer7Days": 1
  },
  "trackedLinks": [
    {
      "key": "offer",
      "url": "https://example.com/spring-sale"
    }
  ],
  "templateId": "00000000-0000-4000-8000-000000000000",
  "variableMapping": {},
  "messageVariations": [
    {
      "key": "short",
      "weight": 50,
      "blueprint": {
        "version": 0,
        "source": "string"
      }
    }
  ],
  "variants": [
    {
      "key": "a",
      "label": "Short intro",
      "weight": 50,
      "blueprint": {
        "version": 0,
        "source": "Hi <first_name>, your offer is ready."
      }
    }
  ],
  "variantStrategy": {
    "winnerCriterion": "delivery",
    "holdoutPercent": 0,
    "autoPromote": true,
    "testWindowMinutes": 15
  }
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 402

`campaigns_not_entitled`: a new sender selection on a launched campaign names a number whose plan does not include Campaigns
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "billing_error",
    "code": "campaigns_not_entitled",
    "message": "This number’s plan does not include Campaigns.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaigns-not-entitled"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: the campaign has launched and the audience or start time can no longer change, it launched while its sending numbers were being changed, its send window cannot change in the current state or while sends are in progress, or its tracked links cannot change after sending started
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

`service_unavailable`: number eligibility for a launched campaign's new sender selection could not be checked. Nothing was changed
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Update campaign

`PATCH https://api.polymorfa.com/platform/campaigns/{campaignId}` (Platform API)

Required permission: `campaigns:manage`

Updates a campaign. A PATCH containing only `drip` that closes a running or paused continuous drip to audience enrollment with unchanged exit settings is allowed without beta access. Other non-null drip settings require the beta. `messagesArray` follows the same sequence rules as create. On an unlaunched draft, a new `senderConfig` passes the same checks as create and plans are checked at launch. Once the campaign has launched, including a scheduled launch that has not started, a new `senderConfig` passes the launch checks and can answer `402 campaigns_not_entitled` or `400 invalid_parameter`. `recipientListId` points the campaign at another audience while it is still an unlaunched draft and replaces its existing recipients; after launch it answers `409`. `templateId`, `variableMapping`, `messagesArray` and `composerBlueprint` also change only while the campaign is an unlaunched draft; after launch a different value answers `409`, and the stored value is accepted. A sender edit to a draft that launches while the edit is being saved also answers `409`. A changed `scheduledAt` after launch answers `409`; use reschedule to move a scheduled start. A non-null `scheduledAt` must be integer Unix milliseconds from zero through the JavaScript Date maximum. `sendWindow` changes only while the campaign is a draft or paused; a running campaign answers `409`, so pause it first. An edit to a paused campaign also answers `409` while sends are in progress; retry after they settle. A stalled send that has not reached the provider can be recovered on a later edit attempt. If delivery may have started, the edit waits for a definite result rather than sending the recipient again. A new window applies to the remaining recipients when the campaign resumes. `trackedLinks` changes only while the campaign is a draft, including while it waits for a scheduled start; afterwards it answers `409`. Setting tracked links requires the campaign link tracking beta and otherwise answers `403 feature_unavailable`. A launched campaign must still define every `{{link:<key>}}` its messages reference.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Body

- `drip` (object, nullable). Omitted fields preserve stored settings. Null makes the draft an ordinary campaign. Closing continuous enrollment with unchanged exit flags is allowed without beta access when it is the only change.
  - `enrollment` (string). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
  - `exitOnReply` (boolean). When true, a contact who replies to the sending number gets no further steps.
  - `exitOnLinkClick` (boolean). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
- `name` (string, length 1–200). Human-readable name for this resource.
- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.
- `templateId` (string (uuid), nullable, format uuid). Template in the campaign project, or null to send composed messages. Only while the campaign is an unlaunched draft.
- `variableMapping` (object, nullable, max properties 50). Replaces the whole mapping; null clears it. Only while the campaign is an unlaunched draft.
- `recipientListId` (string (uuid), nullable, format uuid). Audience to send to. Only while the campaign is an unlaunched draft. Setting an audience clears `segmentId`.
- `segmentId` (string (uuid), nullable, format uuid). Beta. Saved audience segment to evaluate at launch, or null to clear it. Only while the campaign is an unlaunched draft. Setting a segment clears `recipientListId`; sending both answers `400`. Requires a team API key or the dashboard and the audience segments beta.
- `senderConfig` (object). Structured sender config values for this management update platform campaign request.
- `scheduledAt` (integer, nullable, range 0–8640000000000000). Scheduled start time in Unix milliseconds. Only while the campaign is an unlaunched draft.
- `followUp` (object, nullable). Only editable before launch. Null removes the optional follow-up.
  - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
  - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
  - `message` (object, required). Human-readable message associated with this result.
    - One of:
      - `text` (object).
        - `type` (string, required). Type discriminator for this object. Values: `text`.
        - `text` (string, required, length 1–16384). Text content carried by this object.
      - `template` (object).
        - `type` (string, required). Type discriminator for this object. Values: `template`.
        - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
- `sendWindow` (object, nullable). When the campaign may send. `null` removes the window. Only while the campaign is a draft or paused.
  - `timeZone` (string, length 1–64). IANA time zone the window is written in, such as `America/Sao_Paulo`. When omitted, the team's time zone is stored, or `UTC` when the team has none.
  - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
  - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
    - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
    - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `recipientTimeZone` (boolean). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`. Default: `false`.
  - `timeZoneVariable` (string, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true. Launch rejects more than 5,000 distinct nonempty values with `400 invalid_parameter`. Default: `"timeZone"`.
- `trackedLinks` (array of object, nullable, max items 5). Beta. Replaces the tracked links, at most 5. `null` or `[]` removes them. Only while the campaign is a draft, including while it waits for a scheduled start.
  - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
  - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
- `frequencyCap` (object, nullable). Beta. Replaces this campaign's own contact frequency cap; `null` removes it and leaves the team cap. Only while the campaign is a draft or paused; a running campaign answers `409`, so pause it first. Setting a cap requires the contact frequency caps beta; removing one does not.
  - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
  - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.
- `recipientCount` (number). Number of recipients.
- `composerBlueprint` (any). Specifies composer blueprint for this management update platform campaign request.
- `messagesArray` (array of object, max items 10). Replaces the messages each recipient receives, in order, with the same rules as create. Only while the campaign is an unlaunched draft.
  - `version` (integer). Specifies version for this management campaign message. Values: `2`.
  - `source` (string). Message text. `{{name}}` inserts a recipient variable and `{{name | fallback}}` uses the fallback when the variable is missing or empty. WhatsApp formatting such as `*bold*` is kept.
  - `media` (object). Reference to the media attached to this message.
    - `kind` (string, required). Kind discriminator for this object. Values: `image`, `video`, `audio`, `document`.
    - `url` (string (uri), required, format uri). Public https URL the sending number downloads the file from. Launch is refused with `400 invalid_parameter` when an attachment has no URL.
    - `filename` (string). Filename presented for the media attachment.
    - `caption` (string). Used as the caption when `source` is empty.
  - `buttons` (array of object). On WhatsApp numbers, link and call buttons are sent as text lines and quick replies are left out.
    - `kind` (string, required). Kind discriminator for this object. Values: `reply`, `link`, `call`.
    - `label` (string, required). Specifies label for this button.
    - `url` (string). URL associated with this resource.
    - `phone` (string). Phone number in international format.
  - `footer` (string). Supplementary footer text shown below the primary content.
  - `delayUnit` (string). Display unit. delayAfterSec must be a whole multiple of this unit. Values: `minutes`, `hours`, `days`.
  - `sendWindow` (object, nullable). Drip steps after the first only. Replaces the campaign weekdays and hours for this step, retaining its time zone settings. Without a campaign window, uses the team time zone saved when the drip was configured.
    - `days` (array of string, required, min items 1, unique items). Days associated with this send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Hours associated with this send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
  - `delayAfterSec` (integer, range 0–2592000). A drip allows up to 30 days; other campaigns allow up to 86400 seconds. Minimum seconds between the previous message being accepted by WhatsApp and this message being sent. Ignored on the first message. Pacing, caps and a paused campaign can make the wait longer.
- `audienceRef` (any). Specifies audience ref for this management update platform campaign request.
- `complianceConfig` (any). Specifies compliance config for this management update platform campaign request.
- `variants` (array of object, nullable, items 2–4). Replaces the A/B variants. `null`, together with a null `variantStrategy`, makes the draft a broadcast. Only while the campaign is an unlaunched draft.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
  - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
  - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
  - `blueprint` (object, required). The message this variant sends, in the composed-message format.
    - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
    - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
- `variantStrategy` (object, nullable). Replaces how the A/B test runs. Only while the campaign is an unlaunched draft.
  - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
  - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
  - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
  - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
  - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
- `messageVariations` (array of object, nullable, items 2–5). Replaces the weighted linked-device alternatives; null clears them. Only while the campaign is an unlaunched draft.
  - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
  - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
  - `blueprint` (object, required). Structured blueprint values for this message variation.
    - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
    - `source` (string, required, length 1–4096). Specifies source for this blueprint.

### Request

```bash
curl -X PATCH "https://api.polymorfa.com/platform/campaigns/<campaignId>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "drip": {
    "enrollment": "audience",
    "exitOnReply": true,
    "exitOnLinkClick": true
  },
  "name": "string",
  "projectId": "00000000-0000-4000-8000-000000000000",
  "templateId": "00000000-0000-4000-8000-000000000000",
  "variableMapping": {},
  "recipientListId": "00000000-0000-4000-8000-000000000000",
  "segmentId": "00000000-0000-4000-8000-000000000000",
  "senderConfig": {},
  "scheduledAt": 0,
  "followUp": {
    "message": {
      "type": "text",
      "text": "string"
    }
  },
  "sendWindow": {
    "days": [
      "monday"
    ],
    "hours": [
      {
        "start": "09:00",
        "end": "18:00"
      }
    ]
  },
  "trackedLinks": [
    {
      "key": "offer",
      "url": "https://example.com/spring-sale"
    }
  ],
  "frequencyCap": {
    "maxPer24Hours": 1,
    "maxPer7Days": 1
  },
  "recipientCount": 0,
  "composerBlueprint": null,
  "messagesArray": [
    {
      "version": 2,
      "source": "string",
      "media": {
        "kind": "image",
        "url": "https://example.com"
      },
      "buttons": [
        {
          "kind": "reply",
          "label": "string"
        }
      ],
      "footer": "string",
      "delayUnit": "minutes",
      "sendWindow": {
        "days": [
          "monday"
        ],
        "hours": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ]
      },
      "delayAfterSec": 0
    }
  ],
  "audienceRef": null,
  "complianceConfig": null,
  "variants": [
    {
      "key": "a",
      "label": "string",
      "weight": 1,
      "blueprint": {
        "version": 2,
        "source": "string"
      }
    }
  ],
  "variantStrategy": {
    "winnerCriterion": "delivery",
    "holdoutPercent": 0,
    "autoPromote": true,
    "testWindowMinutes": 15
  },
  "messageVariations": [
    {
      "key": "string",
      "weight": 1,
      "blueprint": {
        "version": 2,
        "source": "string"
      }
    }
  ]
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string (uuid), required, nullable, format uuid). Identifier of the message template.
  - `recipientListId` (string (uuid), required, nullable, format uuid). Identifier for the recipient list.
  - `recipientCount` (integer, required, min 0). Number of recipients.
  - `sentCount` (integer, required, min 0). Number of sents.
  - `deliveredCount` (integer, required, min 0). Number of delivereds.
  - `readCount` (integer, required, min 0). Number of reads.
  - `failedCount` (integer, required, min 0). Number of faileds.
  - `skippedCount` (integer, required, min 0). Number of skippeds.
  - `scheduledAt` (integer, required, nullable). Scheduled start in Unix milliseconds.
  - `launchedAt` (integer, required, nullable). Launch time in Unix milliseconds.
  - `completedAt` (integer, required, nullable). Completion time in Unix milliseconds.
  - `createdAt` (integer, required). Creation time in Unix milliseconds.
  - `updatedAt` (integer, required). Last update in Unix milliseconds.
  - `sendWindow` (object, required, nullable). Specifies send window for this management platform campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required). Days associated with this management campaign send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required). Hours associated with this management campaign send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Whether recipient time zone.
    - `timeZoneVariable` (string, required). Specifies time zone variable for this management campaign send window.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
  - `variableMapping` (object, nullable, max properties 50). How each content variable is filled; null when the campaign has no mapping.
  - `drip` (object, required, nullable). Specifies drip for this management platform campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `followUp` (object, required, nullable). Specifies follow up for this management platform campaign.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `composerBlueprint` (any). Specifies composer blueprint for this management platform campaign.
  - `messages` (any). Specifies messages for this management platform campaign.
  - `audienceRef` (any). Specifies audience ref for this management platform campaign.
  - `senderConfig` (any). Specifies sender config for this management platform campaign.
  - `complianceConfig` (any). Specifies compliance config for this management platform campaign.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). The message this variant sends, in the composed-message format.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). How the A/B test runs; null for a broadcast.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
  - `experimentOutcome` (object, required, nullable). The saved A/B result, or null before a decision and for a broadcast.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `messageVariations` (array of object, nullable, items 2–5). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
    - `blueprint` (object, required). Structured blueprint values for this message variation.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). Specifies source for this blueprint.
  - `segmentId` (string (uuid), nullable, format uuid). Saved audience segment the campaign evaluates at launch, or null.
  - `segmentSnapshot` (object, nullable). What launch froze from the segment: its revision, the evaluation time in Unix milliseconds and the matching profile count. Null before a segment launch.
    - `revision` (integer, required, min 1). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required, min 0). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required, min 0). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). This campaign's own contact frequency cap; null when only the team cap applies.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "name": "string",
    "status": "string",
    "templateId": "00000000-0000-4000-8000-000000000000",
    "recipientListId": "00000000-0000-4000-8000-000000000000",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "sendWindow": {
      "timeZone": "string",
      "days": [
        "monday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "string"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": false
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "experimentOutcome": {
      "state": "promoted"
    },
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 402

`campaigns_not_entitled`: a sending number is missing or its plan does not include Campaigns.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "billing_error",
    "code": "campaigns_not_entitled",
    "message": "This number’s plan does not include Campaigns.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaigns-not-entitled"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 503

`service_unavailable`: the selected numbers' plans could not be checked. Nothing was launched or saved; retry the request.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Enroll project campaign contact

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/enrollments` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Beta. Adds one contact to a running or paused drip whose `drip.enrollment` is `continuous`. The contact starts at the first step, subject to the drip's send window, pacing and caps. Idempotent per phone: a phone already in the drip, including one that finished or left, returns its existing enrollment with `created: false`. An opted-out phone is enrolled as `skipped` and never sent. A team without the drip sequences beta gets `403 feature_unavailable`; a campaign that is not a drip, or a drip that is not accepting enrollments, answers `409 state_conflict`.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string (uuid), required, format uuid). Identifier for this resource.

### Body

- `phone` (string, required, length 1–32). The contact in international format. A phone already in the drip returns its existing enrollment with `created: false`.
- `variables` (object, max properties 50). The contact's variables, at most 50, used to fill the steps.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/enrollments" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+5511999990000"
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `recipientId` (string (uuid), required, format uuid). The contact's recipient ID in this campaign.
  - `phone` (string, required). The contact, in E.164 format.
  - `created` (boolean, required). False when the phone was already in this drip. Nothing changed, and a contact who finished or left is not enrolled again.
  - `status` (string, required). Recipient status of the first step: `queued` until sent, or `skipped` for an opted-out phone, which is never sent.
  - `enrolledAt` (number, required). When the contact joined the drip, in Unix milliseconds.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "recipientId": "00000000-0000-4000-8000-000000000000",
    "phone": "string",
    "created": true,
    "status": "string",
    "enrolledAt": 0
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: the campaign is not a drip, or the drip does not use continuous enrollment, has not started, or has ended
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Launch project campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/launch` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Starts a draft campaign. It begins sending at `scheduledAt`, or right away when no start time is set. Launch checks the saved sender selection against live plans: `402 campaigns_not_entitled` when a selected number is missing or its plan does not include Campaigns, or when an unselected campaign's project has no such number; `400 invalid_parameter` on `senderConfig.sessionIds` when a selected number is not connected or the selection mixes sending types; `400 campaign_throughput_capped` when a requested throughput is above its ceiling. Segment campaigns require a team API key; project tokens answer `403 permission_denied`, and unavailable audience betas answer `403 feature_unavailable`. An audience change during launch answers `409 state_conflict`. Segment evaluation that exceeds its time limit also answers `409 state_conflict`; simplify the rules and retry. A launched campaign whose segment was deleted remains launched and cannot be launched again (`409 state_conflict`). A message that references a `{{link:<key>}}` the campaign does not define, or tracked links on a campaign that would send from Official API numbers, answers `400 invalid_parameter` on `trackedLinks`; tracked links without the campaign link tracking beta answer `403 feature_unavailable`. A drip without a sendable composed message answers `400 invalid_parameter` on `messagesArray`. Saving a draft does not apply this check. The template must be complete and approved on every Cloud API number; every recipient needs a value or fallback for each variable unless `skipMissingVariables` is true. When the team requires approval above a recipient threshold and the launch would send to more recipients, it answers `409 campaign_approval_required`, sends nothing, and records a pending approval request for a team owner or admin. Launching again with the campaign unchanged returns the same request. A launch requested by an AI agent through the hosted MCP server is held the same way, whatever the threshold. The response returns the campaign as it was when the launch was accepted.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Body

- `scheduledAt` (number). Unix timestamp in milliseconds when this operation is scheduled to start.
- `skipMissingVariables` (boolean). Launch even when some recipients have no value and no fallback for a variable. Those recipients are skipped with `failureReason` `missing_variable` before the first send. Without it, such a launch is refused with `422 campaign_variables_missing`.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/launch" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "scheduledAt": 0,
  "skipMissingVariables": true
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
  - `operationId` (string (uuid), required, format uuid). Identifier used to retrieve the asynchronous operation.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    },
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

`invalid_parameter` naming the field: an unconnected or mixed sender selection (`senderConfig.sessionIds`), an incomplete or authentication template (`templateId`), a composed attachment without a public URL, or a `{{link:<key>}}` the campaign does not define or tracked links on Official API numbers (`trackedLinks`). `campaign_throughput_capped` when a requested throughput is above its ceiling; `template_not_approved` when a Cloud API number has not approved the template.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 402

`campaigns_not_entitled`: a selected number is missing or its plan does not include Campaigns, or the project has no number on such a plan. Drafts are saved on every plan.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "billing_error",
    "code": "campaigns_not_entitled",
    "message": "This number’s plan does not include Campaigns.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaigns-not-entitled"
}
```

#### 403

`permission_denied`: a project token attempted to launch a segment campaign; use a team API key or signed-in dashboard session. `feature_unavailable`: either audience beta is unavailable for a segment campaign, or the campaign has tracked links and its link tracking beta is unavailable. `bansafe_team_suspended` while the team is suspended.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`campaign_approval_required`: the launch is held for a team owner or admin and nothing was sent; the message names the approval request. `state_conflict`: the campaign is not a draft, is already launched and waiting for its start time, its sending numbers or audience changed during launch, or segment evaluation exceeded its time limit (simplify the rules and retry). A launched campaign whose segment was deleted cannot be launched again. The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "campaign_approval_required",
    "message": "This request needs approval from a team owner or admin. Nothing was sent.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaign-approval-required"
}
```

#### 422

`campaign_variables_missing`: some recipients have no value and no fallback for a variable. The message names the variables and counts the recipients. The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "campaign_variables_missing",
    "message": "A recipient has no value and no fallback for a variable in the campaign content.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaign-variables-missing"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

`service_unavailable`: the selected numbers' plans could not be checked; retry. For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Pause project campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/pause` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Pauses a running campaign. Sends already in progress can still finish.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/pause" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
  - `operationId` (string (uuid), required, format uuid). Identifier used to retrieve the asynchronous operation.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    },
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: The campaign is not running, or it has no active delivery run to pause. The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request. Use a new key for a different request.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "idempotency_replay_unavailable",
    "message": "The exact response for this Idempotency-Key is unavailable. The request was not repeated. Keep the first response and reconcile events or the resource. Waiting does not guarantee replay data becomes available; do not switch keys to resend.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-replay-unavailable"
}
```

## Resume project campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/resume` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Resumes a paused campaign. Its remaining recipients are sent after the same checks as before the pause.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/resume" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
  - `operationId` (string (uuid), required, format uuid). Identifier used to retrieve the asynchronous operation.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    },
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: The campaign is not paused, or it has no active delivery run to resume. The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request. Use a new key for a different request.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "idempotency_replay_unavailable",
    "message": "The exact response for this Idempotency-Key is unavailable. The request was not repeated. Keep the first response and reconcile events or the resource. Waiting does not guarantee replay data becomes available; do not switch keys to resend.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-replay-unavailable"
}
```

## Reschedule project campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/reschedule` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Moves the start of a launched campaign that is still waiting for it. Set `scheduledAt` to a later or earlier time, or to `null` to start now. The response returns the campaign with its new `scheduledAt`. Sending the current start time again changes nothing. A campaign that has started, finished, is being stopped, or was never launched is refused with `409`; launch a draft with `scheduledAt` instead.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Body

- `scheduledAt` (integer, required, nullable, greater than 0, max 8640000000000000). The new start time as a Unix timestamp in milliseconds. `null`, or a time that is not in the future, starts the campaign now.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/reschedule" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "scheduledAt": 0
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
  - `operationId` (string (uuid), required, format uuid). Identifier used to retrieve the asynchronous operation.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    },
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: The campaign has already started, is finished or being stopped, or was never launched. The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request. Use a new key for a different request.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "idempotency_replay_unavailable",
    "message": "The exact response for this Idempotency-Key is unavailable. The request was not repeated. Keep the first response and reconcile events or the resource. Waiting does not guarantee replay data becomes available; do not switch keys to resend.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-replay-unavailable"
}
```

## Requeue campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/requeue` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Body

- `includeSkippedError` (boolean). Whether include skipped error.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/requeue" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "includeSkippedError": true
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {}
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Set project campaign reply flow

`PUT https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/reply-flow` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Attaches a reply flow revision to a draft or scheduled campaign, or detaches it with `null`. The flow starts for each recipient once their message is sent.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string (uuid), required, format uuid). Identifier for this resource.

### Body

- `replyFlowId` (string (uuid), required, nullable, format uuid). Reply flow revision to run after replies, or null to detach it.

### Request

```bash
curl -X PUT "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/reply-flow" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "replyFlowId": "00000000-0000-4000-8000-000000000000"
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `replyFlowId` (string (uuid), required, nullable, format uuid). Identifier for the reply flow.

Headers:

- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "replyFlowId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

`missing_scope`, or `feature_unavailable` when campaign reply flows are not enabled for the team.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "missing_scope",
    "message": "The credential lacks a required API scope.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#missing-scope"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: the campaign has already launched.
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Add project campaign recipients

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/recipients` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Adds up to 1,000 recipients to a campaign that has not started sending. A phone already on the campaign is skipped. Invalid entries are reported and not added.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional key, 1 to 255 bytes of UTF-8, that makes this request safe to retry for 24 hours. A retry with the same key, credential, `Polymorfa-Version` and request is not applied again: it returns `200` with `Idempotent-Replayed: true` and the replay result described for this operation. Reusing the key for a different request returns `422 idempotency_conflict`. A retry sent while the original is still running waits for it and then returns its result. A request that failed left no record, so retrying it with the same key runs it again. Access to the resource is checked again on every retry. A replay returns the original counts, even after the campaign has launched.

### Body

- `recipients` (array of object, required, items 1–1000). Recipients associated with this native add campaign recipients request.
  - `phone` (string, required, length 1–64). Phone number in international format, for example `+14155550100`. Spaces, dots, hyphens and parentheses are ignored; a leading `00` is read as `+`.
  - `variables` (object). Template variables for this recipient. At most 50; names use letters, digits, `_`, `.` or `-`; values are stored as strings of at most 1,024 characters.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/recipients" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "recipients": [
    {
      "phone": "string"
    }
  ]
}'
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string, required). Identifier for the campaign.
  - `added` (integer, required). Recipients added by this request.
  - `recipientCount` (integer, required). Recipients on the campaign after this request.
  - `duplicateCount` (integer, required). Valid entries skipped because the phone was repeated in the request or is already on the campaign.
  - `invalidCount` (integer, required). Number of invalids.
  - `invalidRows` (array of object, required, max items 20). Up to 20 invalid entries.
    - `row` (integer, required, min 1). 1-based position of the entry in the request (or spreadsheet row number for a file import, where the header is row 1).
    - `reason` (string, required). Reason for the reported state or outcome. Values: `missing_phone`, `invalid_phone`, `invalid_variables`, `invalid_entry`.

Headers:

- `Idempotent-Replayed` (string). `true` when this response replays the result of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "campaignId": "string",
    "added": 0,
    "recipientCount": 0,
    "duplicateCount": 0,
    "invalidCount": 0,
    "invalidRows": [
      {
        "row": 1,
        "reason": "missing_phone"
      }
    ]
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The campaign has started sending and no longer accepts recipients
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request. Use a new key for a different request.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Export project campaign recipients

`GET https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/recipients/export` (Messaging API)

Required permission: `campaigns:read`

**Required scope:** `campaigns:read`

Returns recipients as CSV in queue order. Unfiltered exports page up to 1,000 recipients per request. Each page starts with a header row. When more recipients match, the `Polymorfa-Next-Cursor` response header carries the cursor for the next page; it is absent on the last page. Each page is read when it is requested, so a recipient appears once, with the outcome it had when its page was read. A filtered export is one atomic page of up to 1,000 recipients; larger filtered results return 409, so changing statuses cannot silently omit matches between pages. The export contains outcomes and `failureReason` codes only, never message content or template variables.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Query parameters

- `status` (string). Current status of this resource or operation. Values: `queued`, `sending`, `sent`, `delivered`, `read`, `failed`, `skipped`.
- `reason` (string). Reason for the reported state or outcome. Values: `opted_out`, `cold_held`, `campaign_cancelled`, `invalid_recipient`, `session_not_connected`, `ack_timeout`, `blocked_by_safety`, `send_failed`, `missing_variable`, `frequency_cap`, `other`.
- `cursor` (string, length 1–256). Specifies cursor for this query parameter.
- `limit` (integer, range 1–1000). Specifies limit for this query parameter.

### Request

```bash
curl "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/recipients/export" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

One page of recipients.

Content type: `text/csv`

Headers:

- `Polymorfa-Next-Cursor` (string). Cursor for the next page. Absent on the last page.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

More than 1,000 recipients match the filter
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

## Launch campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/launch` (Platform API)

Required permission: `campaigns:manage`

Starts a draft campaign. It begins sending at `scheduledAt`, or right away when no start time is set. Launch checks the stored sender selection against live plans: `402 campaigns_not_entitled` when a selected number is missing or its plan does not include Campaigns, or when an unselected campaign's project has no such number; `400 invalid_parameter` on `senderConfig.sessionIds` when a selected number is not connected or the selection mixes sending types; `400 campaign_throughput_capped` when a requested throughput is above its ceiling. A segment campaign requires a team API key or signed-in dashboard session; project tokens answer `403 permission_denied`. Both audience betas must be available, otherwise launch answers `403 feature_unavailable`. An audience change while launch is being authorized answers `409 state_conflict`. Segment evaluation that exceeds its time limit also answers `409 state_conflict`; simplify the rules and retry. A launched campaign whose segment was deleted remains launched and cannot be launched again (`409 state_conflict`). A drip without a sendable composed message answers `400 invalid_parameter` on `messagesArray`. Saving a draft does not apply this check. A composed attachment requires a public `media.url` (`400 invalid_parameter`). The template must be complete (`400 invalid_parameter`) and approved on every Cloud API number (`400 template_not_approved`). Every recipient needs a value or fallback for each variable (`422 campaign_variables_missing`); `skipMissingVariables: true` skips those recipients before the first send. A message that references a `{{link:<key>}}` the campaign does not define, or tracked links on a campaign that would send from Official API numbers, answers `400 invalid_parameter` on `trackedLinks`; tracked links without the campaign link tracking beta answer `403 feature_unavailable`. `409` means the campaign is not a draft, is already launched and waiting for its start time, or its sending numbers changed during the launch. When the team requires approval above a recipient threshold and the launch would send to more recipients, a launch by anyone other than a team owner or admin signed in to the console answers `409 campaign_approval_required`, sends nothing, and records a pending approval request that `GET /platform/campaigns/{campaignId}/approvals` lists. Launching again with the campaign unchanged returns the same request. A launch requested by an AI agent through the hosted MCP server is held the same way, whatever the threshold.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional unique key, 1 to 255 bytes, that makes this request safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version` and request never runs it again while its receipt is retained. Keep the first response. Opaque campaign bodies are not retained by default; an available authorized exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After`; the request does not run again. Missing replay data never releases the execution fence.

### Body

- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.
- `scheduledAt` (number). Scheduled start time in Unix milliseconds. Defaults to the stored start time, or now.
- `skipMissingVariables` (boolean). Launch even when some recipients have no value and no fallback for a variable. Those recipients are skipped with `failureReason` `missing_variable` before the first send. Without it, such a launch answers `422 campaign_variables_missing`.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/launch" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "00000000-0000-4000-8000-000000000000",
  "scheduledAt": 0,
  "skipMissingVariables": true
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `status` (string, required). Current status of this resource or operation. Values: `draft`, `running`, `paused`, `cancelling`, `cancelled`, `completed`, `failed`, `archived`.
  - `operationId` (string (uuid), required, format uuid). The operation that carries this lifecycle action.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "draft",
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 402

`campaigns_not_entitled`: a sending number is missing or its plan does not include Campaigns.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "billing_error",
    "code": "campaigns_not_entitled",
    "message": "This number’s plan does not include Campaigns.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaigns-not-entitled"
}
```

#### 403

`permission_denied`: a project token attempted to launch a segment campaign; use a team API key or signed-in dashboard session. `feature_unavailable`: either audience beta is unavailable for a segment campaign, or the campaign has tracked links and its link tracking beta is unavailable. `bansafe_team_suspended` while the team is suspended.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`campaign_approval_required`: the launch is held for a team owner or admin and nothing was sent; the message names the approval request. `state_conflict`: the campaign is not a draft, is already launched and waiting for its start, its sending numbers or audience changed during launch, or segment evaluation exceeded its time limit (simplify the rules and retry). A launched campaign whose segment was deleted cannot be launched again.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

`campaign_variables_missing`: a recipient or test sample has no value or fallback for a campaign variable; nothing was sent by that request. `idempotency_conflict`: this key belongs to a different request; the earlier request is not run again and this refusal does not establish its outcome.
Same fields as 400.

Headers:

- `Link` (string). Documentation for an Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 503

`idempotency_replay_unavailable`: the recorded response cannot be read. The original request is not run again, and its execution fence remains in place. Keep the first response; do not switch keys to resend. The selected numbers' plans can also fail to be checked (`service_unavailable`), before anything is launched or saved.
Same fields as 400.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Pause campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/pause` (Platform API)

Required permission: `campaigns:manage`

Pauses a running campaign. Sends already in progress can still finish. `409` means the campaign is not running or has no active delivery run to pause.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional unique key, 1 to 255 bytes, that makes this request safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version` and request never runs it again while its receipt is retained. Keep the first response. Opaque campaign bodies are not retained by default; an available authorized exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After`; the request does not run again. Missing replay data never releases the execution fence.

### Body


### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/pause" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `status` (string, required). Current status of this resource or operation. Values: `draft`, `running`, `paused`, `cancelling`, `cancelled`, `completed`, `failed`, `archived`.
  - `operationId` (string (uuid), required, format uuid). The operation that carries this lifecycle action.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "draft",
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`).
Same fields as 401.

Headers:

- `Link` (string). Documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 503

`idempotency_replay_unavailable`: the recorded response cannot be read. The original request is not run again, and its execution fence remains in place. Keep the first response; do not switch keys to resend.
Same fields as 401.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Resume campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/resume` (Platform API)

Required permission: `campaigns:manage`

Resumes a paused campaign. Its remaining recipients are sent after the same checks as before the pause. `409` means the campaign is not paused or has no active delivery run to resume. A request through the hosted MCP server answers `409 campaign_approval_required`, changes nothing, and records an approval request that a team owner or admin approves in the console.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional unique key, 1 to 255 bytes, that makes this request safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version` and request never runs it again while its receipt is retained. Keep the first response. Opaque campaign bodies are not retained by default; an available authorized exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After`; the request does not run again. Missing replay data never releases the execution fence.

### Body


### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/resume" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `status` (string, required). Current status of this resource or operation. Values: `draft`, `running`, `paused`, `cancelling`, `cancelled`, `completed`, `failed`, `archived`.
  - `operationId` (string (uuid), required, format uuid). The operation that carries this lifecycle action.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "draft",
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`).
Same fields as 401.

Headers:

- `Link` (string). Documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 503

`idempotency_replay_unavailable`: the recorded response cannot be read. The original request is not run again, and its execution fence remains in place. Keep the first response; do not switch keys to resend.
Same fields as 401.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Reschedule campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/reschedule` (Platform API)

Required permission: `campaigns:manage`

Moves the start of a launched campaign that is still waiting for it. Set `scheduledAt` to a later or earlier time, or to `null` to start now. The response returns the campaign with its new `scheduledAt`; sending the current start time again changes nothing. A suspended team is refused with `403 bansafe_team_suspended`. `409` means the campaign has already started, is finished or being stopped, or was never launched; launch a draft with `scheduledAt` instead. A request through the hosted MCP server answers `409 campaign_approval_required`, changes nothing, and records an approval request that a team owner or admin approves in the console.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional unique key, 1 to 255 bytes, that makes this request safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version` and request never runs it again while its receipt is retained. Keep the first response. Opaque campaign bodies are not retained by default; an available authorized exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After`; the request does not run again. Missing replay data never releases the execution fence.

### Body

- `scheduledAt` (integer, required, nullable, range 1–8640000000000000). The new start time in Unix milliseconds. `null`, or a time that is not in the future, starts the campaign now.
- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/reschedule" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "scheduledAt": 1
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `status` (string, required). Current status of this resource or operation. Values: `draft`, `running`, `paused`, `cancelling`, `cancelled`, `completed`, `failed`, `archived`.
  - `operationId` (string (uuid), required, format uuid). The operation that carries this lifecycle action.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "draft",
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`).
Same fields as 400.

Headers:

- `Link` (string). Documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 503

`idempotency_replay_unavailable`: the recorded response cannot be read. The original request is not run again, and its execution fence remains in place. Keep the first response; do not switch keys to resend.
Same fields as 400.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Archive campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/archive` (Platform API)

Required permission: `campaigns:manage`

Archives a completed, failed or cancelled campaign. Other states return `409`. A final event pending delivery or an active delivery run also returns `409`; retry after both finish.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

Archive a completed, failed or cancelled campaign. Wait for a stopping
campaign to reach `cancelled` before archiving it.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Body


### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/archive" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {}
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

## Duplicate campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/duplicate` (Platform API)

Required permission: `campaigns:manage`

Creates a new draft from a campaign. Segment campaigns require a team API key or signed-in dashboard session; project tokens answer `403 permission_denied`. Both audience betas must be available, otherwise duplication answers `403 feature_unavailable`. The copy evaluates the saved segment again at launch and never copies its frozen recipients. If the segment was deleted, answers `409 state_conflict`; create a new campaign and choose an audience. An audience change during duplication also answers `409 state_conflict`.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Body


### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/duplicate" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string (uuid), required, nullable, format uuid). Identifier of the message template.
  - `recipientListId` (string (uuid), required, nullable, format uuid). Identifier for the recipient list.
  - `recipientCount` (integer, required, min 0). Number of recipients.
  - `sentCount` (integer, required, min 0). Number of sents.
  - `deliveredCount` (integer, required, min 0). Number of delivereds.
  - `readCount` (integer, required, min 0). Number of reads.
  - `failedCount` (integer, required, min 0). Number of faileds.
  - `skippedCount` (integer, required, min 0). Number of skippeds.
  - `scheduledAt` (integer, required, nullable). Scheduled start in Unix milliseconds.
  - `launchedAt` (integer, required, nullable). Launch time in Unix milliseconds.
  - `completedAt` (integer, required, nullable). Completion time in Unix milliseconds.
  - `createdAt` (integer, required). Creation time in Unix milliseconds.
  - `updatedAt` (integer, required). Last update in Unix milliseconds.
  - `sendWindow` (object, required, nullable). Specifies send window for this management platform campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required). Days associated with this management campaign send window. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required). Hours associated with this management campaign send window.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Whether recipient time zone.
    - `timeZoneVariable` (string, required). Specifies time zone variable for this management campaign send window.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. Unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name. No user name, password or IP address.
  - `variableMapping` (object, nullable, max properties 50). How each content variable is filled; null when the campaign has no mapping.
  - `drip` (object, required, nullable). Specifies drip for this management platform campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`. Default: `"audience"`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps. Default: `true`.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked. Default: `false`.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `followUp` (object, required, nullable). Specifies follow up for this management platform campaign.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this management campaign follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this management campaign follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `composerBlueprint` (any). Specifies composer blueprint for this management platform campaign.
  - `messages` (any). Specifies messages for this management platform campaign.
  - `audienceRef` (any). Specifies audience ref for this management platform campaign.
  - `senderConfig` (any). Specifies sender config for this management platform campaign.
  - `complianceConfig` (any). Specifies compliance config for this management platform campaign.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters after trimming.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). The message this variant sends, in the composed-message format.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). The message text. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). How the A/B test runs; null for a broadcast.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients who receive a variant during the test. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided.
  - `experimentOutcome` (object, required, nullable). The saved A/B result, or null before a decision and for a broadcast.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `messageVariations` (array of object, nullable, items 2–5). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights add up to 100.
    - `blueprint` (object, required). Structured blueprint values for this message variation.
      - `version` (integer, required). Specifies version for this blueprint. Values: `2`.
      - `source` (string, required, length 1–4096). Specifies source for this blueprint.
  - `segmentId` (string (uuid), nullable, format uuid). Saved audience segment the campaign evaluates at launch, or null.
  - `segmentSnapshot` (object, nullable). What launch froze from the segment: its revision, the evaluation time in Unix milliseconds and the matching profile count. Null before a segment launch.
    - `revision` (integer, required, min 1). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required, min 0). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required, min 0). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). This campaign's own contact frequency cap; null when only the team cap applies.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from the team in any rolling 24 hours, 1 to 50. `null` sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from the team in any rolling 7 days, 1 to 200. `null` sets no 7-day limit. Must not be lower than `maxPer24Hours`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "name": "string",
    "status": "string",
    "templateId": "00000000-0000-4000-8000-000000000000",
    "recipientListId": "00000000-0000-4000-8000-000000000000",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "sendWindow": {
      "timeZone": "string",
      "days": [
        "monday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "string"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": false
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "experimentOutcome": {
      "state": "promoted"
    },
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    }
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

## Requeue failed campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/requeue` (Platform API)

Required permission: `campaigns:manage`

Public Management API. Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Body


### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/requeue" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Responses

#### 200

Success
- `data` (any, required). Operation result.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": null
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

## Enroll campaign contact

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/enrollments` (Platform API)

Required permission: `campaigns:manage`

Beta. Adds one contact to a running or paused continuous drip. Requires campaigns:manage and the drip beta; otherwise 403 feature_unavailable. Idempotent per phone, including contacts who completed or exited: returns created=false without changing variables. Opted-out contacts are skipped. A campaign not accepting enrollment answers 409 state_conflict.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Body

- `projectId` (string (uuid), format uuid). Identifier of the Polymorfa project that owns this resource.
- `phone` (string, required, length 1–32). International phone number.
- `variables` (object, max properties 50). Structured variables values for this management enroll campaign contact request.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/enrollments" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "string"
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `recipientId` (string (uuid), required, format uuid). Identifier for the recipient.
  - `phone` (string, required). Phone number in international format.
  - `created` (boolean, required). Whether created.
  - `status` (string, required). Current status of this resource or operation.
  - `enrolledAt` (number, required). Unix milliseconds.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "recipientId": "00000000-0000-4000-8000-000000000000",
    "phone": "string",
    "created": true,
    "status": "string",
    "enrolledAt": 0
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

## Test send campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/test-send` (Platform API)

Requires campaigns:manage and campaigns:read because the test can use stored recipient samples. Sends one copy of a draft campaign's content to a seed recipient, through the same rendering, sending and BanSafe checks as a launched campaign. The seed recipient must be a number connected to your team. The sending number must be connected, on a plan that includes Campaigns and, when the campaign selects numbers, one of them. A test is not a campaign recipient and is not counted in the campaign's statistics or webhooks. A team can send 20 tests an hour, and at most 5 an hour to one seed recipient. `429` means one of these limits was reached or BanSafe is pacing the sending number; follow `Retry-After`. `409 bansafe_cold_held` means the seed recipient has never written to the sending number and the campaign holds first messages. `409 state_conflict` means the campaign is not a draft or has A/B or weighted content alternatives, the sending number is a Hybrid Link number, or the seed recipient opted out. `504 result_unknown` means the outcome was not received in time and the test may still arrive. Send `projectId` in the body when using a team API key. `422 campaign_variables_missing` means the test's sample values, the mapped recipient value and the fallback all leave a variable in the campaign content empty.

Requires `campaigns:manage` and `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional unique key, 1 to 255 bytes, that makes this request safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version` and request never runs it again while its receipt is retained. Keep the first response. Opaque campaign bodies are not retained by default; an available authorized exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After`; the request does not run again. Missing replay data never releases the execution fence.

### Body

- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.
- `sessionId` (string (uuid), required, format uuid). The number to send the test from. It must be connected, on a plan that includes Campaigns and, when the campaign selects numbers, one of them.
- `to` (string, required, length 1–32). The seed recipient in international format. It must be the phone of a number connected to your team.
- `sampleRecipientId` (string (uuid), format uuid). A recipient of this campaign whose variables fill the content. Without it and without `variables`, the campaign's first recipient, or its audience's first member, is the sample.
- `variables` (object, max properties 50). Variable values for the test. They override the sample recipient's values; without `sampleRecipientId`, only these values are used.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/test-send" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "sessionId": "00000000-0000-4000-8000-000000000000",
  "to": "+5511999990000"
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). The test send's ID.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `status` (string, required). Current status of this resource or operation. Values: `sent`.
  - `from` (object, required). The number the test was sent from.
    - `sessionId` (string (uuid), required, format uuid). Identifier of the connected Polymorfa session.
    - `phone` (string, required). Phone number in international format.
  - `to` (string, required). The seed recipient, in E.164 format.
  - `messageId` (string, required, nullable). The WhatsApp message ID, when the send path returned one.
  - `variables` (object, required). The variable values the content was rendered with.
  - `createdAt` (number, required). When the test was admitted, in Unix milliseconds.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "status": "sent",
    "from": {
      "sessionId": "00000000-0000-4000-8000-000000000000",
      "phone": "string"
    },
    "to": "string",
    "messageId": "string",
    "variables": {},
    "createdAt": 0
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 402

`campaigns_not_entitled`: a sending number is missing or its plan does not include Campaigns.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "billing_error",
    "code": "campaigns_not_entitled",
    "message": "This number’s plan does not include Campaigns.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#campaigns-not-entitled"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

`campaign_variables_missing`: a recipient or test sample has no value or fallback for a campaign variable; nothing was sent by that request. `idempotency_conflict`: this key belongs to a different request; the earlier request is not run again and this refusal does not establish its outcome.
Same fields as 400.

Headers:

- `Link` (string). Documentation for an Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 429

A limit was reached. Wait for `Retry-After` before retrying.
Same fields as 400.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before retrying.
- `Polymorfa-RateLimit-Reason` (string). The limit that was reached. See the rate-limit reasons in the error reference.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "The request limit was reached. Follow Retry-After when supplied.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
}
```

#### 502

`upstream_failure`: the messaging provider could not complete the send.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "upstream_error",
    "code": "upstream_failure",
    "message": "The messaging provider could not complete the request.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
```

#### 503

`idempotency_replay_unavailable`: the recorded response cannot be read. The original request is not run again, and its execution fence remains in place. Keep the first response; do not switch keys to resend. The send path can also be unavailable before a send (`session_not_ready`, `command_dispatch_failed`, `service_unavailable`, or `bansafe_accounting_unavailable`).
Same fields as 400.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

#### 504

`result_unknown`: the outcome was not received before the deadline. The message may still arrive; check before repeating the request.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "result_unknown",
    "message": "The result was not obtained before the deadline. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#result-unknown"
}
```

## Set campaign reply flow

`PUT https://api.polymorfa.com/platform/campaigns/{campaignId}/reply-flow` (Platform API)

Required permission: `campaigns:manage`

Attaches a reply flow revision to a draft or scheduled campaign, or detaches it with `null`. The flow starts for each recipient once their message is sent. `409` means the campaign has already launched. Beta: returns `403` unless campaign reply flows are enabled for the team.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Body

- `replyFlowId` (string (uuid), required, nullable, format uuid). Reply flow revision to run after replies, or null to detach it.
- `projectId` (string (uuid), format uuid). Required when using a team API key. Project tokens derive the project from the credential.

### Request

```bash
curl -X PUT "https://api.polymorfa.com/platform/campaigns/<campaignId>/reply-flow" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "replyFlowId": "00000000-0000-4000-8000-000000000000"
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `replyFlowId` (string (uuid), required, nullable, format uuid). Identifier for the reply flow.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "replyFlowId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

## Add campaign recipients

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/recipients` (Platform API)

Required permission: `campaigns:manage`

Adds up to 1,000 recipients to a campaign that has not been launched. A number already on the campaign is skipped. Invalid entries are reported, not added. A campaign that has been launched answers `409`. Send `projectId` in the body when using a team API key.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional key, 1 to 255 bytes of UTF-8, that makes this request safe to retry for 24 hours. A retry with the same key, credential, `Polymorfa-Version` and request is not applied again: it returns `200` with `Idempotent-Replayed: true` and the replay result described for this operation. Reusing the key for a different request returns `422 idempotency_conflict`. A retry sent while the original is still running waits for it and then returns its result. A request that failed left no record, so retrying it with the same key runs it again. Access to the resource is checked again on every retry. A replay returns the original counts, even after the campaign has launched.

### Body

- `projectId` (string (uuid), format uuid). Identifier of the Polymorfa project that owns this resource.
- `recipients` (array of object, required, items 1–1000). At most 1,000 recipients per request.
  - `phone` (string, required, length 1–64). Number in international format, for example `+14155550100`. Spaces, dots, hyphens and parentheses are ignored; a leading `00` is read as `+`; digits without `+` are read as including the country code.
  - `variables` (object, max properties 50). Template variables. Names use letters, digits, `_`, `.` or `-` (at most 64 characters). Values are stored as strings.

### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/recipients" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{
  "recipients": [
    {
      "phone": "string"
    }
  ]
}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `campaignId` (string (uuid), required, format uuid). Identifier for the campaign.
  - `added` (integer, required, min 0). Specifies added for this management campaign recipient append result.
  - `recipientCount` (integer, required, min 0). Number of recipients.
  - `duplicateCount` (integer, required, min 0). Valid entries skipped because the number was repeated or is already on the campaign.
  - `invalidCount` (integer, required, min 0). Number of invalids.
  - `invalidRows` (array of object, required, max items 20). Invalid rows associated with this management campaign recipient append result.
    - `row` (integer, required, min 1). 1-based entry position for inline input; spreadsheet row number for a file, where the header is row 1.
    - `reason` (string, required). Reason for the reported state or outcome. Values: `missing_phone`, `invalid_phone`, `invalid_variables`, `invalid_entry`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response replays the result of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "campaignId": "00000000-0000-4000-8000-000000000000",
    "added": 0,
    "recipientCount": 0,
    "duplicateCount": 0,
    "invalidCount": 0,
    "invalidRows": [
      {
        "row": 1,
        "reason": "missing_phone"
      }
    ]
  }
}
```

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`).
Same fields as 400.

Headers:

- `Link` (string). Documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

## Export campaign recipients

`GET https://api.polymorfa.com/platform/campaigns/{campaignId}/recipients/export` (Platform API)

Required permission: `campaigns:read`

Returns recipients as CSV in queue order. Unfiltered exports page up to 1,000 recipients per request, using the `Polymorfa-Next-Cursor` response header. Each page starts with a header row and reflects outcomes when requested. Filtered exports are one atomic page of up to 1,000 recipients; larger filtered results return 409, so changing statuses cannot silently omit matches between pages. The export contains outcomes and `failureReason` codes only, never message content or template variables.

Requires `campaigns:read`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string (uuid), format uuid). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.
- `status` (string). Current status of this resource or operation. Values: `queued`, `sending`, `sent`, `delivered`, `read`, `failed`, `skipped`.
- `reason` (string). Only recipients whose `failureReason` is this code. Values: `opted_out`, `cold_held`, `campaign_cancelled`, `invalid_recipient`, `session_not_connected`, `ack_timeout`, `blocked_by_safety`, `send_failed`, `missing_variable`, `frequency_cap`, `other`.
- `cursor` (string, length 1–256). Specifies cursor for this query parameter.
- `limit` (integer, range 1–1000). Specifies limit for this query parameter. Default: `1000`.

### Request

```bash
curl "https://api.polymorfa.com/platform/campaigns/<campaignId>/recipients/export" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

One CSV page.

Content type: `text/csv`

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Polymorfa-Next-Cursor` (string). Cursor for the next page. Absent on the last page.

#### 400

A path, query, or request-body value did not pass validation.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing/invalid credential for this audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 400.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

## Stop project campaign

`POST https://api.polymorfa.com/messaging/projects/{projectSlug}/campaigns/{id}/stop` (Messaging API)

Required permission: `campaigns:manage`

**Required scope:** `campaigns:manage`

Cancels a draft, running, or paused campaign. Recipients not yet sent are not sent. The campaign moves to `cancelling` and then to `cancelled` once sends already in progress finish; a campaign with no active delivery run is `cancelled` immediately.

### Path parameters

- `projectSlug` (string, required). Specifies project slug for this path parameter.
- `id` (string, required). Identifier for this resource.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Unique key, 1 to 255 bytes of UTF-8, that makes this write safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version`, and request never runs the write again while its receipt is retained. Keep the first response. Exact response replay requires authorized replay data; opaque message or campaign bodies are not retained by default. An available exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After` and the write still does not run again.

### Request

```bash
curl -X POST "https://api.polymorfa.com/messaging/projects/<projectSlug>/campaigns/<id>/stop" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

OK
- `success` (boolean, required). Whether the request succeeded. Values: `true`.
- `data` (object, required). Structured data carried by this object.
  - `id` (string, required). Identifier for this resource.
  - `name` (string, required). Human-readable name for this resource.
  - `status` (string, required). Current status of this resource or operation.
  - `templateId` (string, required, nullable). Template the campaign sends. When set, the template replaces composed messages.
  - `variableMapping` (object, nullable, max properties 50). How each `{{variable}}` in the campaign's template or composed messages is filled, keyed by the variable name used in the content. At most 50 entries. A variable is filled from the recipient's value, then `fallback`, then an inline `{{name | fallback}}` written in a composed message. A recipient with none of them is refused at launch (`campaign_variables_missing`) or, when launched with `skipMissingVariables`, skipped with `missing_variable`. Null when the campaign has no mapping.
  - `messageVariations` (array of object, nullable). Weighted message alternatives, or null when the campaign sends one message.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the alternative, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `weight` (integer, required, range 1–99). Share of recipients who receive this alternative, in percent. The weights of all alternatives add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign message variation.
      - `version` (integer, required). Specifies version for this native campaign message variation blueprint.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. Every alternative must use the same `{{variable}}` placeholders and inline fallbacks.
  - `recipientListId` (string, required, nullable). Identifier for the recipient list.
  - `recipientCount` (number, required). Number of recipients.
  - `sentCount` (number, required). Number of sents.
  - `deliveredCount` (number, required). Number of delivereds.
  - `readCount` (number, required). Number of reads.
  - `failedCount` (number, required). Number of faileds.
  - `skippedCount` (number, required). Number of skippeds.
  - `scheduledAt` (number, required, nullable). Unix timestamp in milliseconds when this operation is scheduled to start.
  - `launchedAt` (number, required, nullable). Unix timestamp in milliseconds when this campaign launched.
  - `completedAt` (number, required, nullable). Unix timestamp in milliseconds when this operation completed.
  - `createdAt` (number, required). Unix timestamp in milliseconds when this resource was created.
  - `updatedAt` (number, required). Unix timestamp in milliseconds when this resource was last updated.
  - `variants` (array of object, nullable). The A/B variants; null for a broadcast.
    - `key` (string, required, pattern ^[a-z][a-z0-9_-]{0,15}$). Identifier of the variant, unique in the campaign: a lowercase letter, then up to 15 lowercase letters, digits, `_` or `-`.
    - `label` (string, required, length 1–100). Name shown in results, 1 to 100 characters.
    - `weight` (integer, required, range 1–99). Share of the test group that receives this variant, in percent. The weights of all variants add up to 100.
    - `blueprint` (object, required). Specifies blueprint for this native campaign variant.
      - `version` (integer, required). Specifies version for this native campaign variant message.
      - `source` (string, required, length 1–4096). The message text, 1 to 4,096 characters. `{{variable}}` placeholders are filled per recipient, as in composed messages.
  - `variantStrategy` (object, nullable). Specifies variant strategy for this native campaign.
    - `winnerCriterion` (string, required). The outcome that decides the winner: the share of sent test messages that were delivered, read or replied to by the test deadline. Values: `delivery`, `read`, `reply`.
    - `holdoutPercent` (integer, required, range 0–30). Percent of recipients, 0 to 30, who receive no message. They are marked `skipped` with `lastError` `experiment_holdout` at launch.
    - `testSlicePercent` (integer, range 5–50). Percent of recipients, 5 to 50, who receive a variant during the test. Defaults to 20. The rest, the reserve, wait for the winner. Default: `20`.
    - `autoPromote` (boolean, required). Must be `true`: after the test window the winner is sent to the reserve automatically. Values: `true`.
    - `testWindowMinutes` (integer, required, range 15–1440). Minutes from the start of sending until the test is decided, 15 to 1,440.
  - `experimentOutcome` (object, required, nullable). Specifies experiment outcome for this native campaign.
    - `state` (string, required). Current lifecycle state of this resource. Values: `promoted`, `inconclusive`.
    - `winnerKey` (string). The winning variant's `key`; only when `state` is `promoted`.
    - `reason` (string). Only when `state` is `inconclusive`. Values: `insufficient_evidence`.
  - `followUp` (object, required, nullable). One optional follow-up, sent from the Number that sent the first message. Null when the campaign has none. Content and timing freeze at launch.
    - `delaySeconds` (integer, range 60–604800). Specifies delay seconds for this follow up. Default: `86400`.
    - `expirySeconds` (integer, range 86400–2592000). Specifies expiry seconds for this follow up. Default: `604800`.
    - `message` (object, required). Human-readable message associated with this result.
      - One of:
        - `text` (object).
          - `type` (string, required). Type discriminator for this object. Values: `text`.
          - `text` (string, required, length 1–16384). Text content carried by this object.
        - `template` (object).
          - `type` (string, required). Type discriminator for this object. Values: `template`.
          - `templateId` (string (uuid), required, format uuid). Identifier of the message template.
  - `sendWindow` (object, required, nullable). Specifies send window for this native campaign.
    - `timeZone` (string, required). IANA time zone the window is written in.
    - `days` (array of string, required, items 1–7, unique items). Weekdays the campaign may send on, in the window's time zone. At least one; no repeats. Values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
    - `hours` (array of object, required, items 1–4). Local time ranges the campaign may send in on those days, at most 4. Ranges must not overlap. A range cannot cross midnight; use two ranges instead.
      - `start` (string, required, pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$). Local start time, `HH:MM` in 24-hour time, inclusive.
      - `end` (string, required, pattern ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$). Local end time, `HH:MM` in 24-hour time or `24:00`, exclusive. Must be later than `start`.
    - `recipientTimeZone` (boolean, required). Evaluate the window in each recipient's own time zone. The zone comes from the recipient variable named by `timeZoneVariable` when it holds a valid IANA zone, otherwise from the phone number's country when that country uses one UTC offset, otherwise `timeZone`.
    - `timeZoneVariable` (string, required, pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$). Recipient variable holding the recipient's IANA time zone, used when `recipientTimeZone` is true.
  - `trackedLinks` (array of object, required). Tracked links the messages reference as `{{link:<key>}}`. Empty when the campaign tracks none.
    - `key` (string, required, pattern ^[a-z0-9_]{1,32}$). Name the message uses as `{{link:<key>}}`. 1 to 32 lowercase letters, digits or underscores, unique within the campaign.
    - `url` (string, required, length 1–2048). Destination: an absolute `https` URL with a public domain name, at most 2048 characters. No user name, password or IP address.
  - `drip` (object, required, nullable). Specifies drip for this native campaign.
    - `enrollment` (string, required). Select `audience` for contacts present at launch. Select `continuous` to also accept contacts through the enrollment endpoint while the campaign is running or paused. Setting a continuous drip back to `audience` closes enrollment; the campaign completes after all enrolled contacts finish. Values: `audience`, `continuous`.
    - `exitOnReply` (boolean, required). When true, a contact who replies to the sending number gets no further steps.
    - `exitOnLinkClick` (boolean, required). When true, a GET request to one of the campaign's tracked links stops the contact's remaining steps. HEAD requests do not count. GET requests from link previews and security scanners also count and do not prove that a person clicked.
  - `enrollmentOpen` (boolean, required, nullable). Whether the drip is configured for continuous enrollment. Null for a non-drip. Enrollment also requires running or paused status.
  - `pauseReason` (string, required, nullable). Current stored pause reason while paused; null when unavailable, for a manual pause without a reason, or for any other status.
  - `segmentId` (string, nullable). Saved audience segment the campaign evaluates at launch, or null. Segments are chosen with a team API key through the Platform API; this field is read-only here.
  - `segmentSnapshot` (object, nullable). The segment revision, evaluation time (Unix milliseconds) and matching profile count launch froze; null before a segment launch.
    - `revision` (integer, required). Segment revision that launch evaluated.
    - `evaluatedAt` (integer, required). Time launch evaluated the segment, in Unix milliseconds.
    - `matchedCount` (integer, required). Profiles that matched at launch, before opt-outs and withheld consent were removed.
  - `frequencyCap` (object, required, nullable). Specifies frequency cap for this native campaign.
    - `maxPer24Hours` (integer, required, nullable, range 1–50). Most campaign messages one phone number receives from your team in any rolling 24 hours, 1 to 50. Null sets no 24-hour limit.
    - `maxPer7Days` (integer, required, nullable, range 1–200). Most campaign messages one phone number receives from your team in any rolling 7 days, 1 to 200. Null sets no 7-day limit. Must not be lower than `maxPer24Hours`.
  - `operationId` (string (uuid), required, nullable, format uuid). The operation that stops the campaign. Null when the campaign had no active delivery run: it was cancelled immediately and none of its remaining recipients are sent.

Headers:

- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.
- `X-RateLimit-Limit` (integer, min 1). Team request quota per rolling minute, when the per-team request limiter applies.
- `X-RateLimit-Remaining` (integer, min 0). Requests left in the per-team quota; zero when this limiter rejects the request.
- `X-RateLimit-Reset` (integer, min 0). Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.

```json
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "status": "string",
    "templateId": "string",
    "recipientListId": "string",
    "recipientCount": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "readCount": 0,
    "failedCount": 0,
    "skippedCount": 0,
    "scheduledAt": 0,
    "launchedAt": 0,
    "completedAt": 0,
    "createdAt": 0,
    "updatedAt": 0,
    "experimentOutcome": {
      "state": "promoted"
    },
    "followUp": {
      "message": {
        "type": "text",
        "text": "string"
      }
    },
    "sendWindow": {
      "timeZone": "America/Sao_Paulo",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ],
      "hours": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ],
      "recipientTimeZone": true,
      "timeZoneVariable": "timeZone"
    },
    "trackedLinks": [
      {
        "key": "offer",
        "url": "https://example.com/spring-sale"
      }
    ],
    "drip": {
      "enrollment": "audience",
      "exitOnReply": true,
      "exitOnLinkClick": true
    },
    "enrollmentOpen": true,
    "pauseReason": "string",
    "frequencyCap": {
      "maxPer24Hours": 1,
      "maxPer7Days": 1
    },
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 400

Bad request — request body or params failed validation
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable machine-readable code for this result. Values: `zero_knowledge_session`, `invalid_parameter`, `invalid_credential`, `entitlement_required`, `gate_limit_reached`, `billing_credit_required`, `addon_required`, `safe_mode_not_entitled`, `warmup_plan_not_entitled`, `method_not_allowed`, `permission_denied`, `missing_scope`, `resource_not_found`, `hms_not_enabled`, `media_fetch_failed`, `resource_gone`, `feature_unavailable`, `stream_cursor_invalid`, `stream_cursor_expired`, `stream_connection_limit_reached`, `state_conflict`, `team_deletion_scheduled`, `hybrid_choice_required`, `hybrid_group_linked_devices_unavailable`, `terms_acceptance_required`, `terms_activation_blocked`, `idempotency_conflict`, `idempotency_in_progress`, `idempotency_outcome_unknown`, `idempotency_replay_unavailable`, `call_claimed`, `call_not_ringing`, `connection_limit`, `unsupported_for_connection`, `call_permission_required`, `invalid_sip_trunk`, `calls_disabled`, `call_recipient_opted_out`, `call_destination_blocked`, `call_permission_request_limited`, `call_permission_granted`, `call_opt_out_limit`, `number_restricted`, `sip_trunk_in_use`, `sip_trunk_revision_conflict`, `sip_trunk_limit`, `sip_unavailable`, `voice_not_enabled`, `provider_credential_invalid`, `provider_unavailable`, `asset_not_ready`, `voice_asset_in_use`, `voice_asset_revision_conflict`, `voice_unavailable`, `rate_limit_exceeded`, `internal_error`, `operation_not_supported`, `upstream_failure`, `service_unavailable`, `credential_verification_unavailable`, `session_not_ready`, `command_dispatch_failed`, `result_unknown`, `parent_bsuid_not_supported`, `recipient_not_on_whatsapp`, `conversation_window_closed`, `template_not_approved`, `media_too_large`, `whatsapp_rate_limited`, `new_chat_limit_reached`, `marketing_disabled_on_cloud_api`, `whatsapp_account_restricted`, `whatsapp_authorization_required`, `whatsapp_payment_method_required`, `whatsapp_number_not_registered`, `bansafe_suspended`, `bansafe_team_suspended`, `bansafe_cold_blocked`, `bansafe_cold_held`, `bansafe_throttled`, `bansafe_daily_allowance_reached`, `bansafe_accounting_unavailable`, `bansafe_send_outcome_unknown`, `campaigns_not_entitled`, `campaign_throughput_capped`, `campaign_approval_required`, `campaign_approval_stale`, `campaign_variables_missing`.
  - `message` (string, required). Human-readable message associated with this result.
  - `param` (string, required, nullable). Specifies param for this error.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Specifies docs for this native public error.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 401

Missing or invalid authentication token
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but not permitted (missing scope or rule violation)
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

Resource not found
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

`state_conflict`: The campaign is already finished or cancelled. The Idempotency-Key belongs to a request that is still running (`idempotency_in_progress`, with Retry-After) or whose outcome was not recorded (`idempotency_outcome_unknown`)
Same fields as 400.

Headers:

- `Retry-After` (integer, min 0). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available. Same-key retries are protected only within the one-hour receipt window.
- `Link` (string). Link to the documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`)
Same fields as 400.

Headers:

- `Link`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request. Use a new key for a different request.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-conflict"
}
```

#### 500

Internal server error
Same fields as 400.

Headers:

- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected service failure occurred. Keep the request ID for support.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#internal-error"
}
```

#### 503

For `idempotency_replay_unavailable` only: the exact response for this Idempotency-Key is unavailable (with Retry-After). Opaque responses are not retained by default. The write did not run again. Keep the first response and reconcile events or the resource; waiting does not guarantee that replay data becomes available. Do not switch keys to resend
Same fields as 400.

Headers:

- `Retry-After`: described under 409.
- `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "idempotency_replay_unavailable",
    "message": "The exact response for this Idempotency-Key is unavailable. The request was not repeated. Keep the first response and reconcile events or the resource. Waiting does not guarantee replay data becomes available; do not switch keys to resend.",
    "param": null
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#idempotency-replay-unavailable"
}
```

## Stop campaign

`POST https://api.polymorfa.com/platform/campaigns/{campaignId}/stop` (Platform API)

Required permission: `campaigns:manage`

Cancels a draft, running or paused campaign. Recipients not yet sent are not sent. The campaign moves to `cancelling` and then to `cancelled` once sends already in progress finish; a campaign with no active delivery run is `cancelled` immediately and `operationId` is null. `409` means the campaign is already finished or cancelled.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Header parameters

- `Idempotency-Key` (string, length 1–255). Optional unique key, 1 to 255 bytes, that makes this request safe to retry for 1 hour. A retry with the same key, credential, `Polymorfa-Version` and request never runs it again while its receipt is retained. Keep the first response. Opaque campaign bodies are not retained by default; an available authorized exact replay carries `Idempotent-Replayed: true`. Authorization, rate-limit and state refusals (401, 403, 408, 409, 423, 425, 429) are not recorded, so the same key can retry them. Reusing the key for a different request returns `422 idempotency_conflict`. A retry while the original is still running returns `409 idempotency_in_progress`, and a retry after an unrecorded outcome returns `409 idempotency_outcome_unknown`. If the recorded response cannot be read, the retry returns `503 idempotency_replay_unavailable` with `Retry-After`; the request does not run again. Missing replay data never releases the execution fence.

### Body


### Request

```bash
curl -X POST "https://api.polymorfa.com/platform/campaigns/<campaignId>/stop" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `id` (string (uuid), required, format uuid). Identifier for this resource.
  - `status` (string, required). Current status of this resource or operation. Values: `draft`, `running`, `paused`, `cancelling`, `cancelled`, `completed`, `failed`, `archived`.
  - `operationId` (string (uuid), required, nullable, format uuid). The operation that stops the campaign. Null when the campaign had no active delivery run and was cancelled immediately.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.
- `Idempotent-Replayed` (string). `true` when this response is the recorded response of an earlier request with the same Idempotency-Key. Values: `true`.

```json
{
  "data": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "draft",
    "operationId": "00000000-0000-4000-8000-000000000000"
  }
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```

#### 422

The Idempotency-Key was already used for a different request (`idempotency_conflict`).
Same fields as 401.

Headers:

- `Link` (string). Documentation for this Idempotency-Key error (`rel="describedby"`).
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Correct the invalid request field.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
```

#### 503

`idempotency_replay_unavailable`: the recorded response cannot be read. The original request is not run again, and its execution fence remains in place. Keep the first response; do not switch keys to resend.
Same fields as 401.

Headers:

- `Retry-After` (integer, min 1). Seconds to wait before checking again with the same key. Waiting does not release the execution fence or guarantee that replay data becomes available.
- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "A required service is unavailable. Check completion before repeating a write.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#service-unavailable"
}
```

## Delete campaign

`DELETE https://api.polymorfa.com/platform/campaigns/{campaignId}` (Platform API)

Required permission: `campaigns:manage`

Deletes a draft, completed, failed, cancelled or archived campaign. Any other campaign is refused with `409`; stop it first. A completed or failed campaign with a final event pending delivery or an active delivery run is also refused with `409`; retry after both finish.

Requires `campaigns:manage`. Project tokens only access resources in their own project.

### Path parameters

- `campaignId` (string, required). Identifier for the campaign.

### Query parameters

- `projectId` (string). Project the campaign belongs to. Required with a team API key; a project token is bound to its own project and omits it.

### Request

```bash
curl -X DELETE "https://api.polymorfa.com/platform/campaigns/<campaignId>" \
  -H "Authorization: Bearer <POLYMORFA_API_KEY>" \
  -H "Polymorfa-Version: 2026-09-22"
```

### Responses

#### 200

Success
- `data` (object, required). Structured data carried by this object.
  - `removed` (boolean, required). Whether removed. Values: `true`.

Headers:

- `X-Request-Id` (string). Stable request correlation identifier.
- `X-Trace-Id` (string, pattern ^[0-9a-f]{32}$). W3C trace ID of this request. Your `traceparent` trace ID when you sent a valid one.
- `Polymorfa-Version` (string). API version applied to this response.

```json
{
  "data": {
    "removed": true
  }
}
```

#### 401

Missing/invalid credential for this audience.
- `error` (object, required). Error details returned when the operation fails.
  - `type` (string, required). Type discriminator for this object. Values: `invalid_request_error`, `authentication_error`, `permission_error`, `billing_error`, `conflict_error`, `rate_limit_error`, `api_error`, `upstream_error`.
  - `code` (string, required). Stable failure code. Use this value for programmatic handling.
  - `message` (string, required). Safe explanation of the failure.
  - `param` (string, required, nullable). Invalid request field, or null when no field applies.
  - `request_id` (string, required). Matches the X-Request-Id response header. Include it when you contact support.
  - `request_log_url` (string (uri), format uri). Console page that shows this request. Returned only to team and project credentials whose request was logged.
- `data` (string, required, nullable). Always null for a failed request.
- `docs` (string (uri), required, format uri). Documentation link to this failure code.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_credential",
    "message": "Supply a valid credential.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}
```

#### 403

Authenticated but lacks the required scope/role/audience.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "permission_error",
    "code": "permission_denied",
    "message": "The credential does not have access to this resource.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
```

#### 404

The requested resource was not found inside the authenticated team or project scope.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The resource is unavailable to this caller.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
```

#### 409

The request conflicts with the resource's current state.
Same fields as 401.

Headers:

- `X-Request-Id`, `X-Trace-Id`, `Polymorfa-Version`: described under 200.

```json
{
  "error": {
    "type": "conflict_error",
    "code": "state_conflict",
    "message": "The request conflicts with the resource state.",
    "param": null,
    "request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
  },
  "data": null,
  "docs": "https://docs.polymorfa.com/api/errors#state-conflict"
}
```
