Skip to main content

Message Lifecycle

Messages progress through these states:
StatusDescription
pendingCreated, awaiting queue
queuedIn queue for submission
submittedSent to carrier
deliveredConfirmed delivery
failedDelivery failed
expiredValidity period exceeded

Templates & Variables

Use templates for dynamic content:
curl -X POST https://api-message.nativehub.live/api/v1/messages \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "destination": "+1234567890",
    "template_id": "tmpl_abc123",
    "variables": {
      "VAR1": "John",
      "VAR2": "12345"
    }
  }'
Template format: Hello {{VAR1}}, your code is {{VAR2}}

Message Encoding

GSM-7 (Default)

  • 160 characters per message
  • 153 characters per part for multipart
  • Standard Latin characters

UCS-2/Unicode

  • 70 characters per message
  • 67 characters per part for multipart
  • Used for emojis, non-Latin scripts
Encoding is auto-detected. A single emoji triggers Unicode encoding for the entire message.

DNC (Do-Not-Call) Check

Messages to numbers on the DNC list are automatically rejected before sending.
curl https://api-message.nativehub.live/api/v1/dnc/check/+1234567890 \
  -H "Authorization: Bearer YOUR_TOKEN"

Priority Levels

Control sending order:
curl -X POST https://api-message.nativehub.live/api/v1/messages \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "destination": "+1234567890",
    "content": "Urgent notification",
    "priority": "high"
  }'
Priority values: low, normal (default), high

Delivery Logs

Track message delivery attempts:
curl https://api-message.nativehub.live/api/v1/messages/msg_abc123/logs \
  -H "Authorization: Bearer YOUR_TOKEN"
Response format:
{
  "data": [
    {
      "timestamp": "2026-02-14T10:30:00Z",
      "status": "submitted",
      "provider": "twilio"
    },
    {
      "timestamp": "2026-02-14T10:30:15Z",
      "status": "delivered",
      "error_code": null
    }
  ]
}

Hold & Release

Pause and resume message queues:
curl -X POST https://api-message.nativehub.live/api/v1/messages/msg_abc123/hold \
  -H "Authorization: Bearer YOUR_TOKEN"
Held messages remain in pending status until released. They do not expire while held.