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

NameInTypeRequiredWhat it is
projectquerystringNoOnly this project's caps, its end users' and the organization's. A key sees only its own.
scopequery"organisation" | "project" | "end_user" | "end_user_default" | "member"NoOnly caps of this scope.
limitqueryintegerNo
cursorquerystringNoThe next_cursor of the page before. Valid for 24 hours.

Answer

200. A page of caps, the most recently set first.

200
{
  "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
}
FieldTypeAlwaysWhat it is
dataSpendCap[]Yes
next_cursorstring | nullYes

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

ClientCall
TypeScriptpod.spendCaps.list()
Pythonpod.spend_caps.list()