---
title: "Switch Workspace"
method: POST
path: "/api/workspaces/{workspace_id}/switch"
tags: ["workspaces", "workspaces"]
---

# Switch Workspace

`POST /api/workspaces/{workspace_id}/switch`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/workspaces/{workspace_id}/switch`
- Auth: none declared

Switch this browser session's active workspace.

Updates only `refresh_tokens.active_workspace_id` for the current session
(identified by the `sid` claim on the access token = JTI of paired refresh
token). Does NOT touch `users.default_workspace_id` — that's set at signup
and only changed via the explicit `POST /workspaces/{id}/set-as-default`
endpoint.

Multi-browser semantics: each browser has its own refresh token row, so
switching in one browser cannot affect any other browser session.

Returns a new access token with the new workspace_id embedded. The frontend
should refresh data after switching.

## Path parameters

- `workspace_id` integer, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/d84e7dc9977d?raw)
