---
title: "Campaign event"
method: POST
path: "campaignEvent"
---

# Campaign event

`POST campaignEvent` (webhook)

Campaign lifecycle events, POSTed to your **tenant webhook endpoint** —
configured by MyStars on request, together with the event types it
receives — and never to a per-order `callback_url`. The body is the
tenant event envelope; `data.campaign_id` names the campaign.
`campaign.recipient.delivered` and `campaign.recipient.failed` are sent
only when your endpoint subscribes to them; `campaign.recipient.failed`
is not sent for recipients skipped `insufficient_payment` or
`campaign_cancelled` (see the event schema).

Verify `X-Faas-Signature-V2` (see **Tenant event webhooks** in the
overview), dedupe on `id` (also in `X-Faas-Event-Id`) and respond `2xx`
within 5 seconds (connect, headers and body each; every attempt ends
after 10 seconds in total). Redirects are not followed. Delivery is
at-least-once: a `5xx`, a `3xx`, a timeout, a connection error, `408`
or `429` is retried with exponential backoff — 30 seconds, doubling, at
most one hour between attempts — for up to 15 attempts, about 8 hours
from the first to the last. Any other `4xx` stops delivery of that
event at once. A stopped or exhausted event is not redelivered
automatically; once your endpoint is fixed, MyStars support can replay
it (events are kept for 30 days). An event whose type your endpoint is
not subscribed to when it is sent is dropped, not held.

**No ordering guarantee.** Events are sent concurrently and each one is
retried on its own schedule, so they can arrive in any order — even
two events of the same campaign, giveaway or series. Order by
`created_at`, and for `campaign.progress` by `sequence`.

## Headers

- `X-Faas-Signature-V2` string, required
- `X-Faas-Signature` string, required
- `X-Faas-Event-Id` string, uuid, required
- `X-Faas-Event-Type` string, required

## Payload

