---
title: "Switch the caller's active organization."
method: POST
path: "/v1/me/org-switch"
tags: ["auth"]
---

# Switch the caller's active organization.

`POST /v1/me/org-switch`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/v1/me/org-switch`
- Auth: one of:
  - API key in cookie `dvt_session`
  - HTTP bearer

Changes the calling user's active organization for the current session (DVT-773). Validates the user holds an active membership in the target organization before re-sealing the `dvt_session` cookie with the new OrgID — cookie attributes (HttpOnly, Secure, SameSite=Strict) are identical to the login path. Also persists `default_org_id` so future logins land in the same org (DVT-767). Idempotent: switching to the already-active org is a 204 no-op (no cookie change). The client should reload after a successful (non-idempotent) switch so UI state reflects the new org context.

## Request body

- object
  - `orgId` string, uuid, required: The ID of the organization to switch to.

## Response `204`

Switch succeeded (or was idempotent). On a non-idempotent switch the response sets a new `dvt_session` cookie; the client must reload so UI state reflects the new org.

## Other responses

- `400`: Missing or invalid orgId.
- `401`: Missing, invalid, or expired session.
- `403`: The caller is not an active member of the target organization, or the organization is not active. Problem type `forbidden`.

---

[API](https://skmtc.dev/dvt/apis/dvt-rest-api.md) · [All operations](https://skmtc.dev/dvt/apis/dvt-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dvt/apis/dvt-rest-api/revisions/00016f504165?raw)
