WoyraDocs
Get an API key

Retrieve account balance

GET/v1/balance

Billing · Requires an API key

Amounts are in micro-units — millionths of one major currency unit — so that per-message prices below one cent are exact. $0.30 per 1,000 emails is 300 micros each.

Parameters

NameInDescription
Woyra-VersionheaderThe dated API version to serve. Omit to pin to the oldest supported version.

Example

curl https://api.woyra.io/v1/balance \
  -H "Authorization: Bearer $WOYRA_KEY"

Response

200 The account's balance.

FieldTypeDescription
objectrequired"balance"
currencyrequiredstring
available_microsrequiredintegerSpendable balance, in micro-units.
reserved_microsrequiredintegerCommitted to messages currently in flight.
spent_microsrequiredintegerCumulative settled spend.
allowancesarray of objectThe published free tier and what is left of it this month. An account inside its allowance sends without any balance, so a balance figure alone would understate what it can do.
allowances.channelstring
allowances.limitintegerMessages included each month.
allowances.usedinteger
allowances.remaininginteger
allowances.resets_attimestampThe start of the next period, in UTC.
email_subscriptionEmailSubscriptionThe account's monthly email plan. Absent when it has never had one.
email_planobjectA plan this calendar month paid for the way plans were paid before they became monthly subscriptions. It still counts for that month.
email_plan.up_tointegerEmails this month's plan covers.
email_plan.paid_microsinteger
email_plan.currencystring
email_plan.nextEmailPlanThe plan the month moves to past up_to, at its full price. Absent past the last plan.

Errors

StatusCodes
401authentication_required, invalid_api_key
403insufficient_scope, domain_not_verified, recipient_suppressed, sending_paused, mfa_required

Also in Billing