Two-factor authentication
Set up two-factor authentication
POST
/api/2fa/setup/initiateStarts or replaces the current user's pending setup and returns a QR code and manual setup key for an authenticator app.
Headers
| Name | Type | Description |
|---|---|---|
| Authorizationrequired | string | Authentication credentials, e.g. Bearer <token>. |
Responses
200The operation completed successfully.
| Name | Type | Description |
|---|---|---|
| manualKeyrequired | string | Secret key for manually configuring an authenticator app. |
| qrCodeDataUrlrequired | string | Data URL of the QR code for authenticator setup. |
200 example
400Bad request.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
400 example
401Unauthorized.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
401 example
404Not found.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
404 example
503Service unavailable.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
503 example
Code samples
cURL