Skip to content

POST /api/v1/admin/orgs/:slug/bind-stytch-org

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.

POST /api/v1/admin/orgs/:slug/bind-stytch-org

Section titled “POST /api/v1/admin/orgs/:slug/bind-stytch-org”

Requires the following capability(ies):

  • members:w

Other middleware observed on this route (heuristic):

  • requireCapability
  • requireSensitiveOp
  • adminBodyLimit

--- 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.

{
"error": "Org not found"
}
{
"error": "Invalid JSON body"
}
{
"error": "Body must be a JSON object"
}
{
"error": "stytch_org_id is required"
}
{
"error": "stytch_org_id must be non-empty"
}
{
"error": "stytch_org_id exceeds 256 chars"
}
{
"error": "Internal error"
}
{
"error": "stytch_org_id_already_bound",
"holder_tenant_slug": <member-expr>
}
{
"slug": <member-expr>,
"stytch_org_id": <trimmed>
}
  • File: src/admin/routes.ts
  • Line: 600