Skip to main content

Get WABA Usage Analytics

GET/v1/wabas/{id}/analytics

Query this WABA's usage/cost analytics directly from Meta, as a cross-check against the local ledger usage view. The messaging and pricing fields are requested and reported independently: the response is { messaging: {ok, data|error}, pricing: {ok, data|error} }, so if one is rejected by Meta the other still returns data, with Meta's raw code/subcode in the error. Note that pricing's COST is not returned for WABAs sharing a Solution Partner credit line.

Authentication

Send Authorization: Bearer <API_KEY> in the request headers, with the required scope billing:read. Which resources an API Key can reach is determined by its current authorization scope.

Request​

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

Parameters​

NameInRequiredType / constraintsDescription
idpathYesstringThe platform WABA ID, waba_...
startqueryYesunix timestampStart of the reporting period (seconds). Required; returns 400 VALIDATION_FAILED if it cannot be parsed as a number
endqueryYesunix timestampEnd of the reporting period (seconds). Required; returns 400 VALIDATION_FAILED if it cannot be parsed as a number
granularityqueryNoHALF_HOUR | DAY | MONTHDefaults to DAY; other values do not error, they are always treated as DAY
phoneNumbersqueryNostringA comma-separated list of Meta phone number ids (digits only, 1–32 characters per segment), to filter by number. Returns 400 VALIDATION_FAILED if it contains any non-digit characters

Response​

StatusDescription
200OK
4xxClient error

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

Notes​

Parameter validation​

  • start/end: must parse to a finite unix timestamp; parsing failure is a straight 400.
  • granularity: only HALF_HOUR and MONTH are strictly accepted as non-default values — any other value (including omitting it) silently falls back to DAY. The endpoint will not correct a typo for you; you need to confirm the value yourself.
  • phoneNumbers: strictly validated as digits only (each number id up to 32 characters). These values are interpolated directly into the field-filter expression sent to the Meta Graph API (of the form .phone_numbers(id1,id2)); unsanitised input could in principle use ) or . to break out of the filter and rewrite the whole expression — this validation is not an optional robustness check, it is an injection gate.

Meta authorization state​

The service automatically selects whichever saved, usable Meta authorization it has. If that Business Portfolio has not completed Meta authorization, or its authorization has expired, this returns 409 rather than 404 — the problem is not "this WABA doesn't exist", it is that the platform currently cannot query Meta on the customer's behalf.