API docs
Send a code
Already generate your own OTP? Send it with one call and OTPRelay delivers it from the pre-cleared sender, with automatic route and operator failover and SMS-pumping protection. You verify the code on your side.
/v1/messagesYou generate the OTP; OTPRelay just delivers it. POST the to number and the code you generated, and we wrap it in the pre-cleared template and send the SMS from the OTPRelay sender, with automatic route and operator failover. The response is a message object with status: "sent".
The sender is always OTPRelay and the message template is fixed - your code is injected into the same template described in Sender & message, with the same SMS-pumping protection as the Verify API.
Request body
tostringrequired- The destination phone number in E.164 format, e.g.
+966512345678. codestringrequired- The one-time passcode you generated, 4-10 characters. OTPRelay delivers it as-is inside the pre-cleared template - it never generates or checks it.
webhook_urlstringoptional- An HTTPS URL to receive this message's delivery events. See Webhooks & events.
metadataobjectoptional- Up to 10 key/value pairs echoed back on the message and its webhook events.
Request
Response
Returns 201 Created with the message. Track delivery via the status field - pending, sent, delivered, or undelivered - and your webhook_url, including any automatic route failover.
You own verification
New here? Start with the Quickstart.