Request Body
The phone number to verify. Include country code (e.g., +14155551234)
Custom message template. Use {code} for the code and {minutes} for expiry time.
Default: "Your verification code is: {code}. Valid for {minutes} minutes."
Length of the verification code (4-8 digits). Default: 6
How long the code is valid (1-60 minutes). Default: 10
Custom metadata to store with the verification
Response
The normalized phone number
ISO 8601 timestamp when the code expires
Examples
Basic OTP
curl -X POST https://www.unosend.co/api/v1/sms/verify/send \
-H "Authorization: Bearer un_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"phone": "+14155551234"
}'
Custom Template
curl -X POST https://www.unosend.co/api/v1/sms/verify/send \
-H "Authorization: Bearer un_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"phone": "+14155551234",
"template": "Your Acme login code: {code}",
"code_length": 4,
"expiry_minutes": 5
}'
Response Example
{
"id": "ver_abc123",
"phone": "+14155551234",
"status": "sent",
"expires_at": "2025-01-02T15:30:00.000Z"
}
Rate Limits
- One active verification per phone number per organization
- Sending a new code invalidates any existing pending codes
Use Cases
- User signup phone verification
- Two-factor authentication (2FA)
- Password reset verification
- Transaction confirmation
- Account recovery