Auth

Sign in — second factor (e-mailed code)

Step two of a 2FA login: the code from the e-mail, or — when an authenticator is enrolled — the code it shows. Session: the `pending_2fa` token from login (the `b2t_access` cookie); the caller must hold the `2fa` role. With a proven authenticator the login completes (`200`, session pair; `refresh_token: null` and the `pending_workspace` token for two or more workspaces). Without one: `202` with a token that opens authenticator enrolment. A code is good for one attempt. Same contract as `POST /api/v1/auth/authenticate`. Cookie auth (WBL-3265): the tokens are set as the HttpOnly cookies `b2t_access` / `b2t_refresh` and are NOT in the body. Session: the `b2t_access` cookie + `X-B2T-CSRF: 1`.

POST
/api/v2/auth/authenticate

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

curl -X POST "https://example.com/api/v2/auth/authenticate" \  -H "Content-Type: application/json" \  -d '{    "email": "string",    "auth_code": "123456"  }'
Empty
Empty
Empty
{  "message": {    "error": "Your request was made with invalid credentials."  }}
Empty
Empty
Empty