← Back to APIs

OTP API

Secure one-time password verification for authentication.

Base URL

https://api.tellicai.com/v1
POST/otps

Send OTP

Send a one-time password to a phone number.

Parameters

NameTypeDescription
tostringPhone number in E.164 format
lengthintegerOTP length (4-8, default: 6)

Example

curl -X POST https://api.tellicai.com/v1/otps -H "Authorization: Bearer YOUR_API_KEY" -d "to=+1234567890" -d "length=6"

Response

{
  "id": "otp_xyz789",
  "status": "pending",
  "expires_at": 1710000300
}

POST/otps/:id/verify

Verify OTP

Verify the OTP code entered by the user.

Parameters

NameTypeDescription
codestringThe OTP code entered by the user

Example

curl -X POST https://api.tellicai.com/v1/otps/otp_xxx/verify -H "Authorization: Bearer YOUR_API_KEY" -d "code=123456"

Response

{
  "id": "otp_xyz789",
  "status": "verified",
  "valid": true
}