Retrieve the organization's billing
The organization's plan (and contract), the current billing month's usage and what it would add to the next invoice so far, its standing (past_due, billing holds), payment method, and what the plan includes. Organization-wide: every environment's key sees the same. Plan changes are made in the dashboard; subscribe to the billing.* webhook events to follow them.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"The organization's billing.
application/json- response
object*"billing""billing"organization_id*stringplan*stringThe plan in effect now (free without a contract).
"free""pro""scale""enterprise"contract*|The contract in effect; null on the Free plan.
scheduled_change*|A plan change that takes effect later (a downgrade, a cancellation).
status*stringpast_due: an invoice is overdue; delinquent: past its grace period, and live sending is held.
"active""past_due""delinquent"holds*array<>Billing holds on live sending (sandbox keys keep working).
currency*"usd""usd"period*The current billing month (UTC).
usage*array<>estimate*This month so far, as it would be invoiced if it ended now.
credit_remaining*integerUnused credit usable this month.
spend_limit*|Usage beyond the credit past which live sending is held; null: none.
payment_method*|nullfeatures*limits*Resource limits (null: unlimited).
import { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.billing.get();{ "object": "billing", "organization_id": "org_01k7c8m4q2f3e9v6t5r1n0p8yz", "plan": "pro", "contract": { "id": "bcon_01k7c8m4q2f3e9v6t5r1n0p8yz", "kind": "self_serve", "effective_from": "2026-10-01T00:00:00.000Z", "effective_until": null, "term_end": null, "auto_renew": false }, "scheduled_change": null, "status": "active", "holds": [], "currency": "usd", "period": { "start": "2026-10-01T00:00:00.000Z", "end": "2026-11-01T00:00:00.000Z" }, "usage": [ { "meter": "email.recipients", "quantity": 120000, "included": null } ], "estimate": { "usage": 4800, "discount": 0, "credit": 2500, "total": 2300 }, "credit_remaining": 0, "spend_limit": null, "payment_method": { "type": "card", "brand": "visa", "last4": "4242" }, "features": { "tracking_domains": true, "audit_log": true, "log_drains": false, "sso": false, "scim": false }, "limits": { "domains": 10, "members": 10, "webhook_endpoints_per_environment": 10 }}List audit events GET
The organization's audit log, newest first: changes made by members in the dashboard, by API keys (from any environment) and by COSS support. The audit log is organization-wide, so every key of the organization reads the same events. Filter by action (an entry ending in `.` matches a whole resource, e.g. `domain.`), actor, target, environment or time. Pass the last `id` as `after` to get the next page while `has_more` is true. Reading the audit log is not itself logged.
Retrieve an invoice GET
One invoice with its lines.