Stats a campaign

GET/api/v1/campaigns/{campaign}/stats
Requires anorganization API keywith the scopecampaigns:read

Parameters

NameInTypeDescription
campaignrequiredpathstringThe campaign identifier.

Request

GET/api/v1/campaigns/{campaign}/stats
curl -X GET 'https://app.mailyte.com/api/v1/campaigns/01JBT8XQ2M9WYC3K4F6R7S8T9V/stats' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject

    Counts for this campaign, each counting people once. Divide them yourself for rates. Opens, clicks, bounces and unsubscribes are matched by address while the campaign is sending, so a person on two campaigns at once can be counted on both.

    • objectstringcampaign_stats
    • campaign_idstring
    • statestringdraft | scheduled | sending | paused | sent | canceled | unknown

      The campaign's state, as state on the campaign. sent means it finished sending, not that the counts below are final.

    • recipientsobject

      What happened to each recipient. Every count is null until the campaign starts.

      • totalinteger

        Every row in the recipient ledger. Null until the campaign starts — see the group description.

      • pendinginteger

        Materialised, not yet attempted. Null until the campaign starts — see the group description.

      • sentinteger

        Recipients handed to the mail server. Delivery is engagement.delivered. Null until the campaign starts.

      • failedinteger

        The send attempt threw. Null until the campaign starts — see the group description.

      • skipped_suppressedinteger

        On the organization's suppression list. Null until the campaign starts — see the group description.

      • skipped_unsubscribedinteger

        Opted out of this organization's mail. Null until the campaign starts — see the group description.

    • engagementobject

      What came back. Every count is null until the campaign starts.

      • deliveredinteger

        Confirmations received from the receiving server. Null until the campaign starts — see the group description.

      • openedinteger

        Unique recipients who opened. Null until the campaign starts — see the group description.

      • clickedinteger

        Unique recipients who clicked. Null until the campaign starts — see the group description.

      • bouncedinteger

        Unique recipients whose message bounced. Null until the campaign starts — see the group description.

      • unsubscribedinteger

        Unique recipients who opted out from this message. Null until the campaign starts — see the group description.

    • generated_atstring

      When these counts were worked out. They are worked out on every request.

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

Every status, with what causes it and what to do, is on the error reference.