Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

Campaigns HTTP API

GET/api/v1/projects/{project_id}/campaigns/{campaign_id}/stats

get_campaign_stats

Reads where a campaign’s sending is: its status, how many recipients its launch wrote, and its deliveries by status (queued, deferred, sent, bounced, failed, suppressed, cancelled, and total), counted from the deliveries now, and its opens and clicks (total: every hit, unique: the distinct subscribers).

Call it
to follow a launched campaign or to see how it ended; a draft’s counts are zero.
Needs
the campaign’s id and an admin key with project_id, or a project key with scope read (its own project; the argument is ignored; another project’s campaign is not_found). Changes nothing.
Returns
the same as GET /api/v1/projects/{project_id}/campaigns/{campaign_id}/stats.

Arguments

  • object
  • campaign_idstring · uuidrequired

    The campaign’s id, as create_campaign or list_campaigns gave it.

  • project_idstring · uuid | null

    The campaign’s project. An admin key must pass it; a project key’s own project is used and this is ignored.

No other arguments are accepted.

Result

The result comes back as structuredContent, with the same JSON as a text block.

  • object · all fields required
  • campaign_idstring · uuid
  • Its clicks: follows of its tracked links (message.clicked).

    2 fields
    • CampaignEventCounts object · all fields required
    • totalinteger · uint64

      Every event, repeats included.

      ≥ 0

    • uniqueinteger · uint64

      The distinct subscribers of those events.

      ≥ 0

  • Its deliveries by status.

    8 fields
    • CampaignDeliveryCounts object · all fields required
    • bouncedinteger · uint64

      Refused for good at RCPT (a hard bounce).

      ≥ 0

    • cancelledinteger · uint64

      Not sent: the campaign was cancelled.

      ≥ 0

    • deferredinteger · uint64

      Refused for now; tried again later.

      ≥ 0

    • failedinteger · uint64

      Refused for good otherwise, out of attempts, or not made.

      ≥ 0

    • queuedinteger · uint64

      Waiting for their first attempt.

      ≥ 0

    • sentinteger · uint64

      Taken by the recipient’s server.

      ≥ 0

    • suppressedinteger · uint64

      Held back by a suppression or the subscriber’s status.

      ≥ 0

    • totalinteger · uint64

      Every delivery: the sum of the above.

      ≥ 0

  • Its opens: loads of the open pixel (message.opened).

    2 fields
    • CampaignEventCounts object · all fields required
    • totalinteger · uint64

      Every event, repeats included.

      ≥ 0

    • uniqueinteger · uint64

      The distinct subscribers of those events.

      ≥ 0

  • statusstring

    The campaign’s status now.

  • total_recipientsinteger · uint64 | null

    How many recipients its launch wrote; null before the launch.

    ≥ 0

Definitions

CampaignDeliveryCounts

How many deliveries of a campaign are in each status; all zero before the launch.

  • object · all fields required
  • bouncedinteger · uint64

    Refused for good at RCPT (a hard bounce).

    ≥ 0

  • cancelledinteger · uint64

    Not sent: the campaign was cancelled.

    ≥ 0

  • deferredinteger · uint64

    Refused for now; tried again later.

    ≥ 0

  • failedinteger · uint64

    Refused for good otherwise, out of attempts, or not made.

    ≥ 0

  • queuedinteger · uint64

    Waiting for their first attempt.

    ≥ 0

  • sentinteger · uint64

    Taken by the recipient’s server.

    ≥ 0

  • suppressedinteger · uint64

    Held back by a suppression or the subscriber’s status.

    ≥ 0

  • totalinteger · uint64

    Every delivery: the sum of the above.

    ≥ 0

CampaignEventCounts

How many events of a kind a campaign has: every one, and the distinct subscribers among them (two opens by one subscriber: total 2, unique 1).

  • object · all fields required
  • totalinteger · uint64

    Every event, repeats included.

    ≥ 0

  • uniqueinteger · uint64

    The distinct subscribers of those events.

    ≥ 0

Errors

A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors

HTTP API

The same operation over HTTP: GET /api/v1/projects/{project_id}/campaigns/{campaign_id}/stats