UsageSummary object returns aggregated usage and spend for your account over a date window, bucketed by the granularity you choose and optionally filtered by subaccount, product, country, direction, error code, or hangup cause. Telecom traffic (messaging, voice, SIP Trunking, transcription) is returned in usage, and non-telecom billing rows (number charges, lookups, fees, taxes, adjustments) are returned in other_charges. Detail rows are paginated with an opaque cursor.
API Endpoint
Authentication uses HTTP Basic Auth with your
AUTH ID and AUTH TOKEN, the same as all Plivo Messaging APIs. The auth_id is taken from the URL path; any auth_id passed as a query parameter is silently ignored.At general availability this endpoint is available over the REST API only. Server SDK wrappers will be added in a future release.
Retrieve Usage Summary
Retrieves a paginated usage summary for the requested window.Arguments
Only the parameters below are forwarded upstream. Any unknown query keys are silently dropped.Scope the summary to a single subaccount. Must be non-empty if provided. Omit to summarize the parent account and all subaccounts.
Bucket size for
usage rows. One of hour, day, month, or year.Start of the reporting window in
YYYY-MM-DD format. Inclusive.End of the reporting window in
YYYY-MM-DD format. Exclusive — rows with timestamps at or after to_date are not returned.Restrict
usage rows to one or more products. Repeatable, or pass as a comma-separated list. Valid values: message, voice, zentrunk, transcription, other.Filter messaging rows by rolled-up DLR error code. Ignored for non-messaging products. See Error Codes for the full list.
Filter voice and SIP Trunking rows by hangup cause. Ignored for other products. See Hangup Causes for the full list.
Filter rows by direction. One of
inbound or outbound.Filter rows by ISO-3166-1 alpha-2 country code (for example,
US, GB, IN).Number of
usage rows per page. Range: 1–1000.Opaque cursor returned as
next_page_token on the previous response. Pass it back to fetch the next page.Unlike most Plivo list endpoints,
UsageSummary uses cursor-based pagination (page_token / next_page_token) rather than the limit / offset model described in the API Overview. See Pagination below.Window limits per granularity
The reporting window (to_date − from_date) is capped based on the granularity you request:
| Granularity | Maximum window |
|---|---|
hour | 7 days |
day | 92 days |
month | 24 months |
year | Unlimited (bounded by data retention) |
400 response that suggests the next-coarser granularity.
Example
Response
The Usage Summary Object
A successful response has three top-level fields:api_id, meta, and the two row arrays usage and other_charges.
Unique identifier for the request.
Paginated telecom-traffic rows for
message, voice, zentrunk, and transcription. See usage item below. All usage filters (product, country, direction, error_code, hangup_cause, subaccount_auth) apply to this array.Non-telecom billing rows — number charges, lookups, fees, taxes, adjustments. See other charges item below.
meta
Account auth ID the summary belongs to.
Present only when the request was scoped to a subaccount via
subaccount_auth.Granularity used for bucketing
usage rows.Reporting window start (ISO-8601 timestamp).
Reporting window end (ISO-8601 timestamp). Exclusive.
Currency of all monetary amounts in the response.
Number of
usage rows per page.Opaque cursor for the next page. Omitted on the last page.
Grand total (
usage + other_charges) over the entire reporting window. Returned on page 1 only.Window usage total for the scoped subaccount. Present only when the request was filtered by
subaccount_auth. Returned on page 1 only.Per-subaccount usage spend breakdown, keyed by subaccount auth ID. Returned on page 1 only, and only when the request was not filtered by
subaccount_auth. Parent-level rows and other_charges are excluded from this map.usage item
Bucket start (ISO-8601 timestamp). Inclusive.
Bucket end (ISO-8601 timestamp). Exclusive.
One of
message, voice, zentrunk, or transcription.Product sub-type. For example,
sms or mms for message, or pstn for voice.Present for subaccount-scoped rows; omitted for parent-level rows.
ISO-3166-1 alpha-2 country code. Omitted for products that don’t carry a country dimension.
inbound or outbound. Omitted for products that don’t carry a direction dimension.Units for this bucket. The unit depends on the product — see Per-product unit meaning below.
Billed duration in seconds, for
voice, zentrunk, and transcription rows. Omitted for other products.Total charge for the bucket.
Surcharge component of
total_amount, when applicable.Rolled-up DLR error code on messaging rows. Empty on successful delivery. See Error Codes.
Rolled-up hangup cause on voice and SIP Trunking rows. See Hangup Causes.
Human-readable label for whichever of
error_code or hangup_cause is set on the row.Per-product unit meaning
| Product | total_units means | duration_seconds means |
|---|---|---|
message | Message segments | Not returned |
voice | Call count | Billed call duration |
zentrunk | Call count | Billed call duration |
transcription | Transcription count | Recording duration |
other charges item
Charge window start (ISO-8601 timestamp).
Charge window end (ISO-8601 timestamp).
Customer-facing label for the charge. Examples:
Number Charges, CNAM Lookup, Other Charges.Number of units billed.
Total amount charged. Always positive.
Pagination
usage rows are paginated with an opaque cursor. When meta.next_page_token is present, pass it back as the page_token query parameter — keeping all other filters unchanged — to fetch the next page. The last page omits next_page_token.
Example: fetching page 2
cURL
Rate limits
This endpoint allows up to 20 requests per 60 seconds per account. Exceeding this limit returns a429 response; retry after a short backoff.
Response codes
| Code | Meaning |
|---|---|
200 | Success. Returns a usage summary body. |
400 | Bad request. The upstream error message is surfaced verbatim so the caller can self-correct (for example, exceeding the window cap for the requested granularity). |
401 | Unauthorized. Invalid AUTH ID or AUTH TOKEN. |
403 | Forbidden. The request originated from a non-whitelisted IP. See IP Whitelisting. |
429 | Rate limit exceeded. See Rate limits. |
502 | Upstream messaging-dashboard failure. Internal details are not leaked. |
Example: window cap exceeded
Notes
auth_idis always taken from the URL path. A client cannot read another account’s usage by passing a differentauth_idin the query string.- Upstream 4xx errors propagate their status code and message verbatim. Upstream 5xx or network failures are normalized to
502with a generic message.