Skip to main content
GET
Get billing status
Requires billing:read. A key without that scope is 403 INSUFFICIENT_SCOPE.

What comes back, and what does not

balance_cents is what the workspace can still spend; balance is the same number in whole currency units. is_suspended is true when calling is stopped for a billing reason — a suspended workspace still answers this read. billing_email is masked to its first character and its domain (s***@example.com), and is null when no address is set. The whole address is a named person’s, so a key that can read a balance does not get it: read or change it in the dashboard’s billing settings. Nothing else on this response is personal data. has_payment_method is true when a card is saved for the workspace’s billing — the card automatic top-ups and phone-number rent are charged to — and false when none is. It does not say whether the next charge will succeed. Auto top-up is described by three fields together: auto_topup_enabled, auto_topup_amount_cents (what is charged each time, before VAT) and low_balance_threshold_cents (the balance that triggers it). On a workspace that has never set it up, auto_topup_enabled is false, and the other two still hold the values it would use — the stored defaults or the last ones saved, such as 5000 and 500 — so read them only while auto_topup_enabled is true. They are null only before the workspace has a credit account.

What the card is due to be charged

upcoming_charges lists what will be charged to the card next, soonest first:
  • phone_number_rent — a number whose monthly rent Yappr charges, due on its next_renewal_at (see GET /phone-numbers). A number whose rent is included — one in your own carrier account, one whose subscription has charged nothing in the last 40 days, or a Yappr number with no subscription — is not listed, and neither is a number whose release is scheduled: it does not renew.
  • auto_top_up — only while auto top-up is on: amount_cents is charged when the balance falls below when_balance_below_cents, so it has no date.
Amounts are before VAT; where VAT applies the card is charged it on top. The list is empty when nothing is due, and null when it could not be read — the rest of this read still answers, so a balance check before placing calls never fails over it.

The monthly spending limit

Five fields describe the workspace’s own limit on what it will spend this calendar month. monthly_budget_cents is the limit itself and is null on a workspace that has not set one, which is the default. monthly_spend_cents is what this month has cost so far and is reported whether or not a limit is set, monthly_budget_remaining_cents is the difference and never goes below zero, and monthly_period_start says which month that is. monthly_budget_reached is the one to branch on: while it is true, outbound calls are refused with 402 SPEND_BUDGET_REACHED and queued outbound calls, campaigns included, are failed rather than held. Calls coming in are never refused for it. Set or clear the limit with PATCH /billing.

What a minute costs

What each voice model charges per minute is not on this read: it is GET /billing/rates.

What this read is not

This is the account’s current state, not its history. For what was spent, on what, and when — day by day, per product or per agent — use Billing consumption. What one call cost lives on the call: GET /calls/{id} returns cost_cents.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Response

Billing status

has_payment_method
boolean

True when a card is saved for the workspace's billing - the card automatic top-ups and phone-number rent are charged to. False when none is. It does not say whether the next charge will succeed.

billing_email
string | null

The billing address, masked to its first character and its domain (s***@example.com). Null when no address is set. The whole address is never returned here - read it in the dashboard's billing settings.

Example:

"s***@example.com"

balance_cents
integer
balance
number

balance_cents / 100

currency
string
Example:

"usd"

is_suspended
boolean
auto_topup_enabled
boolean

False until auto top-up is switched on, and on a workspace that never set it up.

auto_topup_amount_cents
integer | null

What an automatic top-up charges, before VAT. Kept while auto top-up is off - the stored default or the last amount saved, such as 5000 - so read it only when auto_topup_enabled is true. Null only before the workspace has a credit account.

Example:

5000

low_balance_threshold_cents
integer | null

The balance below which an automatic top-up is charged. Kept while auto top-up is off, like auto_topup_amount_cents. Null only before the workspace has a credit account.

Example:

500

monthly_budget_cents
integer | null

The workspace's own CALENDAR-MONTH spending limit, in cents, covering every outbound PHONE call in the workspace — the ones asked for through the API or by a campaign. Calls coming in, browser rehearsals (POST /calls {"type":"web"}) and the calls a shared link places keep working while it is reached. Null means no limit is set, which is the default. Change it with PATCH /billing. Not the same as a campaign's budget_cents, which is one campaign's lifetime budget.

Example:

5000

monthly_spend_cents
integer

Charges completed since the start of the current calendar month (UTC). Reported whether or not a spending limit is set. Top-ups and refunds are not spend and are not counted.

Example:

1240

monthly_budget_remaining_cents
integer | null

Limit minus spend, never below zero. Null when no limit is set.

Example:

3760

monthly_budget_reached
boolean

True when the limit is set and this month's spend has reached it. While true, POST /calls answers 402 SPEND_BUDGET_REACHED and queued outbound calls (campaigns included) are failed with the same sentence. Calls coming in are unaffected.

monthly_period_start
string<date-time>

Start of the month the spend was measured over.

upcoming_charges
object[] | null

What the card is due to be charged, soonest first: each number whose rent Yappr charges, on its next renewal (a number whose release is scheduled does not renew, and is not listed), then the automatic top-up while it is on (due when the balance falls below its threshold). Before VAT. Empty when nothing is due; null when it could not be read - the rest of this read still answers.