Get historical usage for the authenticated account over a date range, summed by UTC calendar month or billing cycle from daily counts.
const url = 'https://api.pingram.io/account/usage/history?startDate=example&endDate=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.pingram.io/account/usage/history?startDate=example&endDate=example' \ --header 'Authorization: Bearer <token>'Authorizations
Parameters
Query Parameters
Start date (YYYY-MM-DD) for the range
End date (YYYY-MM-DD) for the range
Calendar (UTC months, default) or billing (account billing cycles)
Responses
200
Successful response
Response for GET /account/usage/history
object
Array of usage items, one per calendar month or billing cycle in the range
Single usage item in historical response
object
YYYY-MM for calendar months, or YYYY-MM-DD billing-period start.
object
Examplegenerated
{ "items": [ { "yearMonth": "example", "counts": { "EMAIL": 1, "INAPP_WEB": 1, "SMS": 1, "CALL": 1, "VOICE": 1, "PUSH": 1, "WEB_PUSH": 1, "SLACK": 1 } } ]}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}