---
title: "Switch to a different organization."
method: POST
path: "/accounts/organizations/switch/"
tags: ["accounts"]
---

# Switch to a different organization.

`POST /accounts/organizations/switch/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/accounts/organizations/switch/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

Returns the target org's last-used workspace (from orgWorkspaceMap)
or its default workspace, so the frontend can update both contexts.

## Request body

- OrganizationSwitchRequest
  - `organization_id` string, uuid, required

## Response `200`

OK

- OrganizationSwitchResponse
  - `status` boolean, required
  - `result` OrganizationSwitchResult, required
    - `organization` OrganizationSummary, required
      - `id` string, uuid, required
      - `name` string, required
      - `display_name` string, required
      - `ws_enabled` boolean
    - `org_role` string, nullable, required
    - `org_level` integer, nullable, required
    - `workspace_role` string, nullable, required
    - `workspace` WorkspaceSummary
      - `id` string, uuid, required
      - `name` string, required
      - `display_name` string, required
      - `description` string
      - `is_default` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error
- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
