JT Noble SMS documentation home

Bulk and batch

Every bulk and batch route, with request, response, errors and samples in curl, Node, Python and PHP.

See the overview for sign-in and the error shape.

Send personalised messages in one call

POST /v1/messages/batch

Creates a campaign from the recipient list and launches it. Use an Idempotency-Key header: a retry with the same key returns the original batch and never sends twice. Each recipient is rendered with its own vars; invalid, duplicate and opted-out numbers are rejected in the response (never charged). Track with GET /v1/messages/batch/{batch_id} or GET /v1/campaigns/{campaign_id}.

Who can call it: API key with the send scope, or a dashboard session token.

Body (JSON):

FieldTypeRequiredDefaultMeaning
templatestringNoMessage with merge fields, e.g. 'Hi {first_name|there}, your balance is {balance}'. Required unless every recipient has text.
template_idintegerNoA saved template instead of template
recipientsarray of objectNo[{to, name?, vars?}] (max 10000)
messagesarray of objectNoFull messages [{to, text}] (no template)
sender_idstringNoSender name, up to 11 characters. It must be approved on your account. Without it the default sender is used.
sender_fallbackbooleanNotrueUse the default sender where yours is not approved.
message_typestringNo"transactional"transactional or promotional.
namestringNoA name.
tagsarray of stringNoLabels.
default_countrystringNoFor local numbers like 0991...
scheduleobjectNoWhen to send: mode (now, scheduled, recurring), at, timezone, recurrence.
throttle_per_minuteintegerNoMessages per minute, 1 to 20000.
callback_urlstringNoReceives the signed campaign.completed event
track_linksbooleanNofalseTrack link clicks for URLs in template (off by default for batches; campaigns default on)
curl -X POST "https://api.sms.jtnoble.com/v1/messages/batch" \
  -H "Authorization: Bearer $JTSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template":"Hello {name}, code {code|none}","recipients":[{"to":"+2348030001131","vars":{"name":"Ada","code":"A1"}}],"name":"Doc batch"}'
