PATCH /api/v1/admin/orgs/:slug/teams/:id
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/teams/:id
Section titled “PATCH /api/v1/admin/orgs/:slug/teams/:id”Authentication
Section titled “Authentication”Requires the following capability(ies):
projects:w
Middleware
Section titled “Middleware”Other middleware observed on this route (heuristic):
requireCapabilityadminBodyLimit
Description
Section titled “Description”PATCH /api/v1/admin/orgs/:slug/teams/:id — rename a team’s display name
and/or slug. The team’s id is IMMUTABLE — every audit_log row, projects.team_id
foreign key, and team_members composite-PK row references it. Renaming the
name is a pure display change; renaming the slug takes the same tenant-
scoped uniqueness gate as POST (the teams_tenant_slug_idx UNIQUE constraint
in mig 0036).
Audit: writes a team_renamed row of decision OK with structured
decisionReason: {event, team_id, before:{name,slug}, after:{name,slug}, by_user_id}
so the bridge in #569 Phase B can attribute the change to a specific actor.
#591 — uses the same projects:w cap as the rest of the team admin
surface (the issue body proposes teams:w but the capability vocabulary
doesn’t have a separate teams entry today — teams + projects share projects:w).
Responses
Section titled “Responses”HTTP 400
Section titled “HTTP 400”{ "error": "Invalid JSON body"}HTTP 400
Section titled “HTTP 400”{ "error": "Body must be a JSON object"}HTTP 400
Section titled “HTTP 400”{ "error": "Body must include at least one of `name` or `slug`"}HTTP 400
Section titled “HTTP 400”{ "error": "name must be a non-empty string ≤128 chars"}HTTP 400
Section titled “HTTP 400”{ "error": "slug must be lowercase, alphanumeric + hyphens, ≤128 chars"}HTTP 404
Section titled “HTTP 404”{ "error": "Org not found"}HTTP 404
Section titled “HTTP 404”{ "error": "Team not found for this org"}HTTP 200 (default)
Section titled “HTTP 200 (default)”{ "id": <member-expr>, "name": <member-expr>, "slug": <member-expr>, "changed": false}HTTP 409
Section titled “HTTP 409”{ "error": "Team with that slug already exists in this org"}HTTP 200 (default)
Section titled “HTTP 200 (default)”Shape not a JSON literal — passed through from a variable or expression. See source.
Source
Section titled “Source”- File:
src/admin/routes.ts - Line: 4941