Read everything that can refuse a create or a wake

The plan, the trust tier and its caps, the organization's and the project's limits (staff's), the end user's (with `end_user`), the free plan's allowance left, the spend caps reached this month, and for each size whether a create would be refused now and why (`blocked_reason`).

GET/v1/limits

The plan, the trust tier and its caps, the organization's and the project's limits (staff's), the end user's (with end_user), the free plan's allowance left, the spend caps reached this month, and for each size whether a create would be refused now and why (blocked_reason). Read from the organization's signed standing entry, exactly as the gateway enforces it. A key reads its own project; a person names one (project) or reads the organization's alone. How many sandboxes are held and awake now (counts) is the registry's, and is null until the account service reads it; quota_exceeded is then named only for a limit of 0. With the usage store down the allowance's numbers are null and everything else still answers.

A key with the usage:read scope.

Request

curl "https://api.pod.mapier.ai/v1/limits" \
  -H "Authorization: Bearer $POD_API_KEY"

Parameters

NameInTypeRequiredWhat it is
projectquerystringNoThe project whose limits to read. A key's own by default, and the only one it may name.
end_userquerystringNoAlso the limits, policy and state of this end user of the project.
Pod-End-UserheaderstringNoNarrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering not_found, and a create is labelled with it. An end user of another project, or one that is not there, is not_found; a suspended one refuses creates and wakes (account_restricted).

Answer

200. The limits.

200
{
  "organisation": "org_3ahrz6dmv29gqy5ckt18fp",
  "project": null,
  "plan": "invited",
  "trust_tier": "new",
  "standing": "good",
  "tier_caps": null,
  "organisation_limits": {
    "max_sandboxes": null,
    "max_awake": null
  },
  "project_limits": null,
  "end_user": null,
  "counts": {
    "held": null,
    "awake": null
  },
  "allowance": null,
  "spend_caps_reached": [
    {
      "scope": "organisation",
      "target": "example",
      "on_reach": "refuse",
      "period": "example"
    }
  ],
  "sizes": [
    {
      "size": "small",
      "blocked_reason": null
    }
  ]
}
FieldTypeAlwaysWhat it is
organisationstringYes
projectstring | nullYes
plan"invited" | "free" | "pro"Yes
trust_tier"new" | "verified" | "established" | "contract"Yes
standing"good" | "past_due" | "suspended" | "closed"YesThe organization's standing; past due and suspended answer account_restricted on creates and wakes, and closed (its owner closed it) on every call.
tier_capsTierCaps | nullYesThe trust tier's caps; null on an invited or contract organization, whose limits staff set.
organisation_limitsCountLimitsYesSandboxes held and awake; null is no limit of this scope.
project_limitsCountLimits | nullYes
end_userAccountLimitsEndUser | nullYes
countsSandboxCountsYesHow many sandboxes are held and awake now; null until the account service reads the registry.
allowanceBillingAllowance | nullYesThe free plan's allowance this month, with what is left; null on any other plan.
spend_caps_reachedReachedSpendCap[]YesSpend caps reached this month that count for this project, end user and caller.
sizesSizeAvailability[]YesEach size, and why a create of it would be refused now.

Errors

The refusals this call is known for: invalid, forbidden, not_found. 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.limits.get({ … })
Pythonpod.limits.get(…)