Get historical usage for the authenticated account's organization over a date range.
const url = 'https://api.pingram.io/organization/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/organization/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
Responses
200
Successful response
Response for GET /organization/usage/history
object
Array of usage items, one per month in the requested range
Single usage item in historical response
object
Year-month (YYYY-MM) for this usage period
object
Examplegenerated
{ "items": [ { "yearMonth": "example", "counts": { "EMAIL": 1, "INAPP_WEB": 1, "SMS": 1, "CALL": 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" }}