Verify API
Last updated
Last updated
The verification API allows you to verify if a user currently has access to a given phone number or email address, by sending them an OTP and asking them to verify the code that was sent to them.
This can be achieved by using the following API endpoints below.
Currently, verify only supports Email, WhatsApp and SMS
In order to send a message you must have an active channel and perform an HTTP request to the following endpoint with a valid .
Here is an example of a basic verify request body for SMS
You can use Steps to implement a failover strategy between different channels. The minimum amount of steps is one. Calling the failover endpoint will cause it to move to the next step.
Verify supports using templates for some channels. The following is an example of using a channel with a template.
SMS does not support templates. For SMS, the body is generated by the verify API. You can however change the language by setting the locale of the verification. Supported languages include:
Afrikaans
Arabic
German
English
Spanish
French
Italian
Dutch
Polish
Portuguese
Russian
Turkish
For emails, templates work just as you would expect via the channels API, with the addition of a variable for the Verify OTP Code.
When setting up a template for Email, select {}
-> Verify
-> OTP
from the list of variables
Templates for WhatsApp channels are required. In order to send an OTP message to a WhatsApp channel, you need to have an Authentication Template set up.
Once you have received a code from one of your users you will have to confirm if the code is valid.
Using the following endpoint, you can also resend a message for a given verification step.
By not setting a value for stepIndex
, it will default to the currently active step.
You can failover to another verification step by calling the following endpoint.
By not setting a value for stepIndex
, it will default to the next step in the array.