Supercheck LogoSupercheck
Organizations API

Leave the current organization

Leave the active organization as a non-owner using an interactive browser session and a same-origin request. Removes the caller's membership and project assignments, clears this organization's selected context from all their sessions, and records member_left in the audit log. Owners must transfer ownership or delete the organization. Project-scoped CLI tokens receive 403. The supplied organization ID must match the active organization resolved from the session; stale confirmations receive 409.

POST
/api/organizations/leave

Authorization

sessionCookie
cookiebetter-auth.session_token<token>

Interactive Better Auth browser session. Secure deployments may use the __Secure- cookie prefix.

Request Body

application/json
  1. body
organizationId*string

The organization being confirmed; must match the active session organization.

Formatuuid

Response Body

Organization left; reload to select a remaining membership or complete personal setup.

application/json
  1. response
success?boolean
data?
Example Request
curl -X POST 'https://demo.supercheck.dev/api/organizations/leave' \  -H 'Content-Type: application/json' \  -d '{  "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9"}'
Example Response
{  "success": true,  "data": {    "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9"  }}