Get usage for the authenticated account's organization (new billing model).
const url = 'https://api.pingram.io/organization/usage';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 \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Successful response
Response for GET /account/organization/usage
object
Total message usage (EMAIL + INAPP_WEB + WEB_PUSH + PUSH + SLACK)
Total budget usage in USD (cost_SMS + cost_CALL + cost_NUMBER)
SMS cost in USD
Call cost in USD
Phone number rent in USD
Per-channel usage breakdown
object
Billing cycle start date (ISO string)
Billing cycle end date (ISO string)
Example generated
{ "messageUsage": 1, "budgetUsage": 1, "costSms": 1, "costCall": 1, "costNumber": 1, "channelUsages": { "additionalProperty": 1 }, "billingCycleStart": "example", "billingCycleEnd": "example"}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.
Example generated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}Unauthorized
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.
Example generated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}Internal Server Error
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.
Example generated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}