First-request guide for Fetch Credit Usage details.
Fetch Credit Usage details
Fetch Credit Usage details
Overview
Returns a summary of credit usage and entitlements for the specified API category.
Call the endpoint
Send a GET request to /reporting/v1/usage with the required authentication and parameters.
Quickstart
Follow these two steps to make a request and recognize a successful response.
Make a request
curl --request GET \
--url https://uapi.demandbase.com/reporting/v1/usage?apiProduct=b2bApi \
--header "Authorization: Bearer $DB_API_KEY" \
--header "Accept: application/json"Read the response
{
"summary": {
"scope": "lifetime",
"totalCreditsAllocated": 50000,
"totalCreditsConsumed": 115,
"totalCreditsAvailable": 49885
}
}Request anatomy
Build the request from the method, path, parameters, and payload described below.
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
apiProduct | query | string | Required | API product name (e.g., b2bApi) |
Request body
This endpoint does not define a JSON request body.
Response anatomy
The endpoint returns 200 for the documented success case. Credit usage details fetched successfully.
The response schema does not enumerate fields; inspect the example response and status code.
Rules
- Use
GETwith the path/reporting/v1/usage. - Required inputs: apiProduct.
- Authenticate every request with a valid Demandbase access token.
- This endpoint does not require a JSON request body.
Filters
The published schema exposes the following endpoint inputs. Use the location column to place each value correctly.
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
apiProduct | query | string | Required | API product name (e.g., b2bApi) |
Errors
Handle non-success responses explicitly so your integration can report actionable failures.
| Status | Meaning |
|---|---|
400 | Bad Request |
401 | Unauthorized because the user is not authenticated. |