Skip to content

staff.confirmations ​

1 method on staff.confirmations. Each returns the answer's data and throws NoviqaError on a failed answer.

create ​

POST/admin/v1/confirmations

Get a confirmation code

Confirm dangerous actions (MT5): for staff holding the confirm_actions right, a balance operation (single or bulk) and a bulk close run only with a fresh code. This answers a random 6-digit code for the user to type and its token; send both back as confirm_token / confirm_code with the action. A code is single-use, belongs to the caller, lives expires_in seconds (120) and allows 3 wrong tries. Without the right the actions need nothing (and this route is refused). No body.

More details

Rights: the staff member needs every one of: confirm_actions.

Returns
Promise<Confirmation>
The answer's data.
Errors
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.confirmations.create()
bash
curl -X POST "$NOVIQA_API_URL/admin/v1/confirmations" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "code": "string",
    "expires_in": 1,
    "token": "string"
  },
  "request_id": "5b7f2c1e"
}
ts
staff.confirmations.create(options?: RequestOptions): Promise<account.Confirmation>