Get the billing state
const url = 'https://api.overwatch.weareheavy.dev/v1/billing';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.overwatch.weareheavy.dev/v1/billing \ --header 'Authorization: Bearer <token>'The account’s billing state for the current period: every site’s metered usage against its per-app allowances, which apps are currently paused at their allowance, and the projected bill. Session-only, owner/admin.
Authorizations
Section titled “ Authorizations ”Responses
Section titled “ Responses ”The current period’s allowances, usage, paused apps, and projected bill.
object
The current UTC billing period, YYYY-MM.
Whether the account has opted in to overage billing.
object
Monthly crawl allowance per site.
Monthly accessibility-render allowance per site.
The org’s total included monitors.
object
Sites beyond the included count (billed with overage on).
object
The scheduler is skipping crawls for the rest of the period.
The scheduler is skipping accessibility scans for the rest of the period.
The projected bill for the period, itemized.
object
Examplegenerated
{ "period": "example", "overageEnabled": true, "allowances": { "includedSites": 1, "pagesCrawled": 1, "pagesRendered": 1, "monitorsPerSite": 1, "includedMonitors": 1 }, "counts": { "sites": 1, "extraSites": 1, "monitors": 1, "extraMonitors": 1 }, "sites": [ { "siteId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "hostname": "example", "pagesCrawled": 1, "pagesRendered": 1, "monitors": 1, "crawlPaused": true, "a11yPaused": true } ], "bill": {}}Missing or invalid credentials.
object
A human-readable error message.
Example
{ "error": "invalid api key"}A dashboard session is required (API-key callers are rejected), or the session’s role does not allow this action.
object
A human-readable error message.
Example
{ "error": "a dashboard session is required"}