> ## Documentation Index
> Fetch the complete documentation index at: https://docs.causeloop.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Switch Org

> A3 — POST /v1/auth/switch-org {org_id}.

Verifies an ACTIVE org_membership, resolves the user's workspace + role in
the target org (403 if none), mints a new JWT (org + ws + staff claims),
and audits `auth.org_switched` (PLAN §4.2) against the NEW workspace (the
only natural audit_log anchor available — that table's workspace_id is
NOT NULL; there is no organization-only audit anchor).



## OpenAPI

````yaml /openapi.json post /v1/auth/switch-org
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/auth/switch-org:
    post:
      tags:
        - me
      summary: Switch Org
      description: >-
        A3 — POST /v1/auth/switch-org {org_id}.


        Verifies an ACTIVE org_membership, resolves the user's workspace + role
        in

        the target org (403 if none), mints a new JWT (org + ws + staff claims),

        and audits `auth.org_switched` (PLAN §4.2) against the NEW workspace
        (the

        only natural audit_log anchor available — that table's workspace_id is

        NOT NULL; there is no organization-only audit anchor).
      operationId: switch_org_v1_auth_switch_org_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwitchOrgRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwitchTokenResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    SwitchOrgRequest:
      properties:
        org_id:
          title: Org Id
          type: string
      required:
        - org_id
      title: SwitchOrgRequest
      type: object
    SwitchTokenResponse:
      properties:
        access_token:
          title: Access Token
          type: string
      required:
        - access_token
      title: SwitchTokenResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````