GetOTP Documentation

OTP Verification Status

You can verify each OTP status via this endpoint.

OTP Verification Request

To verify OTP, make a GET request to our Verify OTP endpoint.

https://api.otp.dev/v1/verifications?code={code}

With the following Basic HTTP verification method:

DescriptionRequiredData TypeExample
Your API KeyYesStringmtbi2w4hlendfpxa1igthcu5p6mzxf7k

Note

With the following parameters:

NameDescriptionRequiredData TypeExample
codeThe code to verify. This is the code that was sent to the user.YesString1234
phoneThe phone number to verify. This is the phone number that was used to send the code.NoString60123456789

Examples

Below is an example request using cURL:

curl --request GET \
     --url 'https://api.otp.dev/v1/verifications?code=1234&phone=60123456789' \
     --header 'X-OTP-Key: {YOUR_API_KEY}' \
     --header 'accept: application/json'

The response would be a JSON structure, returned with HTTP 200 Codestatus code:

If the data is empty, it means the code is invalid.

{
  "data": [
    {
      "account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "message_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "phone": "60123456789",
      "create_date": "2025-08-18T00:00:00.000Z",
      "expire_date": "2025-08-18T02:00:00.000Z"
    }
  ],
  "pagination": {
    "number": 1,
    "size": 1,
    "total": 1
  }
}