Skip to content

POST /api/v1/admin/orgs/:slug/teams

This page is auto-generated from src/admin/routes.ts. Do not edit by hand — see docs/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.

Requires the following capability(ies):

  • projects:w

Other middleware observed on this route (heuristic):

  • requireCapability
  • adminBodyLimit

--- Teams ------------------------------------------------------------------

Teams sit between the org and its projects in the policy hierarchy (system → org → team → project). A team groups related projects so a platform/security team can set posture once for a group instead of project-by-project. config holds a PolicyPatch JSON; merged between org and project at request time (see middleware/org-api-key.resolveOrgContext). POST /api/v1/admin/orgs/:slug/teams — create a team. Body: { “slug”: “platform-sec”, “name”: “Platform Security”, “policies”?: } #336 — gated on projects:w (teams + projects share the projects capability; the team is just a policy-grouping layer above projects).

{
"error": "Invalid JSON body"
}
{
"error": "Body must be a JSON object"
}
{
"error": "slug is required (lowercase, alphanumeric + hyphens, ≤128 chars)"
}
{
"error": "name is required (1..128 chars)"
}
{
"error": "Org not found"
}
{
"error": <member-expr>
}
{
"error": "Team with that slug already exists in this org"
}
{
"team": <member-expr>
}
  • File: src/admin/routes.ts
  • Line: 4807