Retrieve Usage
GET /usage — what your account has used this period, next to its plan limits.
/usageReturns 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.
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
}
}transactional.planobjectoptionalThe sending plan: id and display name.
transactional.monthlyobjectoptionalEmails sent this billing month (used) against the monthly limit, plus emails received by your domains.
transactional.dailyobjectoptionalThe same for today (UTC).
transactional.webhook_endpointsobject | nulloptionalWebhook endpoints in use against the plan's allowance. null on older plans that have no such limit.
marketing.planobjectoptionalThe marketing plan: id and name.
marketing.contactsobjectoptionalStored contacts against the plan's allowance.
marketing.segmentsobjectoptionalSegments against the plan's allowance.
marketing.broadcastsstringoptionalAlways "unlimited": campaigns are not counted.
team.ai_creditsobjectoptionalAI credits used this period.
team.automation_runsobjectoptionalAutomation runs started this period.
team.domainsobjectoptionalDomains on the account.
team.inboxesobjectoptionalInboxes on the account against the number included.
team.retention_daysnumberoptionalHow 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.