Set Plan Quota
set_plan_quotaAdd or update a per-metric usage quota on a plan (idempotent by metric: an existing quota for that metric is replaced, others kept). Before writing app code that consumes this, call get_integration_guide with topic=billing and the framework the app uses. Seats: name the limit (e.g. seats), kind gauge, source membership; Bridge counts the workspace's active members, pending invites included. Enforce it where invites happen: the built-in team page with its seat-limit setting, or @RequireQuota on the app's own invite handler. Never a flag or an entitlement. Count usage once, where the action happens: ask the developer whether the action calls their server. If it does, the backend decorator (@RequireQuota) counts it. If it does not, the browser reports it (bridge.usage.report / set) with on the button; that is a complete, first-class setup. Never count one metric in both places. limit is the included units (0 = metered from unit 1); policy ("hard" blocks at the limit; "metered" bills each unit above it and needs priceAmount > 0 per unit and a currency — priceCurrency defaults to the plan's one price currency). Hard quotas must NOT carry priceAmount. A quota is for something counted. An on/off feature the plan sells (analytics, SSO, export) belongs in the plan's features, set with add_plan_feature — not a hard quota with limit 1. kind: "counter" (default) sums events per billing period and resets (API calls, emails sent); "gauge" is an absolute value the app sets, never reset (projects, tickets, storage). If deleting it frees room, it's a gauge and your app counts it; if it happened, it's a counter and Bridge counts it. A gauge cannot be metered. source "membership" (gauge only) makes Bridge count the workspace's active members; omitting source keeps an existing gauge's, null removes it. Omitting kind keeps an existing quota's kind. list_plan_quotas shows every metric name and its kind; remove_plan_quota deletes one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Id of the Bridge app to act on for this call (see list_apps). Omit to use the current app. | |
| key | Yes | Plan KEY (see list_plans). | |
| kind | No | counter (default) = summed per billing period; gauge = absolute value the app sets, never reset. If deleting it frees room, it's a gauge and your app counts it; if it happened, it's a counter and Bridge counts it. | |
| limit | Yes | Included units. 0 = pure per-unit metered (billed from unit 1). | |
| metric | Yes | Metric KEY the app reports usage against, e.g. "projects". Reuse the names list_plan_quotas shows. | |
| policy | Yes | hard blocks at the limit; metered keeps going and bills each unit above it. | |
| source | No | membership = Bridge counts the workspace's active members (pending invites included); the app never reports it. Gauge + hard only. Use it for seats. null removes it. | |
| priceAmount | No | Per-unit price for metered quotas (required with policy=metered). | |
| priceCurrency | No | Currency for the metered price (defaults to the plan's price currency when unambiguous). |