OTP

Verify a code

Checks a code the user entered. Returns valid, invalid or expired. After 5 wrong attempts the code is locked.

POST
/v1/otp/verify

Checks a code the user entered. Returns valid, invalid or expired. After 5 wrong attempts the code is locked.

Authorization

bearer
headerAuthorizationBearer <JWT>

Your secret API key: sk_live_… for live traffic or sk_test_… for testing.

Request Body

application/json
  1. body
id?string

The OTP ID returned when the code was sent. Provide this or to.

to?string

The phone number the code was sent to. Verifies the latest code for that number.

Lengthlength <= 32
code*string

The code the user entered.

Match^\d{4,8}$

Response Body

The result of the check.

application/json
Example Request
curl -X POST 'https://api.appstractone.com/v1/otp/verify' \
  -H 'Content-Type: application/json' \
  -d '{
  "code": "102028"
}'
Example Response
{
  "status": "valid"
}