Relay

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_key

API keys are created from your dashboard. Keys have the prefix relay_ followed by 64 hex characters.

POST

Send a message

/v1/messages/send

Sends 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"
}
FieldTypeRequiredNotes
tostringYesE.164 format. +231 prefix for Liberia.
messagestringYesMax 160 chars per SMS segment.
senderstringNoSender name (subject to carrier approval).
prioritystringNocritical, default (default), or bulk.
webhook_urlstringNoURL to receive delivery receipt events.

Response 202

{ "id": "msg_01jqk1abcdef", "status": "queued", "network": "orange" }
GET

Get message status

/v1/messages/:id

Returns 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:

PrefixNetwork
07xOrange Liberia
05xMTN Liberia
08xMTN 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 StatusMeaning
400Bad request — check your request body.
401Invalid or missing API key.
422Unroutable number (unknown prefix).
429Rate limit exceeded.
503Provider unavailable. Retry later.
Need help? Email our API team or open an issue on GitHub.