Get usage
GET/v1/analytics/usagepreview
Get the app’s billable units this month, its organization’s monthly unit quota, and the app’s lifetime counters of events, deliveries, attempts, payload bytes and transform runs.
Returns
The query result.200
dataobject RequiredEvent counts for the current month and lifetime counters of the app.
unitsThisMonthnumber RequiredBillable units the app used since the start of the current UTC month.
unitQuotanumber RequiredThe billable units the organization’s plan includes per UTC month, shared by every app in the organization.
quotaExceededboolean RequiredWhether the organization has used its included units without a paid plan, so ingestion is refused with 402 quota_exceeded.
eventsReceivednumber RequiredEvents accepted since the app was created.
deliveriesCreatednumber RequiredDeliveries created since the app was created.
deliveriesHeldnumber RequiredDeliveries created on hold, and not attempted, because their event was too old when it was fanned out, since the app was created.
attemptsnumber RequiredDelivery attempts made since the app was created.
payloadBytesnumber RequiredPayload bytes accepted since the app was created.
transformInvocationsnumber RequiredTransform runs since the app was created.
deliveryInternalErrorsnumber RequiredTimes a delivery failed inside PayloadPuffin before a request was sent, since the app was created.
Example
curl -X GET "https://api.payloadpuffin.com/v1/analytics/usage" \
-H "Authorization: Bearer $PAYLOADPUFFIN_API_KEY"{
"data": {
"unitsThisMonth": 0,
"unitQuota": 0,
"quotaExceeded": true,
"eventsReceived": 0,
"deliveriesCreated": 0,
"deliveriesHeld": 0,
"attempts": 0,
"payloadBytes": 0,
"transformInvocations": 0,
"deliveryInternalErrors": 0
}
}Errors
Errors use application/problem+json. The code member is stable; branch on it rather than on title or detail.
4XXapplication/problem+jsonThe request was rejected.