Messages
Every messages route, with request, response, errors and samples in curl, Node, Python and PHP.
See the overview for sign-in and the error shape.
List messages
GET /v1/messages
Who can call it: API key with the query scope, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
page | integer | No | 0 | Page number, starting at 0. |
limit | integer | No | 20 | Items per page. |
status | string | No | Only this status. | |
environment | string | No | live | test | all | |
to | string | No | Filter by recipient phone (E.164) | |
batch_id | string | No | Filter by bulk batch id | |
date_from | string | No | ISO date/datetime lower bound (created_at) | |
date_to | string | No | ISO date/datetime upper bound (created_at) |
curl -X GET "https://api.sms.jtnoble.com/v1/messages" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages', {
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",
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');
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:
{
"messages": [
{
"id": "test_bacec39cde5f46288cc7c82e9c142e19",
"phone": "+2348030001111",
"text": "Your order 1042 is ready.",
"sender_id": "MYSHOP",
"route": "NG",
"country": "NG",
"segments": 1,
"encoding": "GSM7",
"environment": "test",
"cost": 0.0116,
"cost_currency": "USD",
"currency": "USD",
"price_per_segment": 0.0116,
"price_currency": "USD",
"status": "delivered",
"error_code": null,
"retry_count": 0,
"created_at": "2026-11-07T17:00:41.840923+00:00",
"delivered_at": "2026-11-07T17:00:42.862328+00:00"
},
{
"id": "test_d0bf4ca07e1b4cb48786a40166d39048",
"phone": "+2348030001234",
"text": "Your order 1042 is ready.",
"sender_id": "MYSHOP",
"route": "NG",
"country": "NG",
"segments": 1,
"encoding": "GSM7",
"environment": "test",
"cost": 0,
"cost_currency": "USD",
"currency": "USD",
"price_per_segment": 0,
"price_currency": "USD",
"status": "delivered",
"error_code": null,
"retry_count": 0,
"created_at": "2026-11-05T23:31:37.346774+00:00",
"delivered_at": "2026-11-05T23:31:38.368386+00:00"
}
],
"total": 2,
"page": 0,
"limit": 2
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | |
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Export messages as CSV
GET /v1/messages/export
Export messages as CSV download (live traffic; test keys get test traffic, matching the /messages list isolation).
Who can call it: API key with the query scope, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
status | string | No | Only this status. |
curl -X GET "https://api.sms.jtnoble.com/v1/messages/export" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/export', {
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/export",
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/export');
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, a CSV file:
message_id,phone,sender_id,text,status,country,currency,cost,segments,created_at,delivered_at
test_561d9cd7c5c84df1a655dad26d603ffd,+2348030001195,MYSHOP,webhook check,delivered,NG,0.008,USD,1,2026-11-07T17:48:12.427678+00:00,2026-11-07T17:48:13.439077+00:00
test_6759df572e6b4e81a75713eec971dab2,+2| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Price a message
POST /v1/messages/rate
Price a message BEFORE sending - no charge, no delivery.
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
to | string or array of string | Yes | Mobile number in international format, for example +2348030000000. Also accepted: 2348030000000, or 08030000000 in your default country. | |
text | string | Yes | The message. | |
route | string | No | Route code. Only NG exists; leave it out. |
curl -X POST "https://api.sms.jtnoble.com/v1/messages/rate" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"+2348030001111","text":"Your order 1042 is ready."}'const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/rate', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"to":"+2348030001111","text":"Your order 1042 is ready."}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/messages/rate",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"to":"+2348030001111","text":"Your order 1042 is ready."},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/rate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"to":"+2348030001111","text":"Your order 1042 is ready."}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"encoding": "GSM7",
"segments": 1,
"characters": 25,
"units": 25,
"over_segment_cap": false,
"max_segments": 10,
"wallet_currency": "USD",
"wallet_balance": 0,
"recipients": [
{
"to": "+2348030001111",
"country": "NG",
"route": "NG",
"routable": true,
"segments": 1,
"encoding": "GSM7",
"price_per_segment": 0.0116,
"route_currency": "USD",
"cost_route": 0.0116,
"cost_wallet": 0.0116
}
],
"routable_count": 1,
"unroutable": [],
"total_cost": 0.0116,
"affordable": false
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | Rate check is limited to 1000 recipients per call |
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Send one SMS
POST /v1/messages/send
Who can call it: API key with the send scope, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
to | string | Yes | Mobile number in international format, for example +2348030000000. Also accepted: 2348030000000, or 08030000000 in your default country. | |
text | string | No | "" | The message. |
sender_id | string | No | Sender name, up to 11 characters. It must be approved on your account. Without it the default sender is used. | |
route | string | No | Route code. Only NG exists; leave it out. | |
schedule_mode | string | No | "now" | now (default) or scheduled. |
scheduled_at | string | No | ISO 8601 time with a time zone, 5 minutes to 7 days ahead. | |
flash | boolean | No | false | Flash SMS (message class 0): shown on screen, not stored. Same price. |
validity_period | integer | No | Minutes (1-4320) the network keeps retrying before the message expires | |
priority | integer | No | 0 normal (default), 1 high, 2 higher, 3 highest | |
binary | object | No | Raw binary SMS instead of text (omit text) |
curl -X POST "https://api.sms.jtnoble.com/v1/messages/send" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"+2348030000000","text":"Your order 1042 is ready.","sender_id":"MYSHOP"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/send', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"to":"+2348030000000","text":"Your order 1042 is ready.","sender_id":"MYSHOP"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/messages/send",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"to":"+2348030000000","text":"Your order 1042 is ready.","sender_id":"MYSHOP"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/send');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"to":"+2348030000000","text":"Your order 1042 is ready.","sender_id":"MYSHOP"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": "test_bacec39cde5f46288cc7c82e9c142e19",
"status": "queued",
"environment": "test",
"livemode": false,
"segments": 1,
"encoding": "GSM7",
"recipients": 1,
"price_per_sms": 0.0116,
"cost": 0.0116,
"cost_currency": "USD",
"route_cost": 0.0116,
"route_currency": "USD",
"route": "NG",
"balance_after": null,
"scheduled_at": null,
"note": "Sandbox message - simulated, not sent to a real network and not billed.",
"options": {
"flash": false,
"validity_period": null,
"priority": 0,
"binary": false
},
"live": {
"country": "NG",
"availability": "live",
"country_enabled": true,
"note": "Enabled for live sends.",
"sender_approved": true
}
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | |
| 400 | feature_not_enabled | Flash SMS is not enabled on this platform yet. |
| 400 | invalid_phone | This is not a valid phone number. |
| 400 | invalid_phone_length | The phone number has the wrong length for its country. |
| 400 | unsupported_wallet_currency | |
| 401 | unauthorized | Not authenticated |
| 402 | insufficient_balance | Sandbox: simulated insufficient balance (magic number). |
| 403 | forbidden | |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 403 | recipient_dnd | This number is on the do-not-disturb list. |
| 403 | recipient_opted_out | The recipient has opted out. |
| 403 | sender_not_approved | This sender ID is not approved on your account. |
| 409 | conflict | Duplicate request (idempotency conflict) |
| 409 | duplicate_message | An identical message was sent to this number in the last 5 minutes. |
| 413 | message_too_long | |
| 422 | destination_not_allowed | |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Message totals
GET /v1/messages/stats
Who can call it: API key with the query scope, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/messages/stats" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/stats', {
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/stats",
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/stats');
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:
{
"sent_today": 24,
"sent_delta_pct": 0,
"delivery_rate": 68,
"failed_today": 2,
"failed_delta": 2,
"balance": 0,
"currency": "USD",
"sms_estimate": 0,
"period_total": 0.01,
"period_days": 14
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Status of several messages
GET /v1/messages/status
Look up delivery status for many messages in one call.
Who can call it: API key with the query scope, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
ids | string | Yes | Comma-separated message ids (max 100) |
curl -X GET "https://api.sms.jtnoble.com/v1/messages/status?ids=IDS" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/status?ids=IDS', {
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/status?ids=IDS",
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/status?ids=IDS');
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:
{
"messages": [
{
"id": "test_bacec39cde5f46288cc7c82e9c142e19",
"status": "delivered",
"segments": 1,
"error_code": null,
"error_message": null,
"submitted_at": "2026-11-07T17:00:42.253790+00:00",
"delivered_at": "2026-11-07T17:00:42.862328+00:00"
}
]
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | Provide at least one message id in ?ids= |
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Check phone numbers
POST /v1/messages/validate
Validate recipient numbers before sending - format, validity, line type and assigned carrier (offline libphonenumber; no HLR network call, no charge). Reject non-mobile or invalid numbers early to save spend.
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
phone | string or array of string | Yes | Mobile number in international format. |
curl -X POST "https://api.sms.jtnoble.com/v1/messages/validate" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone":"0888123456"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/validate', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"phone":"0888123456"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/messages/validate",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"phone":"0888123456"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/messages/validate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"phone":"0888123456"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"input": "0888123456",
"e164": "+2348038123456",
"valid": true,
"possible": true,
"country": "NG",
"type": "mobile",
"carrier": "MTN",
"location": "Nigeria",
"national": "0888 12 34 56",
"reason": null
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | Validation is limited to 1000 numbers per call |
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Daily message volume
GET /v1/messages/volume
Daily message volume for the chart.
Who can call it: API key with the query scope, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
days | integer | No | 14 |
curl -X GET "https://api.sms.jtnoble.com/v1/messages/volume" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/volume', {
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/volume",
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/volume');
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:
[
{
"date": "2026-11-05",
"day": "Thu",
"delivered": 1,
"failed": 0,
"pending": 0
},
{
"date": "2026-11-07",
"day": "Sat",
"delivered": 16,
"failed": 2,
"pending": 0
}
]| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Get one message with its timeline
GET /v1/messages/{message_id}
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
message_id | string | The message id. |
curl -X GET "https://api.sms.jtnoble.com/v1/messages/MESSAGE_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/MESSAGE_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/MESSAGE_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/MESSAGE_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:
{
"id": "test_bacec39cde5f46288cc7c82e9c142e19",
"phone": "+2348030001111",
"text": "Your order 1042 is ready.",
"sender_id": "MYSHOP",
"route": "NG",
"country": "NG",
"segments": 1,
"cost": 0.0116,
"cost_currency": "USD",
"currency": "USD",
"price_per_segment": 0.0116,
"price_currency": "USD",
"status": "delivered",
"error_code": null,
"error_message": null,
"retry_count": 0,
"created_at": "2026-11-07T17:00:41.840923+00:00",
"submitted_at": "2026-11-07T17:00:42.253790+00:00",
"delivered_at": "2026-11-07T17:00:42.862328+00:00",
"failed_at": null,
"timeline": [
{
"event": "accepted",
"status": "queued",
"detail": "Sandbox: accepted (no charge, not delivered to a real network)",
"at": "2026-11-07T17:00:41.843968+00:00",
"metadata": {
"livemode": false
}
},
{
"event": "submitted",
"status": "submitted",
"detail": "Sandbox: gateway accepted (simulated)",
"at": "2026-11-07T17:00:42.256091+00:00",
"metadata": null
}
]
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Message not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Cancel a scheduled message
POST /v1/messages/{message_id}/cancel
Cancel a scheduled single message before it is dispatched. The amount charged when it was scheduled is refunded to the wallet.
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
message_id | string | The message id. |
curl -X POST "https://api.sms.jtnoble.com/v1/messages/MESSAGE_ID/cancel" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/MESSAGE_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/MESSAGE_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/MESSAGE_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:
{
"id": "test_a19286d8ca4d4a59af98bdeb2233b77a",
"status": "cancelled",
"refund": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Message not found |
| 409 | not_cancellable | |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Retry a failed message
POST /v1/messages/{message_id}/retry
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
message_id | string | The message id. |
curl -X POST "https://api.sms.jtnoble.com/v1/messages/MESSAGE_ID/retry" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/messages/MESSAGE_ID/retry', {
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/MESSAGE_ID/retry",
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/MESSAGE_ID/retry');
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:
{
"id": "6f1c2b9e-1d2a-4c55-9a0e-2b7f0c1d3e4f",
"status": "submitted",
"retry_count": 1
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | |
| 400 | sandbox_no_retry | Sandbox (test) messages cannot be retried. |
| 400 | unsupported_wallet_currency | |
| 401 | unauthorized | Not authenticated |
| 402 | insufficient_balance | Insufficient balance to retry this message. |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Message not found |
| 409 | delivery_being_confirmed | This message is still being confirmed with the network. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Price a message (short path)
POST /v1/rate
Price a message BEFORE sending - no charge, no delivery.
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
to | string or array of string | Yes | Mobile number in international format, for example +2348030000000. Also accepted: 2348030000000, or 08030000000 in your default country. | |
text | string | Yes | The message. | |
route | string | No | Route code. Only NG exists; leave it out. |
curl -X POST "https://api.sms.jtnoble.com/v1/rate" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["+2348030001111","+2348030001112"],"text":"Muli bwanji? Moni kuchokera ku JTSMS"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/rate', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"to":["+2348030001111","+2348030001112"],"text":"Muli bwanji? Moni kuchokera ku JTSMS"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/rate",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"to":["+2348030001111","+2348030001112"],"text":"Muli bwanji? Moni kuchokera ku JTSMS"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/rate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"to":["+2348030001111","+2348030001112"],"text":"Muli bwanji? Moni kuchokera ku JTSMS"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"encoding": "GSM7",
"segments": 1,
"characters": 35,
"units": 35,
"over_segment_cap": false,
"max_segments": 10,
"wallet_currency": "USD",
"wallet_balance": 0,
"recipients": [
{
"to": "+2348030001111",
"country": "NG",
"route": "NG",
"routable": true,
"segments": 1,
"encoding": "GSM7",
"price_per_segment": 0.0116,
"route_currency": "USD",
"cost_route": 0.0116,
"cost_wallet": 0.0116
},
{
"to": "+2348030001112",
"country": "NG",
"route": "NG",
"routable": true,
"segments": 1,
"encoding": "GSM7",
"price_per_segment": 0.0116,
"route_currency": "USD",
"cost_route": 0.0116,
"cost_wallet": 0.0116
}
],
"routable_count": 2,
"unroutable": [],
"total_cost": 0.0232,
"affordable": false
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | Rate check is limited to 1000 recipients per call |
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Check phone numbers (short path)
POST /v1/validate
Validate recipient numbers before sending - format, validity, line type and assigned carrier (offline libphonenumber; no HLR network call, no charge). Reject non-mobile or invalid numbers early to save spend.
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
phone | string or array of string | Yes | Mobile number in international format. |
curl -X POST "https://api.sms.jtnoble.com/v1/validate" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone":["+2348038123456","12345"]}'const resp = await fetch('https://api.sms.jtnoble.com/v1/validate', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"phone":["+2348038123456","12345"]}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/validate",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"phone":["+2348038123456","12345"]},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/validate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"phone":["+2348038123456","12345"]}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"count": 2,
"valid": 1,
"invalid": 1,
"mobile": 1,
"results": [
{
"input": "+2348038123456",
"e164": "+2348038123456",
"valid": true,
"possible": true,
"country": "NG",
"type": "mobile",
"carrier": "MTN",
"location": "Nigeria",
"national": "0888 12 34 56",
"reason": null
},
{
"input": "12345",
"e164": null,
"valid": false,
"possible": false,
"country": null,
"type": null,
"carrier": null,
"location": null,
"national": null,
"reason": "parse_error"
}
]
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | Validation is limited to 1000 numbers per call |
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |