List spend caps and this month's spend under each
Every spend cap of the organization: its own, its projects', its projects' defaults for their end users and each end user's, with the month's spend as last worked out (`spent_cents`, as of `spent_as_of`).
GET/v1/spend_caps
Every spend cap of the organization: its own, its projects', its projects' defaults for their end users and each end user's, with the month's spend as last worked out (spent_cents, as of spent_as_of). A key sees its own project's caps and the organization's.
A key with the usage:read scope.
Request
curl "https://api.pod.mapier.ai/v1/spend_caps" \
-H "Authorization: Bearer $POD_API_KEY"Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
project | query | string | No | Only this project's caps, its end users' and the organization's. A key sees only its own. |
scope | query | "organisation" | "project" | "end_user" | "end_user_default" | "member" | No | Only caps of this scope. |
limit | query | integer | No | |
cursor | query | string | No | The next_cursor of the page before. Valid for 24 hours. |
Answer
200. A page of caps, the most recently set first.
{
"data": [
{
"scope": "organisation",
"target": "example",
"amount_cents": null,
"on_reach": "refuse",
"currency": "example",
"period": "example",
"spent_cents": null,
"spent_as_of": null,
"reached": false,
"set_by": null,
"set_at": null
}
],
"next_cursor": null
}| Field | Type | Always | What it is |
|---|---|---|---|
data | SpendCap[] | Yes | |
next_cursor | string | null | Yes |
Errors
The refusals this call is known for: invalid, forbidden. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | pod.spendCaps.list() |
| Python | pod.spend_caps.list() |