Skip to main content
POST
Send Verification Code

Request

Send a one-time password to a recipient via your chosen channel.

Headers

string
required
Bearer token with your API key: Bearer YOUR_API_KEY
string
required
Must be application/json

Body Parameters

string
required
Communication channel for the verification code. Must be one of: sms, email, or voice
string
required
Recipient address:
  • For SMS/Voice: E.164 formatted phone number (e.g., +1234567890)
  • For Email: Valid email address (e.g., [email protected])
string
Custom message template. Use {code} as a placeholder for the verification code.Default: "Your verification code is: {code}"Example: "Your Acme Corp verification code is: {code}. Valid for 5 minutes."
string
Email subject line (only used when channel is email)Default: "Your Verification Code"Example: "Verify Your Acme Corp Account"
integer
Code expiration time in seconds. Must be between 60 and 3600.Default: 300 (5 minutes)
string
Custom verification code. Must be a numeric string between 4-10 digits.If not provided, a code will be automatically generated with a length defined in your account settings.Example: "123456"

Response

boolean
Always true for successful requests
string
Unique identifier for this verification. Use this when calling the verify endpoint.Example: "11f951d5-32d1-4b49-bdda-7da248e2615c"
string
ISO 8601 timestamp when the code expiresExample: "2024-01-01T12:05:00.000Z"
string
Unique request identifier for debuggingExample: "7b4d6022-7260-4568-b6b7-29c366c47bbc"

Examples

Success Response

Error Responses

Rate Limiting

This endpoint enforces per-recipient rate limits to prevent spam and abuse:
  • 2 sends per minute per recipient
  • 15 sends per hour per recipient
  • 50 sends per 24 hours per recipient
When you exceed these limits, you’ll receive a 429 response with a retry_after field indicating how many seconds until you can retry.
In addition to per-recipient limits, API keys are also rate limited to 120 requests per minute across all endpoints. Test recipients (like +15555550100) are exempt from per-recipient limits but still count toward your API key limits. See the Rate Limits section for more details.

Best Practices

Keep messages clear and branded: Include your app name in the message so users know where the code is coming from.Good: "Your Acme Corp verification code is: {code}"Bad: "{code}"
Set appropriate expiration times:
  • SMS/Voice: 2-5 minutes (users typically verify immediately)
  • Email: 10-15 minutes (users may need to open their email client)
Phone number format: Phone numbers must be in E.164 format (starting with + and country code). Invalid formats will be rejected.
Message length limits:
  • SMS: 160 characters recommended
  • Email: No hard limit, but keep it concise
  • Voice: Keep under 50 characters for best experience

Credits Consumed

Each send request consumes 1 credit regardless of the channel: Failed sends do not consume credits.