API Reference

Retrieve Usage

GET /usage — what your account has used this period, next to its plan limits.

GET/usage

Returns your account's meters next to the limits of its plans, in three groups: transactional (email sending), marketing (contacts and segments) and team (shared across the account). Use it to warn before a limit is reached, or to show usage inside your own tools. No prices or amounts are included.

Works with any API key that has read access. Takes no parameters.
const res = await fetch('https://www.senddart.com/api/usage', {
  method: 'GET',
  headers: { 'Authorization': 'Bearer mb_xxxxxxxxx' },
});
const data = await res.json();
console.log(data);

Response

{
  "object": "usage",
  "transactional": {
    "plan": { "id": "pro", "name": "Pro" },
    "monthly": { "used": 51234, "limit": 50000, "received": 1210 },
    "daily": { "used": 900, "limit": null, "received": 30 },
    "webhook_endpoints": { "used": 2, "limit": 5 }
  },
  "marketing": {
    "plan": { "id": "mkt_free", "name": "Marketing Free" },
    "contacts": { "used": 812, "limit": 1000 },
    "segments": { "used": 1, "limit": 3 },
    "broadcasts": "unlimited"
  },
  "team": {
    "ai_credits": { "used": 12, "limit": 100 },
    "automation_runs": { "used": 10340, "limit": 10000 },
    "domains": { "used": 4, "limit": 110 },
    "inboxes": { "used": 5, "limit": 3 },
    "retention_days": 30
  }
}
Fields
transactional.planobjectoptional

The sending plan: id and display name.

transactional.monthlyobjectoptional

Emails sent this billing month (used) against the monthly limit, plus emails received by your domains.

transactional.dailyobjectoptional

The same for today (UTC).

transactional.webhook_endpointsobject | nulloptional

Webhook endpoints in use against the plan's allowance. null on older plans that have no such limit.

marketing.planobjectoptional

The marketing plan: id and name.

marketing.contactsobjectoptional

Stored contacts against the plan's allowance.

marketing.segmentsobjectoptional

Segments against the plan's allowance.

marketing.broadcastsstringoptional

Always "unlimited": campaigns are not counted.

team.ai_creditsobjectoptional

AI credits used this period.

team.automation_runsobjectoptional

Automation runs started this period.

team.domainsobjectoptional

Domains on the account.

team.inboxesobjectoptional

Inboxes on the account against the number included.

team.retention_daysnumberoptional

How many days of email history the account keeps.

Every meter is { used, limit }. A limit of null means there is no limit. used can be higher than limit (as monthly and automation_runs are above) when usage went past an allowance, for example on pay-as-you-go or during a grace period.

A missing or invalid key returns 401. A key without read access returns 401 restricted_api_key; see Errors.