Query Revenue Records
GET https://api.suger.cloud/ai/org/{orgId}/revenue/record-query
Returns this organization's revenue records as a page, with the total count alongside them, so page_size=1 answers "how many" without fetching the set. `q` filters with a parenthesised expression such as (= partner "AWS"); `s` sorts, defaulting to newest invoice date first. For a total or a breakdown, AggregateRevenueRecords groups in the database and returns the amounts directly.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
orgId | path | string | yes | Organization ID |
q | query | string | no | |
s | query | string | no | |
page_size | query | string | no | |
page_number | query | string | no |
Responses
200 — Paginated legacy Revenue records
Content-Type: application/json
400 — Invalid legacy Revenue request
Content-Type: application/json
Response fields:
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
detail | string | no |
403 — Missing Revenue permission
Content-Type: application/json
Response fields:
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
detail | string | no |
413 — Request body too large
Content-Type: application/json · Schema: RevenuePayloadTooLargeResponse
RevenuePayloadTooLargeResponse fields:
| Field | Type | Required | Description |
|---|---|---|---|
error | object | yes |
500 — Failed to query Revenue records
Content-Type: application/json
Response fields:
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
detail | string | no |
Example
Generated from this operation's schema. Values are placeholders —
substitute your own ids, and set SUGER_TOKEN to a bearer token
from the OAuth client-credentials exchange.
Request
curl -X GET 'https://api.suger.cloud/ai/org/{orgId}/revenue/record-query' \
-H "Authorization: Bearer $SUGER_TOKEN" Response — 200
{} Error — 400
{
"error": "string",
"detail": "string"
} View as Markdown · API reference overview
Spotted something wrong or out of date on this page? Tell us and we'll correct it.