Skip to content

Create a verify code

POST
/verify_codes

Initiates a verification process by creating a new verify code with a specified routing strategy.

Media type application/json

Verify code write payload. Creates a new verification code request with a multi-step routing strategy.

object
phone
required

Recipient phone number in international format (e.g. +491701234567).

string
>= 5 characters <= 30 characters
code

Custom verification code. If not provided, a random numeric code is generated automatically based on code_length.

string | null
>= 4 characters <= 8 characters
code_length

Length of the auto-generated verification code. Used only when code is not provided. Default: 4.

integer | null
default: 4 >= 4 <= 8
lang

Language for the default message template. Determines the language of the auto-generated SMS/Voice text when no custom template is provided. Not applicable for the telegram channel — Telegram always sends a system message in the language of the user’s Telegram app.

string
default: DE
Allowed values: EN DE FR IT ES PL NL RO PT CS HU SV DA FI SK HR TR RU BG UK
payload

Custom data that will be stored with the verification code and returned in webhook events. Useful for correlating verification requests with your internal systems.

string | null
<= 128 characters
is_code_deleted

If true, the verification code will be deleted from storage after it has been sent to the recipient. Default: false.

boolean | null
routing_strategy
required

Ordered list of delivery channels. Each step defines a channel to attempt. If a channel fails or times out, the next step is tried. At least one step is required. The sms channel can only be the last step. Duplicate channels are not allowed.

Array<object>
object
channel
required

Delivery channel for this step.

string
Allowed values: telegram voice sms
timeout_sec

Time in seconds to wait for a response from this channel before falling back to the next step. Only applicable for the telegram channel. If not set, a system default is used.

integer | null
default: 30 >= 30 <= 3600
sender_id

Sender identifier for SMS and Voice channels. For SMS, this is the sender phone number or alphanumeric ID displayed on the recipient’s device. Validated against your account’s allowed sender IDs.

string | null
template

Custom message template for sms or voice channels. Use {{code}} as a placeholder for the verification code. If not provided, a default translated template is used based on the lang field. For voice channel, the text is automatically wrapped in SSML <speak> tags. Ignored for telegram channel.

string | null
<= 70 characters
Examples

Verify code with multi-channel routing

Create a verification code with a 3-step routing strategy: Telegram, Voice, and SMS.

{
"phone": "+491701234567",
"code": "1234",
"is_code_deleted": false,
"payload": "yours payload here",
"lang": "EN",
"routing_strategy": [
{
"channel": "telegram",
"timeout_sec": 30
},
{
"channel": "voice",
"sender_id": "LOX24",
"template": "Your code is {{code}}"
},
{
"channel": "sms",
"sender_id": "LOX24",
"template": "Your code is {{code}}"
}
]
}

Verify code created and delivery process started

Media type application/json

Verify code read response. Contains the full verification code request details including current status, delivery history, and cost information.

object
id

Unique identifier (UUID) of the verification code request.

string
user_id

ID of the user who created the verification code request.

integer
phone

Recipient phone number in international format.

string
code

The verification code value. If is_code_deleted was set and the task completed, the code will be absent.

string | null
code_length

Length of the verification code.

integer | null
lang

Language used for the message template.

string
Allowed values: EN DE FR IT ES PL NL RO PT CS HU SV DA FI SK HR TR RU BG UK
routing_strategy

Ordered list of delivery channels that were configured for this request.

Array<object>
object
channel

Delivery channel type.

string
Allowed values: telegram voice sms
timeout_sec

Timeout in seconds before falling back to the next step. Only applicable for the telegram channel.

integer | null
sender_id

Sender identifier used for this channel.

string | null
template

Custom message template used for this channel.

string | null
status

Current status of the verification code: 0 = New, 5 = In Progress, 10 = Success, 20 = Failed, 100 = Error.

integer
Allowed values: 0 5 10 20 100
delivered_channel

The channel that successfully delivered the verification code. Null if not yet delivered or if delivery failed.

string | null
Allowed values: telegram voice sms
cost

Total cost of the verification request in euro cents. Null until processing is complete.

integer | null
currency

Currency code for the cost.

string | null
payload

Custom payload data from the original request.

string | null
created_at

Unix timestamp of when the verification code was created.

integer
updated_at

Unix timestamp of the last update.

integer
history

Processing history for each channel attempt. One entry per routing step.

Array<object>
object
id

History entry UUID.

string
channel

Channel type for this attempt.

string
Allowed values: telegram voice sms
status

Status of this channel attempt: 0 = New, 5 = In Progress, 10 = Success, 20 = Failed, 100 = Error.

integer
processed_at

Unix timestamp of when this step was processed.

integer
external_id

External provider message ID.

string | null
is_code_deleted

Whether the verification code has been deleted from storage after being sent to the recipient.

boolean | null
Examples
Example multi_channel

Verify code response with multi-channel routing

Successful response after creating a verification code with a 3-step routing strategy. Telegram and voice channels failed, SMS succeeded.

{
"id": "d7ad7539-fb8f-4dbb-a7f7-7c40babec969",
"user_id": 12345,
"phone": "+491701234567",
"routing_strategy": [
{
"channel": "telegram",
"timeout_sec": 30
},
{
"channel": "voice",
"sender_id": "LOX24",
"template": "Your code is {{code}}"
},
{
"channel": "sms",
"sender_id": "LOX24",
"template": "Your code is {{code}}"
}
],
"status": 10,
"delivered_channel": "sms",
"cost": 120,
"currency": "EUR",
"code": "1234",
"code_length": 4,
"payload": "yours payload here",
"lang": "EN",
"created_at": 1779903448,
"updated_at": 1779903510,
"history": [
{
"id": "bccaff09-59f2-11f1-a685-7c10c91d54a1",
"channel": "telegram",
"status": 20,
"processed_at": 1779903478,
"external_id": "tg_msg_001"
},
{
"id": "bccaff09-59f2-11f1-a685-7c10c91d54a2",
"channel": "voice",
"status": 20,
"processed_at": 1779903490,
"external_id": "voice_msg_002"
},
{
"id": "bccaff09-59f2-11f1-a685-7c10c91d54a3",
"channel": "sms",
"status": 10,
"processed_at": 1779903510,
"external_id": "sms_msg_003"
}
],
"is_code_deleted": false
}

Invalid input

Client ID or API key isn’t active or invalid!

There are not enough funds on your account!

Account isn’t activated. Please wait or contact to support!

The request was well-formed but was unable to be followed due to semantic errors

IP address was temporary blocked, because during short time from it was sent many request with invalid credentials. Please wait and try later.

Code Samples

#!/usr/bin/env bash
curl -X POST https://api.lox24.eu/verify_codes \
-H 'Content-Type: application/json' \
-H 'X-LOX24-AUTH-TOKEN: 1234567:e3f3a759b6677959b6ebfcxxxxxxxxxx' \
-d '{
"phone": "+491701234567",
"code": "1234",
"is_code_deleted": false,
"payload": "yours payload here",
"lang": "EN",
"routing_strategy": [
{
"channel": "telegram",
"timeout_sec": 30
},
{
"channel": "voice",
"sender_id": "LOX24",
"template": "Your code is {{code}}"
},
{
"channel": "sms",
"sender_id": "LOX24",
"template": "Your code is {{code}}"
}
]
}'