Stats a campaign
/api/v1/campaigns/{campaign}/statsParameters
| Name | In | Type | Description |
|---|---|---|---|
campaignrequired | path | string | The campaign identifier. |
Request
/api/v1/campaigns/{campaign}/statscurl -X GET 'https://app.mailyte.com/api/v1/campaigns/01JBT8XQ2M9WYC3K4F6R7S8T9V/stats' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY'const response = await fetch('https://app.mailyte.com/api/v1/campaigns/01JBT8XQ2M9WYC3K4F6R7S8T9V/stats', {
method: 'GET',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
},
});
const { data } = await response.json();import requests
response = requests.get(
"https://app.mailyte.com/api/v1/campaigns/01JBT8XQ2M9WYC3K4F6R7S8T9V/stats",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->get('https://app.mailyte.com/api/v1/campaigns/01JBT8XQ2M9WYC3K4F6R7S8T9V/stats');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/campaigns/01JBT8XQ2M9WYC3K4F6R7S8T9V/stats")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectCounts 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_statscampaign_idstringstatestringdraft | scheduled | sending | paused | sent | canceled | unknownThe campaign's state, as
stateon the campaign.sentmeans it finished sending, not that the counts below are final.recipientsobjectWhat happened to each recipient. Every count is null until the campaign starts.
totalintegerEvery row in the recipient ledger. Null until the campaign starts — see the group description.
pendingintegerMaterialised, not yet attempted. Null until the campaign starts — see the group description.
sentintegerRecipients handed to the mail server. Delivery is
engagement.delivered. Null until the campaign starts.failedintegerThe send attempt threw. Null until the campaign starts — see the group description.
skipped_suppressedintegerOn the organization's suppression list. Null until the campaign starts — see the group description.
skipped_unsubscribedintegerOpted out of this organization's mail. Null until the campaign starts — see the group description.
engagementobjectWhat came back. Every count is null until the campaign starts.
deliveredintegerConfirmations received from the receiving server. Null until the campaign starts — see the group description.
openedintegerUnique recipients who opened. Null until the campaign starts — see the group description.
clickedintegerUnique recipients who clicked. Null until the campaign starts — see the group description.
bouncedintegerUnique recipients whose message bounced. Null until the campaign starts — see the group description.
unsubscribedintegerUnique recipients who opted out from this message. Null until the campaign starts — see the group description.
generated_atstringWhen these counts were worked out. They are worked out on every request.
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist. |
403 | The 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. |
404 | No such resource in this organization. |
422 | The request was understood but the values were not acceptable. |
429 | Too 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.