Skip to main content
POST
Send using template
Send SMS using a template with variable substitution.

Authorizations

Authorization
string
header
required

Use your API key as a Bearer token. Format: Authorization: Bearer sk_live_xxxxx

Headers

Xerobi-Version
string
default:2026-01-01
required

API version in YYYY-MM-DD format. Using the latest version ensures access to newest features.

Pattern: ^\d{4}-\d{2}-\d{2}$

Path Parameters

template_id
string
required

Template ID

Body

application/json
to
string
required

Recipient phone number

Example:

"8801712345678"

variables
object
required

Key-value pairs for template variables

Example:
from
string

Sender ID

Example:

"HIXBE"

route
enum<string>
Available options:
otp,
transactional,
promotional
Example:

"transactional"

Response

Message sent using template

SMS message object with delivery status and metadata

id
string
required

Unique message identifier

Example:

"msg_abc123xyz"

to
string
required

Recipient phone number in international format

Example:

"8801712345678"

from
string
required

Sender ID (alphanumeric or numeric)

Example:

"HIXBE"

body
string
required

Message content

Example:

"Your OTP is 391202. Valid for 5 minutes."

status
enum<string>
required

Current message status

Available options:
queued,
sent,
delivered,
failed,
expired
Example:

"delivered"

created_at
string<date-time>
required

Message creation timestamp

Example:

"2026-01-15T10:30:00Z"

route
enum<string>

Message route used for delivery

Available options:
otp,
transactional,
promotional
Example:

"transactional"

segments
integer

Number of SMS segments (1 segment = 160 chars)

Required range: x >= 1
Example:

1

cost
number

Message cost in account currency

Required range: x >= 0
Example:

0.5

scheduled_at
string<date-time> | null

Scheduled delivery time (ISO 8601 format)

Example:

"2026-01-15T14:30:00Z"

sent_at
string<date-time> | null

Timestamp when message was sent to carrier

Example:

"2026-01-15T10:30:05Z"

delivered_at
string<date-time> | null

Timestamp when message was delivered

Example:

"2026-01-15T10:30:15Z"

error_code
string | null

Error code if delivery failed

Example:

"number_unreachable"