---
title: "Switch active workspace"
method: PATCH
path: "/v2/workspace/switch"
tags: ["Workspace"]
---

# Switch active workspace

`PATCH /v2/workspace/switch`

## Request

- Base URL: `https://api.village.ai`
- URL: `https://api.village.ai/v2/workspace/switch`
- Auth: HTTP bearer

Switch the active workspace to a team you belong to. Provide the team_id (graph team id). The server verifies your membership before switching and returns the newly active workspace. This is a persistent change to the account: it re-scopes every later Village call and also changes the active workspace in the Village web app until switched back. Fails with 403 if you are not a member of the target team.

## Request body

- SwitchWorkspaceRequest: Request body for switching the active workspace (graph team id)
  - `team_id` string, required

## Response `200`

Active workspace switched successfully

- object
  - `data` SwitchWorkspaceResponse, required: The newly active workspace after switching
    - `selected_team_id` string, required
    - `team` object, nullable, required
      - `id` string, required
      - `name` string, nullable, required
      - `logo` string, nullable, required
  - `metadata` object, required
    - `request_id` string, required

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - missing or invalid authentication
- `403`: You are not a member of this workspace

---

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