Rotate the session into another workspace

POST /api/v1/auth/switch-organization on the Caveman Cloud control plane. Requires the org:read scope. Not exposed to autonomous agents: Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant.

post/auth/switch-organization

Request

  • Base URL
    https://api.caveman.so/api/v1
  • URL
    https://api.caveman.so/api/v1/auth/switch-organization
  • Auth
    • OAuth 2
      Authorization code: /api/v1/oauth/authorize
      Token URL: /api/v1/oauth/token scopes: org:read
    • or HTTP bearer
    • or API key in cookie cave_access
    • or API key in cookie __Secure-cave_identity.session_token

Headers

x-cave-csrf'ui'

Required as ui for cookie-authenticated browser requests; omit for bearer Authorization requests.

Request body

organization_idstring uuid required

Response

Session rotated into the selected active membership.

access_tokenstring

Returned only to non-browser bearer clients; browser clients receive an HttpOnly cookie.

refresh_tokenstring

Returned only to non-browser bearer clients; browser clients receive an HttpOnly cookie.

Changes

No recorded changes to this operation across all 1 revision of this API.