Docs·Workspace

GET/api/v1/spreelytics/billing/usage

Get usage

Returns the workspace's plan, its billable events in the current usage window and a day-by-day breakdown: the numbers on Workspace → Usage & Billing. Usage counts every audience in the workspace together.

There is no audience in this request, so the workspace comes from the key. An audience key reads the workspace that owns its audience. An account key reads its owner's own workspace, unless an X-Team-Id header names another workspace they belong to.

Any member can read it, Viewer included. Changing the plan needs an Admin, in the app.

Keys: an account key or an audience key. Getting started explains both kinds.

Response

PropTypeNotes
planBillingPlanDtoThe current plan: id (free, or a size such as 250k), name (Free or Growth), monthly and yearly prices in US dollars (0 on Free) and eventsLimit, the monthly allowance that applies. A paid plan keeps the allowance it was bought with.
plansBillingPlanDto[]Every plan on offer, in the same shape, smallest allowance first.
periodStartstringStart of the current usage window, ISO 8601. On Free it is the calendar month in UTC. On a paid plan it is one month counted from the billing day, yearly billing included.
periodEndstringEnd of the window, not included.
eventsUsednumberBillable events in the window, across every audience in the workspace. Session ends, scroll events and link clicks are recorded but not billed.
eventsLimitnumberThe allowance for the window, the same as plan.eventsLimit.
perDayBillingUsagePointDto[]One { date, count } per UTC day of the window, oldest first. Days still to come are included as 0.
exceededbooleantrue once eventsUsed is over eventsLimit. Events are still recorded, up to the hard stop.
stoppedbooleantrue once usage reaches the hard stop: 3 times the allowance on plans of up to 1,000,000 events, 1.5 times above that. New events are dropped until the window resets or the plan grows, so check this first.
nearLimitbooleantrue from 90% of the allowance, and it stays true once over.
exceededAtstringWhen the workspace was first seen over its allowance in this window, as an ISO timestamp, or null. The first usage read that sees the overage records it.
dataCutoffstringWhen over the allowance: the time of the first event past it, otherwise null. Charts, analytics reads and people queries, in the app and through the API, show nothing after this moment until the window resets or the plan grows. The events after it are kept.
subscriptionStatusstringThe status of the paid subscription, or null when there is none.
cancelAtPeriodEndbooleantrue when the plan has been cancelled and ends with the current billing period.

Request

curl 'https://app.spreelytics.com/api/v1/spreelytics/billing/usage' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const res = await fetch('https://app.spreelytics.com/api/v1/spreelytics/billing/usage', {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
const data = await res.json();
import requests

res = requests.get(
    "https://app.spreelytics.com/api/v1/spreelytics/billing/usage",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
data = res.json()

Response

{
  "plan": {
    "id": "string",
    "name": "string",
    "monthly": 0,
    "yearly": 0,
    "eventsLimit": 0
  },
  "plans": [
    {
      "id": "string",
      "name": "string",
      "monthly": 0,
      "yearly": 0,
      "eventsLimit": 0
    }
  ],
  "periodStart": "string",
  "periodEnd": "string",
  "eventsUsed": 0,
  "eventsLimit": 0,
  "perDay": [
    {
      "date": "string",
      "count": 0
    }
  ],
  "exceeded": true,
  "stopped": true,
  "nearLimit": true,
  "exceededAt": "string",
  "dataCutoff": "string",
  "subscriptionStatus": "string",
  "cancelAtPeriodEnd": true
}

See your own numbers today.

Free up to 100k events a month · no credit card

Contact

Tell us what you need.

A real person reads these. We usually reply within one working day.

Or email us directly at contact@spreelytics.com.