Open an MFA challenge
const url = 'https://work.optidata.cloud/api/mfa/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/request';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"is_2fa":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://work.optidata.cloud/api/mfa/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/request \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "is_2fa": true }'Creates a challenge the user must confirm from one of their registered devices.
The response carries mfa_pending_request: null — meaning no challenge
is needed — in two cases: is_2fa was true but the user has two-factor
login switched off, or the request is a generic identity confirmation and
the user has no confirmed device.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”UUID of the user to challenge.
Request Body
Section titled “Request Body”object
true for a login second factor, which is skipped when the
user has two-factor login disabled. Omit for a generic
identity confirmation.
IP address to record on the challenge.
User agent to record on the challenge.
Examples
{ "is_2fa": true}Responses
Section titled “ Responses ”The challenge, or null when none is required.
object
A challenge waiting to be confirmed from a registered device.
object
Public identifier of the request, used in paths.
Examples
Challenge opened
{ "mfa_pending_request": { "id": 908, "identifier": "mfr_7cf1a9d2", "user_id": 15, "status": "pending", "created_at": "2026-08-19T12:59:17.000000Z" }}No second factor needed
{ "mfa_pending_request": null}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The resource does not exist, or does not belong to the given drive.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "No query results for model [App\\Models\\Node] 99999999"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}