2FA

Create a 2FA Verification

Creates a 2FA verification and sends a one-time password (OTP) to the destination phone number over the selected channel. 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 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

Changed in 4 of the 50 revisions of this API.15

    • removed the optional property from the response with the status

      response-optional-property-removed

    This revision also has 42 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the endpoint scheme security bearerAuth was added to the API

      api-security-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • api operation id Createanew2FAVerification removed and replaced with two_fa_verification_create

      api-operation-id-removed

    • added to the response body allOf list for the response status

      response-body-all-of-added

    • removed from the response body allOf list for the response status

      response-body-all-of-removed

    This revision also has 163 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added