Skip to content
Norbelys
Esc
↑↓navigate↵open⌘Jpreview

Retrieve the workspace's campaign counters.

Counters per UTC day from the rollup, at most about seven minutes behind; computed_at says how far it had counted. The range defaults to the 30 days ending today and covers at most 366 days.

GET/v1/analytics
Authorization
AuthorizationBearer token · headerrequired

An API key (nb_live_…, nb_test_…), a workspace token (nbs_…) or a CLI token (nbc_…).

Query parameters
campaign_idId_Campaign

Only this campaign's counters.

matches ^cmp_[0-9a-f]{32}$
step_idId_Step

Only this step's counters.

matches ^stp_[0-9a-f]{32}$
fromstring

The first UTC day (YYYY-MM-DD); default 29 days before to.

tostring

The last UTC day, included (YYYY-MM-DD); default today.

group_byGroupBy

day, campaign, step or variant.

Allowed:daycampaignstepvariant
Responses
200

The counters.

computed_atTimestamp | null
Show properties
One of:
Timestamp
string<date-time>
null
null
dataAnalyticsGroup[]required

One entry per group, ordered by the grouping; empty when not grouped.

max items 1000
Show properties
Array of AnalyticsGroup
campaign_idstring | null

The campaign, when grouped by campaign, step or variant.

countersCountersrequired

The counters of a campaign, a step, a variant or a day, summed from campaign_daily_stats.

Show properties
bouncedinteger<int64>required

Messages that could not reach their recipient for good.

clickedinteger<int64>required

Messages with at least one human click.

complainedinteger<int64>required

Recipients who complained.

deliveredinteger<int64>required

Messages the recipient's server took.

openedinteger<int64>required

Messages with at least one human open.

repliedinteger<int64>required

Messages a person replied to.

sentinteger<int64>required

Messages a provider accepted.

unsubscribedinteger<int64>required

Recipients who unsubscribed.

dayDate | null
Show properties
One of:
Date
string<date>
null
null
step_idstring | null

The step, when grouped by step or variant.

variant_idstring | null

The variant, when grouped by variant.

variant_versioninteger<int32> | null

The variant's version, when grouped by variant: each published version counts apart.

fromDaterequired

The first day counted (UTC).

group_byGroupBy | null
Show properties
One of:
GroupBy
string
null
null
has_morebooleanrequired

The grouping has more groups than data holds (at most 1,000).

toDaterequired

The last day counted (UTC), included.

totalsCountersrequired

The counters of a campaign, a step, a variant or a day, summed from campaign_daily_stats.

Show properties
bouncedinteger<int64>required

Messages that could not reach their recipient for good.

clickedinteger<int64>required

Messages with at least one human click.

complainedinteger<int64>required

Recipients who complained.

deliveredinteger<int64>required

Messages the recipient's server took.

openedinteger<int64>required

Messages with at least one human open.

repliedinteger<int64>required

Messages a person replied to.

sentinteger<int64>required

Messages a provider accepted.

unsubscribedinteger<int64>required

Recipients who unsubscribed.

401

No valid credential.

codestringrequired

The code from the closed registry; programs branch on it, never on the text. New codes may be added.

detailstringrequired

What went wrong, for a person; never an internal cause.

errorsFieldError[]

With validation_failed only: every invalid field.

Show properties
Array of FieldError
codestringrequired

What is wrong (required, range, length, format, invalid, …).

detailstringrequired

A safe, human-readable explanation.

pointerstringrequired

RFC 6901 pointer into the body, or ?name for a query parameter.

instancestringrequired

The request's path.

request_idstringrequired

The request's id, also in X-Request-Id: what support needs to find the request.

retry_afterinteger<int64> | null

With 429 and 503: the seconds to wait, as in Retry-After.

min 0
statusinteger<int32>required

The HTTP status.

min 0
titlestringrequired

Fixed per code.

typestringrequired

https://docs.norbelys.com/errors/<code>, a page that explains the code.

403

The credential lacks analytics:read.

codestringrequired

The code from the closed registry; programs branch on it, never on the text. New codes may be added.

detailstringrequired

What went wrong, for a person; never an internal cause.

errorsFieldError[]

With validation_failed only: every invalid field.

Show properties
Array of FieldError
codestringrequired

What is wrong (required, range, length, format, invalid, …).

detailstringrequired

A safe, human-readable explanation.

pointerstringrequired

RFC 6901 pointer into the body, or ?name for a query parameter.

instancestringrequired

The request's path.

request_idstringrequired

The request's id, also in X-Request-Id: what support needs to find the request.

retry_afterinteger<int64> | null

With 429 and 503: the seconds to wait, as in Retry-After.

min 0
statusinteger<int32>required

The HTTP status.

min 0
titlestringrequired

Fixed per code.

typestringrequired

https://docs.norbelys.com/errors/<code>, a page that explains the code.

422

A parameter is invalid, the range is reversed or longer than 366 days.

codestringrequired

The code from the closed registry; programs branch on it, never on the text. New codes may be added.

detailstringrequired

What went wrong, for a person; never an internal cause.

errorsFieldError[]

With validation_failed only: every invalid field.

Show properties
Array of FieldError
codestringrequired

What is wrong (required, range, length, format, invalid, …).

detailstringrequired

A safe, human-readable explanation.

pointerstringrequired

RFC 6901 pointer into the body, or ?name for a query parameter.

instancestringrequired

The request's path.

request_idstringrequired

The request's id, also in X-Request-Id: what support needs to find the request.

retry_afterinteger<int64> | null

With 429 and 503: the seconds to wait, as in Retry-After.

min 0
statusinteger<int32>required

The HTTP status.

min 0
titlestringrequired

Fixed per code.

typestringrequired

https://docs.norbelys.com/errors/<code>, a page that explains the code.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.norbelys.com/v1/analytics' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "computed_at": "2019-08-24T14:15:22Z",
  "data": [
    {
      "campaign_id": "string",
      "counters": {
        "bounced": 0,
        "clicked": 0,
        "complained": 0,
        "delivered": 0,
        "opened": 0,
        "replied": 0,
        "sent": 0,
        "unsubscribed": 0
      },
      "day": "2019-08-24",
      "step_id": "string",
      "variant_id": "string",
      "variant_version": 0
    }
  ],
  "from": "2019-08-24",
  "group_by": "day",
  "has_more": true,
  "to": "2019-08-24",
  "totals": {
    "bounced": 0,
    "clicked": 0,
    "complained": 0,
    "delivered": 0,
    "opened": 0,
    "replied": 0,
    "sent": 0,
    "unsubscribed": 0
  }
}