2FA

Create a 2FA Verification

Changed on

Creates a 2FA verification and sends a real one-time password (OTP) to the destination phone number over the selected channel; this bills the account per OTP sent. Requires a 2FA service configured in the Wavix portal; the service is reused to generate and validate OTPs.

The verification proceeds through three steps:

  1. Create a verification to generate and send an OTP.
  2. Resend the OTP on the same verification if needed.
  3. Validate the OTP through the check endpoint.
post/v1/two-fa/verification

Request

  • Base URL
    https://api.wavix.com
  • URL
    https://api.wavix.com/v1/two-fa/verification
  • Auth
    HTTP bearer

Request body

service_idstring required

Unique Wavix 2FA Service ID. Available on the Wavix portal.

tostring required

End user's phone number to which the verification code will be sent. The phone number must be in E.164 format.

channelstring required

Channel used to deliver the verification code. One of sms (sent as a text message) or voice (read aloud over a phone call).

Example request

{
  "service_id": "7204a030201211ee9fb47d093f2f127c",
  "to": "447919433768",
  "channel": "sms"
}

Response

Returns the created 2FA verification.

successboolean required

Indicates whether the 2FA Verification was successfully created

service_idstring required

Unique identifier of the Wavix 2FA Service

session_urlstring required

Automatically generated 2FA Verification URL. The URL can be used to resend or validate the OTP.

session_idstring required

Unique identifier of the Wavix 2FA Verification

destinationstring required

The end user's phone number.

created_atstring date-time required

Date and time the 2FA Verification is created

Example response

{
  "success": true,
  "service_id": "7204a030201211ee9fb47d093f2f127c",
  "session_url": "https://api.wavix.com/v1/two-fa/verification/2953d4308f2e11ecb75fcdafd6d2d687",
  "session_id": "2953d4308f2e11ecb75fcdafd6d2d687",
  "destination": "447919433768",
  "created_at": "2022-02-16T13:41:38.000Z",
  "number_lookup": {
    "number_type": "mobile",
    "country": "GB",
    "current_carrier": "Vodafone"
  }
}

Changes

    • breaking

      the response's body type changed from no type to object for status

    • info

      removed subschema #2 from the response body allOf list for the response status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • warning

      removed the optional property from the response with the status