Get the business agent usage insights
Retrieve the billable messages, billable tokens, and charges for a Meta Business Agent account over the requested billing date range, as one entry per HOUR, DAY, or MONTH bucket. Split results by channel or sending entity with dimensions, narrow them with the channels and sender_ids filters, and choose which metrics to return with metric_types. Reported tokens are billed tokens, the same figure used to calculate your invoice, which may be fewer than the total tokens the agent used to produce a response.
API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.
The billable account ID of the business agent. Find it in Billing Hub under Accounts > Meta Business Agent accounts.
Start of the billing date range, as a Unix timestamp (seconds). Inclusive: only buckets that start at or after start are returned. Dates are evaluated in the billable account's timezone. For MONTH, this must be the first day of a month in the account's timezone.
End of the billing date range, as a Unix timestamp (seconds). Exclusive: only buckets that start before end are returned, so a DAY query ending at midnight on June 4 returns June 1 to June 3. Dates are evaluated in the billable account's timezone. For MONTH, this must fall on the last day of a month in the account's timezone.
Size of each time bucket. MONTH requires the range to span whole months in the billable account's timezone (start on the 1st, end on the last day of a month).
Restrict to these sending entities.
Meta Business Agent API version
The agent usage over the requested date range
The agent usage over the requested date range
Bad request
Unauthorized
Forbidden
Not found
Too many requests
Server error
GET /insights/usage/{entity_id}?start=1&end=1&granularity=HOUR HTTP/1.1
Host: waba-v2.360dialog.io
D360-API-KEY: YOUR_API_KEY
Accept: */*
{
"usage": [
{
"billable_messages": 120,
"billable_tokens": 48000,
"channel": "whatsapp",
"cost": 1.25,
"end": 1780387200,
"sender_id": "109269195336416",
"start": 1780300800
}
]
}Last updated
Was this helpful?