PATCH /api/v1/admin/orgs/:slug/tier
This page is auto-generated from
src/admin/routes.ts. Do not edit by hand — seedocs/dev/docs-auto-sync.md.
:warning: Heuristic extraction — not a contract. Response shapes below are mined from
c.json(...)literals in the handler via an AST walker. Computed fields, ternaries, and non-literal returns are shown as placeholders. Refer to the linked source file for the authoritative behaviour.
PATCH /api/v1/admin/orgs/:slug/tier
Section titled “PATCH /api/v1/admin/orgs/:slug/tier”Authentication
Section titled “Authentication”Requires the following capability(ies):
billing:w
Middleware
Section titled “Middleware”Other middleware observed on this route (heuristic):
requireCapabilityadminBodyLimit
Description
Section titled “Description”PATCH /api/v1/admin/orgs/:slug/tier — #216. Sets the org’s tier. Validates
against the enum; on a real change, emits a tier_changed audit row with
from→to so billing/compliance can trace every tier movement.
Why this is its own endpoint rather than folded into a generic org-update: tier is the single billing-sensitive field; isolating its audit + RBAC surface (once #116 lands) keeps the trail unambiguous. #336 — gated on billing:w (tier == billing plan; owner-only by default).
Responses
Section titled “Responses”HTTP 400
Section titled “HTTP 400”{ "error": "Invalid JSON"}HTTP 400
Section titled “HTTP 400”{ "error": <template-string>}HTTP 404
Section titled “HTTP 404”{ "error": "Org not found"}HTTP 200 (default)
Section titled “HTTP 200 (default)”{ "id": <member-expr>, "slug": <member-expr>, "tier": <tier>}Source
Section titled “Source”- File:
src/admin/routes.ts - Line: 4339