---
title: "Switch the current user to a different organization."
method: POST
path: "/api/v1/settings/organizations/{org_id}/switch"
tags: ["Paramètres"]
---

# Switch the current user to a different organization.

`POST /api/v1/settings/organizations/{org_id}/switch`

## Request

- Base URL: `https://erp.eyeot.fr/api/v1`
- URL: `https://erp.eyeot.fr/api/v1/api/v1/settings/organizations/{org_id}/switch`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Switch the current user to a different organization.

    Multi-org refactor finalisé (2026-04-29) : délègue à
    `auth_service.switch_org` qui re-émet un pair de tokens avec
    `organization_id` dans le JWT claim (ferme F1). L'endpoint legacy
    reste disponible pour compat, mais le frontend doit migrer vers
    `POST /auth/switch-org` (appel front direct).

## Response `200`

Succès — payload `{data, meta}` (cf. API-GUIDE §3.1)

## Other responses

- `201`: Ressource créée. ID dans `data.id`.
- `400`: Validation Marshmallow échouée. `errors` détaille chaque champ invalide.
- `401`: JWT manquant, expiré ou révoqué.
- `404`: Ressource introuvable (ou cross-tenant — équivalent à hidden).
- `409`: État incohérent (email dupliqué, ressource déjà dans cet état, etc.).
- `422`: Validation Marshmallow échouée. `errors` détaille chaque champ invalide.
- `429`: Trop de requêtes. Honorer le header `Retry-After` (secondes).

---

[API](https://skmtc.dev/eyeot/apis/eyeot-erp-api.md) · [All operations](https://skmtc.dev/eyeot/apis/eyeot-erp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/eyeot/apis/eyeot-erp-api/revisions/42ab95222a89?raw)
