Skip to main content

Message Usage & Prices

GET/v1/usage/messages

Returns your own message volume over a recent window, grouped by message type, billing category, destination country and unit price. This is the customer-side finance view: it answers "how many messages went where, and what did each one cost".

Authentication

Send Authorization: Bearer <API_KEY> in the request headers, with scope messages:read. This endpoint requires a customer-level API Key: the customer entity in scope comes from the Key, never from a request field. BU and platform-level API Keys receive 403.

Request​

Base URL: https://api.bluehola.com

Query parameters​

ParameterTypeRequiredDescription
days7 | 30 | 90NoWindow length; defaults to 30. Any other value returns 400.
curl "https://api.bluehola.com/v1/usage/messages?days=30" \
-H "Authorization: Bearer <API_KEY>"

Response​

StatusDescription
200OK
403The Key is not a customer-level Key, or it has no customer entity binding
4xxClient error

For the common error envelope and how to handle it, see Error Codes.

200 OK (example)
{
"generatedAt": "2026-11-23T03:00:00.000Z",
"windowDays": 30,
"rows": [
{
"type": "template",
"category": "MARKETING",
"country": "Brazil",
"market": "Brazil",
"currency": "USD",
"unitPrice": "0.0625",
"unitPriceMicros": 62500,
"messageCount": 1200
},
{
"type": "template",
"category": "UTILITY",
"country": "India",
"market": "India",
"currency": "USD",
"unitPrice": "0.0014",
"unitPriceMicros": 1400,
"messageCount": 8400
}
]
}
FieldTypeMeaning
generatedAtstring (date-time)When the summary was generated.
windowDaysinteger: 7, 30 or 90The window actually used.
rowsarrayOne row per message type, billing category, destination country and unit price.
rows[].typestringMessage type: text, template, image, and so on.
rows[].categorystring or nullBilling category (MARKETING, UTILITY, AUTHENTICATION, …). null for non-template messages.
rows[].countrystring or nullDestination country resolved from the recipient number. null when it cannot be resolved.
rows[].marketstring or nullThe Meta billing market used for pricing. Some markets are regions, such as Rest of Western Europe, so this may differ from country.
rows[].currencystringPricing currency, for example USD.
rows[].unitPricestring or nullThe unit price charged for this message, as a decimal string. "0" for messages that were free.
rows[].unitPriceMicrosinteger or nullThe same price in micros (1 unit = 1,000,000 micros).
rows[].messageCountintegerNumber of messages in this group during the window.

Notes​

What is counted​

Only messages that have a pricing record are counted. A free message has no charge on the ledger, so counting from the ledger would silently drop entire categories of traffic; this view therefore counts priced messages, including those priced at 0.

Why the same country and type can appear more than once​

Volume-tier pricing can charge a different unit price for messages in the same country and category. Rows are grouped by the actual unit price charged, so merging them would produce an average that no message was actually billed at. Sum messageCount across rows if you only need the total volume.

Ownership​

The customer entity is taken from the API Key. A customer Key sees only its own customer entity's messages, and a BU-level view is intentionally not available here — use the console for BU-wide reporting.