Send a Message

POST /v1/messages — send iMessage or SMS to any phone number.

Full endpoint reference for sending messages.

POST /v1/messages

Send an iMessage or SMS to any phone number.

Request Headers

HeaderRequiredValue
AuthorizationYesBearer tf_live_YOUR_KEY
Content-TypeYesapplication/json

Request Body

Send with raw body:

{
  "to": "+15551234567",
  "channel": "auto",
  "body": "Your order has shipped!"
}

Send with template:

{
  "to": "+15551234567",
  "channel": "auto",
  "template": "otp_verify",
  "data": {
    "code": "4821",
    "minutes": "10"
  }
}

Parameters

to string Required

Recipient phone number in E.164 format (e.g. +15551234567)

channel string

auto (default), imessage, or sms

body string Required

Message text. Required if template is not provided.

template string

Template name. Required if body is not provided.

data object

Template variables. Required if template has variables.

Response

202 Accepted
{
  "message_id": "01ABCDEF...",
  "status": "queued",
  "from": "+12025551234",
  "channel": "imessage",
  "estimated_delivery_ms": 2000
}

Channel Behavior

  • imessage — Forces iMessage. Fails if recipient doesn’t have iMessage.
  • sms — Forces SMS delivery.

Error Responses

StatusCodeDescription
400VALIDATION_ERRORInvalid request body
400INVALID_TEMPLATETemplate not found
400MISSING_TEMPLATE_VARRequired template variable missing
401INVALID_API_KEYBad or missing API key
429RATE_LIMIT_EXCEEDEDRate limit hit
503NO_PHONE_AVAILABLENo phone available to send

Examples

curl -X POST https://api.senderz.com/v1/messages \
  -H "Authorization: Bearer tf_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "+15551234567", "channel": "auto", "body": "Hello!"}'
const res = await fetch('https://api.senderz.com/v1/messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer tf_live_YOUR_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+15551234567',
    channel: 'auto',
    body: 'Hello!',
  }),
})
const data = await res.json()