Auth

Choose / switch workspace

Starts a new session in the chosen workspace without password or 2FA. Accepts the intermediate `pending_workspace` token (the chooser after login) and a full session («Switch to»). The token the request was made with stops working. The new access token carries the claim `ws` = the chosen workspace. Cookie auth (WBL-3265): session = the `b2t_access` cookie + `X-B2T-CSRF: 1`; the new pair is set as the HttpOnly cookies `b2t_access` / `b2t_refresh` and is NOT in the body.

POST
/api/v2/auth/workspace

Authorization

CookieSessionObject
b2t_access<token>

Session JWT in the HttpOnly cookie b2t_access, set by the login endpoints. Mutations also send the header X-B2T-CSRF: 1 (otherwise 403).

In: cookie

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/auth/workspace" \  -H "Content-Type: application/json" \  -d '{    "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c"  }'
{  "access_token": {    "expiresAt": {}  },  "refresh_token": {    "expiresAt": {}  }}
Empty
{  "message": {    "error": "Your request was made with invalid credentials."  }}
{  "message": {    "error": "You are not allowed to perform this action."  }}
{  "message": {    "error": "Oops! Something went wrong! Write to administrator. Your Request Id {f1177aee-9a99-42f0-a23f-4dd29fc39b65-672e0df972ccb}"  }}