Skip to content

Send OTP

POST /v1/verify/send

Generate and deliver a one-time password to a user's phone or email.

Request Body

ParameterTypeRequiredDescription
tostringYesRecipient phone (E.164) or email address.
channelstringNoDelivery channel: sms, whatsapp, email, or auto (default: auto).
lengthintegerNoNumber of digits in the OTP code (default: 6, range: 4–8).
ttlintegerNoTime-to-live in seconds (default: 300, range: 60–600).
brand_namestringNoYour app name, included in the message (e.g., "MyApp").
bash
curl -X POST https://sendapi.co/v1/verify/send \
  -H "Authorization: Bearer sk_live_123456789" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+447700900000",
    "channel": "auto",
    "length": 6,
    "ttl": 300,
    "brand_name": "MyApp"
  }'
javascript
const verification = await client.verify.send({
  to: '+447700900000',
  channel: 'auto',
  brand_name: 'MyApp'
});

// Store verification.id to pass to verify.check later
python
verification = client.verify.send(
    to="+447700900000",
    channel="auto",
    brand_name="MyApp"
)
php
$verification = $client->verify->send([
    'to' => '+447700900000',
    'channel' => 'auto',
    'brand_name' => 'MyApp'
]);

Response

json
{
  "id": "ver_01H9...AB",
  "to": "+447700900000",
  "channel": "whatsapp",
  "status": "pending",
  "expires_at": "2026-03-09T14:35:00Z",
  "created_at": "2026-03-09T14:30:00Z"
}

The OTP is delivered to the user. Store the id to pass to POST /v1/verify/check.

Delivered Message

The user receives a message like:

MyApp verification code: 847291

This code expires in 5 minutes. Do not share it with anyone.

Released under the MIT License.