Get current usage
/api/v1/billing/usageWhat your organization has sent this period, against its plan allowance and any purchased credits.
Request
/api/v1/billing/usagecurl -X GET 'https://app.mailyte.com/api/v1/billing/usage' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY'const response = await fetch('https://app.mailyte.com/api/v1/billing/usage', {
method: 'GET',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
},
});
const { data } = await response.json();import requests
response = requests.get(
"https://app.mailyte.com/api/v1/billing/usage",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->get('https://app.mailyte.com/api/v1/billing/usage');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/billing/usage")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectobjectstringusagemailboxesobjectfree_usedintegerFree mailboxes in use.
free_limitintegerHow many free mailboxes you may have: five, or more if you had more before the pricing change. Buying seats does not change it. Null means no limit.
seatsobjectPaid seats, per tier.
standardobjectSeats of the Standard tier.
proobjectSeats of the Pro tier.
workplaceobjectSeats of the Workplace tier.
send_creditsobjectbalanceintegerSend credits left, counted in emails, not money. Null means unknown.
sourcestringenforcer | ledgerWhere
balancecame from.enforcer: the live count on the mail server.ledger: our own copy, used when the mail server could not be reached; it can be up to 15 minutes behind.used_this_monthintegerCredits used this calendar month. Null means the mail server could not be reached; try again.
app_sendobjectEmail sent through the API and webmail, not through SMTP. If the mail server cannot be reached, every count here is null at once; try again rather than reading it as 0.
monthlyobjectincludedintegerEmails included each month.
0when your plan has no monthly allowance.usedintegerEmails sent this month. Null means the mail server could not be reached.
dailyobjectincludedintegerHow many emails you may send today. This is the limit actually in force, so it can differ from the free daily emails on the pricing page: those apply only to accounts with no credits and no Send plan, and
0here is then correct. Null means the mail server could not be reached.usedintegerEmails sent today. Null means the mail server could not be reached.
checksobjectChecks, where one check looks at one address to see whether its mailbox exists. They are used in this order: this month's plan checks, then bought checks, then older send credits. Every figure here counts checks. Null means they could not be read just now; try again.
plan_leftintegerThis month's plan checks still left. Months are UTC months.
0when your plan includes none, or all are used.plan_limitintegerChecks your Marketing plan includes each UTC month.
0when your plan includes none.boughtintegerChecks you bought, or that we added for you. They never expire, and are used after this month's plan checks.
credit_fallbackintegerHow many checks your send credits can still pay for, counted in checks. Only credits from before checks launched can pay, at 10 credits a check, and we always leave you at least 1 credit. Used last.
forecast_daysintegerAbout how many days your checks will last, at your rate over the last 7 days. Null when checks are not on yet, or you used none in the last 7 days.
ran_outbooleantruewhen you have no checks left and a check could not be made for want of one this month (UTC). New contacts are then added and markednot_checked. Buying checks, or next month's plan checks, ends it.protectionobjectYour Bounce protection switch: whether each new contact is checked, using one check.
enabledbooleanWhether the switch is on for your account.
is_defaultbooleantruewhile you have not chosen: it is then on when your Marketing plan includes checks, and off otherwise.
upgradeobjectA bigger Marketing plan that would have cost you less this month (UTC): you spent more on check packs than the next plan costs, and it includes more checks every month. Null when there is no such plan.
spent_minorintegerWhat you spent on check packs this month, in the currency's minor unit (kobo, cents).
currencystringISO 4217 code of both amounts.
plan_keystringThe suggested Marketing plan's product key.
plan_checksintegerChecks that plan includes each month.
price_difference_minorintegerWhat that plan costs a month on top of yours, in the minor unit.
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist. |
403 | The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys. |
404 | No such resource in this organization. |
422 | The request was understood but the values were not acceptable. |
429 | Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait. |
Every status, with what causes it and what to do, is on the error reference.