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

# Switch user organisation



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/org/organisation/switch
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/org/organisation/switch:
    post:
      tags:
        - Organisation API
      summary: Switch user organisation
      operationId: switch_organisation_endpoint_api_v1_org_organisation_switch_post
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwitchUserOrganisationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwitchUserOrganisationResponse'
          description: Organisation switched successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - switch not permitted
        '404':
          description: User or organisation not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: Server error
components:
  schemas:
    SwitchUserOrganisationRequest:
      properties:
        organisation_id:
          description: Target organisation ID to switch to
          example: 550e8400-e29b-41d4-a716-446655440000
          format: uuid4
          title: Organisation Id
          type: string
      required:
        - organisation_id
      title: SwitchUserOrganisationRequest
      type: object
    SwitchUserOrganisationResponse:
      properties:
        message:
          description: Response message
          example: User switched to organisation
          title: Message
          type: string
        success:
          description: Whether the switch was successful
          example: true
          title: Success
          type: boolean
      required:
        - success
        - message
      title: SwitchUserOrganisationResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        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

````