Sign inGet Started

List workspace quotas

GET
/v1/workspace/quotas
const { data } = await bird.workspace.quotas.list();
for (const quota of data) {
  console.log(quota.key, quota.limit, quota.organization_limit);
}
Odpowiedź200
{
  "data": [
    {
      "key": "email_mailboxes_max",
      "unit": "mailboxes",
      "kind": "counted",
      "enforcement": "create",
      "organization_source": "default",
      "workspace_limit": {
        "status": "active"
      },
      "usage": {
        "status": "available"
      }
    }
  ],
  "configuration": "available"
}

Returns each resource and value quota as it applies to the current workspace: the organization limit shared by all workspaces, the workspace's own limit when one is set, and this workspace's current usage. Organization usage and shared remaining capacity are withheld: organization_used, organization_remaining and remaining are always null on this endpoint.

A workspace limit is a ceiling, not reserved capacity. Each quota's enforcement says how both limits apply: create refuses a creation that would pass either one, outbound_send refuses outbound sends once the bytes already held reach either one, and value bounds a setting when it is chosen. usage is null for a value quota. When usage cannot be read, usage.status is unavailable and the counts are null.

Treść odpowiedzi

data
array of object
wymagane
Pokaż atrybuty podrzędne
data.key
string
wymagane

Stable key of the quota.

data.name
string
wymagane
data.description
string
wymagane
data.unit
string
wymagane

What the limit counts, such as mailboxes, bytes or days.

data.kind
string
wymagane

What the quota limits.

  • counted: an amount the workspace accumulates, such as mailboxes or stored bytes. Usage is reported.
  • value: the largest setting a resource may be given, such as a retention period. No usage is counted.

Possible values: counted, value

data.enforcement
string
wymagane

When the limits are applied.

  • create: a request that would add more than the limits allow is refused, and nothing is created.
  • outbound_send: sending is refused once the bytes already stored reach a limit. The size of the message being sent is not counted in advance, and incoming mail is still accepted.
  • value: a setting above the limit is refused when it is chosen. Existing resources keep their settings.

Possible values: create, outbound_send, value

data.maximum_value
integer
wymagane

The largest workspace limit this quota accepts, in its unit.

data.organization_limit
integer
wymagane

The organization's limit, shared by all its workspaces.

data.organization_source
string
wymagane

Where the organization limit comes from.

  • default: Bird's standard limit.
  • plan: the organization's plan.
  • override: a limit Bird set for the organization.

Possible values (may grow over time): default, plan, override

data.workspace_limit
nullable object
wymagane

The workspace's own limit. null when the workspace has none and uses only the shared organization limit.

Pokaż atrybuty podrzędne
data.workspace_limit.value
integer
wymagane

The workspace limit, in the quota's unit. It can exceed the organization limit. Zero allows nothing more.

data.workspace_limit.status
string
wymagane

Whether the workspace limit applies.

  • active: the limit applies alongside the organization limit.
  • expired: the limit passed its expiry and no longer applies. It stays visible until it is replaced or removed.

Possible values: active, expired

data.workspace_limit.expires_at
nullable string
wymagane

When the workspace limit stops applying. null means it has no expiry.

data.workspace_limit.updated_at
string
wymagane

When the workspace limit was last set.

data.limit
integer
wymagane

The lower of the organization limit currently applied to requests and any active workspace limit. The applied organization limit can briefly differ from the configured organization_limit after a change. A request can still be refused below this value when other workspaces use the shared organization limit.

data.usage
nullable object
wymagane

Current usage. null for a value quota, which counts nothing.

Pokaż atrybuty podrzędne
configuration
string
wymagane

Whether workspace limits can be set.

  • available: workspace limits can be set and changed.
  • unavailable: new workspace limits cannot be set in this region yet. Existing workspace limits still apply and can be removed.

Possible values: available, unavailable

Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.