POST /api/v1/admin/orgs/:slug/bind-stytch-org
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.
POST /api/v1/admin/orgs/:slug/bind-stytch-org
Section titled “POST /api/v1/admin/orgs/:slug/bind-stytch-org”Authentication
Section titled “Authentication”Requires the following capability(ies):
members:w
Middleware
Section titled “Middleware”Other middleware observed on this route (heuristic):
requireCapabilityrequireSensitiveOpadminBodyLimit
Description
Section titled “Description”--- Stytch org → tenant binding (PR 3c, #382) -----------------------------
POST /api/v1/admin/orgs/:slug/bind-stytch-org DELETE /api/v1/admin/orgs/:slug/bind-stytch-org
Manual one-shot bind/unbind of a Stytch organization id to an Upwarden
tenant. Drives the “Identity & SSO” panel on the org-detail page and the
default-tenant bootstrap path called out in #376 decision 2.
Capability: members:w — same as the role-overrides endpoints. Stytch
binding IS an identity-management surface, so semantically the closest
fit in the existing vocabulary is sso:w; we route through members:w
instead because (a) admin-token holders satisfy every capability anyway
(#382 decision 4) and (b) sso:w is gated on the sso tier feature,
which the prod default tenant on the free tier does NOT have — gating
on sso:w would refuse the bind on exactly the tenant the acceptance
criterion targets. The members:w cap is gated on members_basic,
which IS in free, so the route stays callable for the default-tenant
bootstrap. Same trade-off the role-overrides endpoints make.
Responses
Section titled “Responses”HTTP 404
Section titled “HTTP 404”{ "error": "Org not found"}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": "stytch_org_id is required"}HTTP 400
Section titled “HTTP 400”{ "error": "stytch_org_id must be non-empty"}HTTP 400
Section titled “HTTP 400”{ "error": "stytch_org_id exceeds 256 chars"}HTTP 500
Section titled “HTTP 500”{ "error": "Internal error"}HTTP 409
Section titled “HTTP 409”{ "error": "stytch_org_id_already_bound", "holder_tenant_slug": <member-expr>}HTTP 200
Section titled “HTTP 200”{ "slug": <member-expr>, "stytch_org_id": <trimmed>}Source
Section titled “Source”- File:
src/admin/routes.ts - Line: 600