Docs

Send an OTP

POST https://api.telrioz.com/api/v1/otp

Telrioz makes the code from the OTP Gateway's template (its {code}), sends it to one number and keeps it for POST /otp/verify. The code is 6 digits unless the Gateway sets another length, and it must fit in one SMS. While the account's Throttle is on, one number gets at most 5 OTPs a day (WIB).

Fallback. When the Gateway has one, and the first send ends Rejected or Error, or is not Delivered by fallbackAt, Telrioz sends the same code once more on the Gateway's second Route. It does not when the code was verified, or after 3 wrong codes. Each send is charged at its own Route's price, and the code then works for at least 5 more minutes. The second send is a message of its own: your webhook gets a message.status event for it too, with a message ID this call did not return. A slow receipt can start the second send, so one code can be paid for twice.

Authentication

Send your key in the header Authorization: Bearer YOUR_API_KEY. See Authentication.

Request body (JSON)
NameTypeDescription
torequiredstring

One number. Write it as 6281234567890, +62 812-3456-7890 or 081234567890: spaces, dashes and brackets are ignored, a leading + is dropped, a leading 0 becomes 62, and the result must be 8 to 15 digits. A number we cannot read answers 400.

fromstring

The Sender ID: 1 to 11 letters, digits, spaces or the characters . & -, or up to 15 digits. Anything else answers 400, on every Channel. Leave it out to send from the Gateway's Sender ID; it is required when the Gateway has none and its Channel takes one, and then it must be approved for the number's operator. A Channel that takes no Sender ID ignores a valid one: the upstream sends from its own number.

gatewaystring or integer

The ID of the Gateway to send through, as the dashboard shows it. Required with an API key. It must be an OTP Gateway. With a Gateway key, leave it out or give that Gateway's ID. The Gateway sets the Use case, Channel, Route and price, and must be active: a Gateway that is paused or deleted, named or behind a Gateway key, answers 400 invalid_request, gateway: unknown or paused.

Request examples

apiKey: With an API key
{
  "to": "6281234567890",
  "gateway": "12"
}
gatewayKey: With a Gateway key
{
  "to": "6281234567890"
}

Limits

See Limits.

Responses