API Reference
Everything you need to send SMS messages through Relay. Base URL: https://api.relaylr.com
Authentication
All API requests require a Bearer token in the Authorization header.
Authorization: Bearer relay_your_api_keyAPI keys are created from your dashboard. Keys have the prefix relay_ followed by 64 hex characters.
Send a message
/v1/messages/sendSends an SMS message to a Liberian phone number. Relay automatically routes to the correct network based on the number prefix.
Request body
{
"to": "+2310776000000",
"message": "Your OTP is 483921",
"sender": "MyApp",
"priority": "default",
"webhook_url": "https://your-app.com/webhooks/relay"
}| Field | Type | Required | Notes |
|---|---|---|---|
to | string | Yes | E.164 format. +231 prefix for Liberia. |
message | string | Yes | Max 160 chars per SMS segment. |
sender | string | No | Sender name (subject to carrier approval). |
priority | string | No | critical, default (default), or bulk. |
webhook_url | string | No | URL to receive delivery receipt events. |
Response 202
{ "id": "msg_01jqk1abcdef", "status": "queued", "network": "orange" }Get message status
/v1/messages/:idReturns the current status and details of a message.
Response 200
{
"id": "msg_01jqk1abcdef",
"to": "+2310776000000",
"message": "Your OTP is 483921",
"network": "orange",
"status": "delivered",
"created_at": "2026-04-11T14:01:00Z",
"delivered_at": "2026-04-11T14:01:03Z"
}Delivery receipt webhook
When a message is delivered (or fails), Relay POSTs to your webhook_url.
Payload
{
"id": "msg_01jqk1abcdef",
"status": "delivered",
"network": "orange",
"delivered_at": "2026-04-11T14:01:03Z"
}Respond with HTTP 200 to acknowledge. Relay retries up to 3 times on failure.
Network routing
Relay detects the Liberian network from the phone number prefix:
| Prefix | Network |
|---|---|
| 07x | Orange Liberia |
| 05x | MTN Liberia |
| 08x | MTN Liberia |
Numbers must be in E.164 format: +231 country code followed by the local number without the leading zero. Example: 0776000000 → +2310776000000.
Error codes
All errors return a JSON body with a message field.
| HTTP Status | Meaning |
|---|---|
| 400 | Bad request — check your request body. |
| 401 | Invalid or missing API key. |
| 422 | Unroutable number (unknown prefix). |
| 429 | Rate limit exceeded. |
| 503 | Provider unavailable. Retry later. |