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. Take note that our OTP endpoint ends with a trailing slash:
https://otp.dev/api/verify/?code={code}
With the following Basic HTTP verification method:
Description | Required | Data Type | Example |
---|---|---|---|
Your API Key | Yes | String | mtbi2w4hlendfpxa1igthcu5p6mzxf7k |
Note
- Grab your API key from this page
With the following parameters:
Name | Description | Required | Data Type | Example |
---|---|---|---|---|
code | The code to verify. This is the code that was sent to the user. | Yes | String | 1234 |
phone | The phone number to verify. This is the phone number that was used to send the code. | No | String | 60123456789 |
Examples
Below is an example request using cURL:
curl --request GET \
--url 'https://otp.dev/api/verify/?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 Code
status 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
}
}