const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/batch', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"template":"Hello {name}, code {code|none}","recipients":[{"to":"+2348030001131","vars":{"name":"Ada","code":"A1"}}],"name":"Doc batch"}),
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.post(
    "https://api.sms.jtnoble.com/v1/messages/batch",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    json={"template":"Hello {name}, code {code|none}","recipients":[{"to":"+2348030001131","vars":{"name":"Ada","code":"A1"}}],"name":"Doc batch"},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/batch');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"template":"Hello {name}, code {code|none}","recipients":[{"to":"+2348030001131","vars":{"name":"Ada","code":"A1"}}],"name":"Doc batch"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 202:

{
  "batch_id": "c68dccfc-5966-4fc6-9877-1308ef45e1b2",
  "campaign_id": 2,
  "status": "sending",
  "accepted": 1,
  "rejected": [],
  "rejected_count": 0,
  "estimated_cost": 0.0116,
  "currency": "USD",
  "idempotent_replay": false,
  "environment": "test",
  "livemode": false
}
HTTPcodeMessage
400recipients_requiredPass recipients (with a template) or messages.
400template_requiredPass template (or template_id) or a text per recipient.
400text_requiredEvery entry in messages needs text.
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
422validation_errorRequest validation failed
429rate_limitedToo many requests. Try again in a moment.

Read a batch

GET /v1/messages/batch/{batch_id}

Aggregate status of a bulk batch (returned as batch_id by /messages/send-bulk), plus a paginated list of its member messages - so a developer can track a blast they launched via the API.

Who can call it: API key with the query scope, or a dashboard session token.

Path valueTypeMeaning
batch_idstringThe batch id.
QueryTypeRequiredDefaultMeaning
pageintegerNo0Page number, starting at 0.
limitintegerNo50Items per page.
curl -X GET "https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID', {
  method: 'GET',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.get(
    "https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 200:

{
  "batch_id": "42cd35f4-4843-4a55-b4e4-ea62a89c093a",
  "total": 2,
  "counts": {
    "delivered": 2
  },
  "cost": 0,
  "cost_currency": null,
  "charged": 0,
  "charged_currency": null,
  "page": 0,
  "limit": 50,
  "messages": [
    {
      "id": "test_2cf33e39372f49ee96a54e95135232b7",
      "phone": "+2348030001122",
      "status": "delivered",
      "segments": 1,
      "cost": 0,
      "cost_currency": "USD",
      "error_code": null,
      "created_at": "2026-11-07T17:00:53.134928+00:00",
      "delivered_at": "2026-11-07T17:00:53.156035+00:00"
    },
    {
      "id": "test_f60e10c99b6843f9a90c606c03ae6201",
      "phone": "+2348030001121",
      "status": "delivered",
      "segments": 1,
      "cost": 0,
      "cost_currency": "USD",
      "error_code": null,
      "created_at": "2026-11-07T17:00:53.134923+00:00",
      "delivered_at": "2026-11-07T17:00:53.156035+00:00"
    }
  ]
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
404not_foundBatch not found
429rate_limitedToo many requests. Try again in a moment.

Cancel a scheduled batch

POST /v1/messages/batch/{batch_id}/cancel

Cancel a scheduled bulk batch before its send time. Scheduled batches are charged when scheduled, so the full amount is refunded.

Who can call it: API key with the send scope, or a dashboard session token.

Path valueTypeMeaning
batch_idstringThe batch id.
curl -X POST "https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID/cancel" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID/cancel', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.post(
    "https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID/cancel",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/batch/BATCH_ID/cancel');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 200:

{
  "batch_id": "2d7f4a1e-8c33-4b1a-9c55-0e6f7a2b9d10",
  "status": "cancelled",
  "refund": {
    "amount": 0.0232,
    "currency": "USD",
    "balance_after": 1.972
  }
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
404not_foundBatch not found
409not_cancellable
429rate_limitedToo many requests. Try again in a moment.

Price a bulk send

POST /v1/messages/bulk-precheck

Analyze a bulk send before executing - returns per-country breakdown, total cost in user's wallet currency, and balance after.

Who can call it: Any API key, or a dashboard session token.

Body (JSON):

FieldTypeRequiredDefaultMeaning
contact_list_idsarray of integerNo[]Saved contact lists to send to.
recipientsarray of objectNo[]Numbers in the request. Each has to, and optionally name, vars.
textstringYesThe message.
sender_idstringNoSender name, up to 11 characters. It must be approved on your account. Without it the default sender is used.
curl -X POST "https://api.sms.jtnoble.com/v1/messages/bulk-precheck" \
  -H "Authorization: Bearer $JTSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"08039000122"}],"text":"Dear {first_name|parent}, your balance is USD {balance|0}."}'
const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/bulk-precheck', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"08039000122"}],"text":"Dear {first_name|parent}, your balance is USD {balance|0}."}),
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.post(
    "https://api.sms.jtnoble.com/v1/messages/bulk-precheck",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    json={"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"08039000122"}],"text":"Dear {first_name|parent}, your balance is USD {balance|0}."},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/bulk-precheck');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"08039000122"}],"text":"Dear {first_name|parent}, your balance is USD {balance|0}."}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 200:

{
  "total_contacts": 0.0008,
  "total_segments": 2,
  "total_cost": 0.0232,
  "wallet_currency": "USD",
  "wallet_balance": 0,
  "balance_after": -0.016,
  "sufficient_balance": false,
  "countries": 1,
  "breakdown": [
    {
      "country_code": "NG",
      "country_name": "Nigeria",
      "currency": "USD",
      "route_code": "NG",
      "contacts": 2,
      "segments": 2,
      "route_cost": 0.0232,
      "wallet_cost": 0.0232,
      "price_per_segment": 0.0116
    }
  ],
  "unroutable": [],
  "unroutable_count": 0,
  "unavailable_countries": [],
  "invalid_count": 0,
  "suppressed_count": 0,
  "missing_fields": []
}
HTTPcodeMessage
400bad_requestProvide contact_list_ids or recipients
401unauthorizedNot authenticated
422validation_errorRequest validation failed
429rate_limitedToo many requests. Try again in a moment.

Send one message to many numbers

POST /v1/messages/send-bulk

Bulk send. Idempotency-Key (like single send): the key is reserved before anything is charged; a retried call with the same key returns the original batch instead of charging and sending again.

Who can call it: API key with the send scope, or a dashboard session token.

Body (JSON):

FieldTypeRequiredDefaultMeaning
contact_list_idsarray of integerNo[]Saved contact lists to send to.
recipientsarray of objectNo[]Numbers in the request. Each has to, and optionally name, vars.
textstringYesThe message.
sender_idstringNoSender name, up to 11 characters. It must be approved on your account. Without it the default sender is used.
routestringNoRoute code. Only NG exists; leave it out.
schedule_modestringNo"now"now (default) or scheduled.
scheduled_atstringNoISO 8601 time with a time zone, 5 minutes to 7 days ahead.
drip_rateintegerNoMessages per minute, 1 to 5000. Needed for drip.
flashbooleanNofalseFlash SMS (message class 0) for every message
validity_periodintegerNoMinutes (1-4320) before undelivered messages expire
priorityintegerNo0 normal (default) .. 3 highest
binaryobjectNoNot supported on bulk sends (rejected with invalid_option)
skip_unavailablebooleanNofalseDrop (uncharged) recipients in countries not available yet or with invalid numbers, instead of rejecting the request
curl -X POST "https://api.sms.jtnoble.com/v1/messages/send-bulk" \
  -H "Authorization: Bearer $JTSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"+2348030001122","name":"Ada","vars":{"balance":"12,500"}}],"text":"Dear {first_name|parent}, your balance is USD {balance}."}'
const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/send-bulk', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"+2348030001122","name":"Ada","vars":{"balance":"12,500"}}],"text":"Dear {first_name|parent}, your balance is USD {balance}."}),
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.post(
    "https://api.sms.jtnoble.com/v1/messages/send-bulk",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    json={"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"+2348030001122","name":"Ada","vars":{"balance":"12,500"}}],"text":"Dear {first_name|parent}, your balance is USD {balance}."},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/send-bulk');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"recipients":[{"to":"+2348030001121","name":"Chinedu","vars":{"balance":"45,000"}},{"to":"+2348030001122","name":"Ada","vars":{"balance":"12,500"}}],"text":"Dear {first_name|parent}, your balance is USD {balance}."}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 200:

{
  "batch_id": "42cd35f4-4843-4a55-b4e4-ea62a89c093a",
  "total_recipients": 2,
  "estimated_cost": 70,
  "status": "sending",
  "idempotent_replay": null
}
HTTPcodeMessage
400missing_merge_fieldSome recipients have no value for this field.
401unauthorizedNot authenticated
402insufficient_balanceInsufficient balance.
403insufficient_scopeThis API key is not authorised for this action.
403sender_not_approvedThis sender ID is not approved on your account.
409idempotency_in_progressA request with this Idempotency-Key is still being processed.
422destination_not_allowedSome recipients are in countries we do not send to.
422validation_errorRequest validation failed
429rate_limitedToo many requests. Try again in a moment.

On this page