Send Plan (billing)
/api/v1/billing/send-planRequest
/api/v1/billing/send-plancurl -X GET 'https://app.mailyte.com/api/v1/billing/send-plan' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY'const response = await fetch('https://app.mailyte.com/api/v1/billing/send-plan', {
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/send-plan",
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/send-plan');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/billing/send-plan")
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.
dataobjectThe Send plan held, this month's overage, and the spend cap. No payment processor is named: which rail would collect an overage charge is our arrangement, not the customer's data.
objectstringsend_planplan_keystringThe Send plan you have. Null when you have none.
currencystringThe currency every amount here uses, as an ISO 4217 code such as
NGNorUSD. Amounts are in its smallest unit.NGNwhen you have no plan.included_monthlyintegerEmails a month the plan includes.
0when you have no plan.used_this_monthintegerEmails sent this calendar month. Null means the mail server could not be reached; try again rather than reading it as 0.
overage.emails,overage.amountandspend_cap.reachedare then null too.overageobjectSending past
included_monthly, and what it costs.emailsintegerEmails past what your plan includes. Null when
used_this_monthis null.amountintegerWhat the extra emails cost so far this month, in the smallest unit of
currency(kobo for NGN, cents for USD):150000NGN is ₦1,500.00. Null whenused_this_monthis null; it is not a zero bill.rate_per_thousandintegerThe price per 1,000 emails past what your plan includes, in the smallest unit of
currency(kobo for NGN, cents for USD). Null when the plan has no overage price.
spend_capobjectAn optional ceiling on overage spend for the month.
amountintegerYour spending cap, in the smallest unit of
currency(kobo for NGN, cents for USD). Null means no cap.0is different: it means never charge me for extra emails. To remove the cap, send null, not 0.reachedbooleanWhether you have reached the cap. Null when there is a cap but this month's sending could not be read. False when there is no cap.
ceiling_emailsintegerYour cap as a number of emails, which is how the mail server enforces it. Null when there is no cap.
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.