- union: A `campaign.*` event; `type` selects the `data` shape.
  - CampaignValidatedEvent: A validation round finished (no recipient is pending).
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.validated', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `round` integer
      - `recipients` CampaignVerdictCounts
        - `total` integer, required
        - `pending` integer, required
        - `ok` integer, required
        - `unverified` integer, required
        - `rejected` integer, required
      - `by_reason` ReasonCounts: Count per reason.
  - CampaignPaidEvent: The payment was detected.
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.paid', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `payment_tx` string
      - `received_amount` string
      - `received_amount_smallest_unit` string
      - `currency` 'ton' | 'usdt_ton': The asset the order is paid in. `ton` = the native coin GRAM (ex TON), sent as a plain transfer — it is not USDT on TON. `usdt_ton` = USDT (TON), sent as a jetton transfer. Required on every create and pricing request: a request without it is rejected with `400 bad_request`.
      - `recipient_count` integer
      - `max_deliverable` integer
      - `underpaid` boolean
      - `overpaid` boolean
  - CampaignProgressEvent: Delivery progress, at most one per minute per campaign; carries `sequence`.
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.progress', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `delivered` integer
      - `failed` integer
      - `skipped` integer
      - `queued` integer
      - `pending` integer
      - `status` 'draft' | 'awaiting_payment' | 'paid' | 'running' | 'paused' | 'cancelling' | 'settling' | 'awaiting_approval' | 'completed' | 'cancelled' | 'expired' | 'failed': `draft` (recipients can be added and are validated) → `awaiting_payment` (list and price locked by confirm) → `paid` → `running` ⇄ `paused` → `settling` → `completed`. Cancelling after payment goes through `cancelling` → `settling` → `cancelled`. `awaiting_approval` means the settlement owes a reversal that is waiting for review. `expired`: an unpaid campaign whose payment window ended, or a draft not confirmed within 7 days of its creation (`reason: draft_expired`). `failed`: the payment funded no recipient (fully reversed). Terminal: `completed`, `cancelled`, `expired`, `failed`.
  - CampaignPausedEvent: Sending paused — by you (`tenant`) or because the live cost moved above the locked price (`cost_guard`).
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.paused', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `reason` 'tenant' | 'cost_guard'
  - CampaignFinishedEvent: The campaign finished: `campaign.completed`, `campaign.failed` (the payment funded nobody), or `campaign.cancelled`. A campaign cancelled after payment sends it once settlement is done (with the final counts and the reversal); one cancelled before payment sends only `status` and `paid: false`.
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.completed' | 'campaign.cancelled' | 'campaign.failed', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `delivered` integer
      - `failed` integer
      - `skipped` integer
      - `queued` integer
      - `pending` integer
      - `status` 'completed' | 'cancelled' | 'failed'
      - `paid` boolean: `false` on a cancel before payment.
      - `failure_reason` string, nullable
      - `recipient_count` integer, nullable
      - `excluded` integer
      - `currency` 'ton' | 'usdt_ton': The asset the order is paid in. `ton` = the native coin GRAM (ex TON), sent as a plain transfer — it is not USDT on TON. `usdt_ton` = USDT (TON), sent as a jetton transfer. Required on every create and pricing request: a request without it is rejected with `400 bad_request`.
      - `received_amount` string
      - `reversal_amount` string, nullable: What was sent back (`"0"` when nothing was owed or it was below the dust threshold).
      - `reversal_skip_reason` 'dust' | 'null', nullable
      - `reversal_tx` string, nullable: The transaction hash of the reversal; `null` while none has gone out, or when it was confirmed without a reference we can show (contact support). Never a placeholder (since 2.1.3).
  - CampaignExpiredEvent: An unpaid campaign's payment window ended, or a draft was never confirmed (`reason: draft_expired`).
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.expired', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `status` 'expired'
      - `reason` 'draft_expired'
  - CampaignRecipientEvent: One recipient was delivered (`campaign.recipient.delivered`) or did not get the item (`campaign.recipient.failed`, with `reason`). Opt-in — sent only when your endpoint subscribes. `campaign.recipient.failed` covers rows that end `failed`, and rows `skipped` one by one while sending: a refusal by the live check, an opt-out, a frequency cap, a send-time refusal by Telegram (`privacy_restricted`, `bot`, `gifts_disallowed`, `recipient_unreachable`), `internal_error` or `gift_sold_out`. It is NOT sent for rows skipped in bulk: `insufficient_payment` (see `max_deliverable` in `campaign.paid`) and `campaign_cancelled` (see the counts in `campaign.cancelled`). For the per-recipient list, page `GET /v1/campaigns/{id}/recipients?status=skipped`.
    - `id` string, uuid, required: The event id, identical on every attempt — dedupe on it.
    - `type` 'campaign.recipient.delivered' | 'campaign.recipient.failed', required: The event type, for example `campaign.paid`.
    - `created_at` string, date-time, required: When the event happened. Order events by it.
    - `api_version` string, required: The contract version the payload follows.
    - `sequence` integer: `campaign.progress` only: increases with every progress event of a campaign.
    - `data` object, required
      - `campaign_id` string, uuid, required
      - `username` string, nullable
      - `order_id` string, uuid, nullable
      - `reason` 'privacy_restricted' | 'recipient_unreachable' | 'gift_sold_out' | 'message_refused' | 'message_suppressed' | 'campaign_cancelled' | 'internal_error' | 'insufficient_payment' | 'duplicate_active_campaign' | 'recipient_frequency_capped' | 'not_found' | 'not_a_user' | 'bot' | 'ineligible' | 'already_subscribed' | 'opted_out' | 'gifts_disallowed' | 'limited_gifts_disallowed' | 'unlimited_gifts_disallowed', nullable: Why a deliverable recipient was not delivered, or how a delivery went: - `recipient_unreachable` — the recipient could not be reached (refused, privacy, or already reached by another campaign). - `gift_sold_out` — the gift sold out; the rest of the campaign is skipped and its value returned. - `message_refused` — delivered, but Telegram refused the comment, so the gift went without it. - `message_suppressed` — delivered without the comment after Telegram refused it three times in this campaign. - `campaign_cancelled` — not yet sent when the campaign was cancelled. - `insufficient_payment` — beyond the recipients the payment funded. - `internal_error` — a failure on our side. - `privacy_restricted` — `star_gift`: the recipient's privacy settings refused the gift when it was sent (skipped; its value is returned at settlement). - Any validation reason (for example `not_found`, `already_subscribed`, `recipient_frequency_capped`) when the live check just before sending refused the recipient, and `opted_out` when the recipient opted out after validation.

## Acknowledgement `200`

Acknowledged. Any 2xx stops retries.

---

[API](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api.md) - [All operations](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/revisions/b6cdc8aff8c2?raw)
