Campaigns and segments
Every campaigns and segments route, with request, response, errors and samples in curl, Node, Python and PHP.
See the overview for sign-in and the error shape.
Create a campaign
POST /v1/campaigns
Who can call it: API key with the send scope, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
name | string | No | A name. | |
text | string | No | Message template with merge fields: {first_name}, {amount|0} | |
template_id | integer | No | A saved template. | |
message_type | string | No | transactional | promotional | |
sender_id | string | No | Sender name, up to 11 characters. It must be approved on your account. Without it the default sender is used. | |
sender_fallback | boolean | No | Use the country default sender where yours isn't approved | |
tags | array of string | No | Labels. | |
audience | array of object | No | [{"type":"import","id":"imp_.."},{"type":"group","id":3},{"type":"segment","id":2},{"type":"numbers","numbers":[..]}] | |
recipients | array of object | No | Inline recipients (max 10000) | |
contact_list_ids | array of integer | No | Saved contact lists to send to. | |
segment_id | integer | No | A saved segment. | |
default_country | string | No | Leave it out to read local numbers in your account's default country (NG unless you change it). | |
schedule | object | No | When to send: mode (now, scheduled, recurring), at, timezone, recurrence. | |
throttle_per_minute | integer | No | Messages per minute, 1 to 20000. | |
quiet_hours | object | No | {"enabled": true, "start": "21:00", "end": "08:00"} | |
optout_text | string | No | Opt-out line, up to 80 characters. | |
callback_url | string | No | Receives the signed campaign events for this campaign. | |
launch | boolean | No | false | Create and launch in one call (API) |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Term 2 notice","text":"Hello {name|friend}, term 2 fees are due.","recipients":[{"to":"+2348030001161","vars":{"name":"Ada"}},{"to":"+2348030001162"}],"tags":["docs"]}'const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Term 2 notice","text":"Hello {name|friend}, term 2 fees are due.","recipients":[{"to":"+2348030001161","vars":{"name":"Ada"}},{"to":"+2348030001162"}],"tags":["docs"]}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/campaigns",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"name":"Term 2 notice","text":"Hello {name|friend}, term 2 fees are due.","recipients":[{"to":"+2348030001161","vars":{"name":"Ada"}},{"to":"+2348030001162"}],"tags":["docs"]},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/campaigns');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Term 2 notice","text":"Hello {name|friend}, term 2 fees are due.","recipients":[{"to":"+2348030001161","vars":{"name":"Ada"}},{"to":"+2348030001162"}],"tags":["docs"]}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 201:
{
"id": 3,
"name": "Term 2 notice",
"status": "draft",
"engine": 2,
"source": "api",
"environment": "test",
"livemode": false,
"batch_id": null,
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 0,
"sent": 0,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0,
"currency": null
},
"estimate": null,
"prepared": false,
"prepared_at": null,
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:18.749866+00:00",
"updated_at": "2026-11-07T17:01:18.764233+00:00",
"started_at": null,
"completed_at": null,
"test_sent_at": null,
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 0,
"estimated_cost": 0,
"sent_at": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
List campaigns
GET /v1/campaigns
Who can call it: API key with the query scope, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
status | string | No | draft | scheduled | sending | paused | pending_approval | completed | cancelled | |
q | string | No | Search text. | |
tag | string | No | ||
page | integer | No | 0 | Page number, starting at 0. |
limit | integer | No | 50 | Items per page. |
include_runs | boolean | No | false |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns', {
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/campaigns",
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/campaigns');
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:
{
"campaigns": [
{
"id": 3,
"name": "Term 2 notice",
"status": "completed",
"engine": 2,
"source": "api",
"environment": "test",
"livemode": false,
"batch_id": "ed5032ec-fa72-46e6-9afa-2ab59196ca16",
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 2,
"sent": 2,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0.0232,
"currency": "USD"
},
"prepared": true,
"prepared_at": "2026-11-07T17:01:20.220009+00:00",
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:18.749866+00:00",
"updated_at": "2026-11-07T17:01:23.808489+00:00",
"started_at": "2026-11-07T17:01:23.681863+00:00",
"completed_at": "2026-11-07T17:01:23.806794+00:00",
"test_sent_at": "2026-11-07T17:01:23.198501+00:00",
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 2,
"estimated_cost": 70,
"sent_at": "2026-11-07T17:01:23.681863+00:00"
},
{
"id": 2,
"name": "Doc batch",
"status": "completed",
"engine": 2,
"source": "api",
"environment": "test",
"livemode": false,
"batch_id": "c68dccfc-5966-4fc6-9877-1308ef45e1b2",
"tags": [],
"audience": [
{
"type": "import",
"id": "imp_a95ce98cd0be268d8d4f"
}
],
"text": "Hello {name}, code {code|none}",
"text_template": "Hello {name}, code {code|none}",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 1,
"sent": 1,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0.0116,
"currency": "USD"
},
"prepared": true,
"prepared_at": "2026-11-07T17:00:58.128845+00:00",
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": false,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:00:58.068939+00:00",
"updated_at": "2026-11-07T17:00:58.242418+00:00",
"started_at": "2026-11-07T17:00:58.138928+00:00",
"completed_at": "2026-11-07T17:00:58.240132+00:00",
"test_sent_at": null,
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 1,
"estimated_cost": 35,
"sent_at": "2026-11-07T17:00:58.138928+00:00"
}
],
"total": 2,
"page": 0,
"limit": 2,
"status_counts": {
"completed": 2,
"draft": 1
}
}| 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. |
Read a campaign
GET /v1/campaigns/{campaign_id}
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_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/campaigns/CAMPAIGN_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/campaigns/CAMPAIGN_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": 3,
"name": "Term 2 notice",
"status": "draft",
"engine": 2,
"source": "api",
"environment": "test",
"livemode": false,
"batch_id": null,
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 0,
"sent": 0,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0,
"currency": null
},
"estimate": null,
"prepared": false,
"prepared_at": null,
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:18.749866+00:00",
"updated_at": "2026-11-07T17:01:18.764233+00:00",
"started_at": null,
"completed_at": null,
"test_sent_at": null,
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 0,
"estimated_cost": 0,
"sent_at": null,
"job": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Change a draft
PATCH /v1/campaigns/{campaign_id}
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
name | string | No | A name. | |
text | string | No | Message template with merge fields: {first_name}, {amount|0} | |
template_id | integer | No | A saved template. | |
message_type | string | No | transactional | promotional | |
sender_id | string | No | Sender name, up to 11 characters. It must be approved on your account. Without it the default sender is used. | |
sender_fallback | boolean | No | Use the country default sender where yours isn't approved | |
tags | array of string | No | Labels. | |
audience | array of object | No | [{"type":"import","id":"imp_.."},{"type":"group","id":3},{"type":"segment","id":2},{"type":"numbers","numbers":[..]}] | |
recipients | array of object | No | Inline recipients (max 10000) | |
contact_list_ids | array of integer | No | Saved contact lists to send to. | |
segment_id | integer | No | A saved segment. | |
default_country | string | No | Leave it out to read local numbers in your account's default country (NG unless you change it). | |
schedule | object | No | When to send: mode (now, scheduled, recurring), at, timezone, recurrence. | |
throttle_per_minute | integer | No | Messages per minute, 1 to 20000. | |
quiet_hours | object | No | {"enabled": true, "start": "21:00", "end": "08:00"} | |
optout_text | string | No | Opt-out line, up to 80 characters. | |
callback_url | string | No | Receives the signed campaign events for this campaign. | |
launch | boolean | No | false | Create and launch in one call (API) |
curl -X PATCH "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Doc copy"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID', {
method: 'PATCH',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Doc copy"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.patch(
"https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"name":"Doc copy"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Doc copy"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": 4,
"name": "Doc copy",
"status": "draft",
"engine": 2,
"source": "web",
"environment": "test",
"livemode": false,
"batch_id": null,
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 0,
"sent": 0,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0,
"currency": null
},
"estimate": null,
"prepared": false,
"prepared_at": null,
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:31.563058+00:00",
"updated_at": "2026-11-07T17:01:32.063693+00:00",
"started_at": null,
"completed_at": null,
"test_sent_at": null,
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 0,
"estimated_cost": 0,
"sent_at": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 409 | not_editable | |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Delete a campaign
DELETE /v1/campaigns/{campaign_id}
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X DELETE "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.delete(
"https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_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/campaigns/CAMPAIGN_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "deleted"
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 409 | busy | Pause or cancel the campaign before deleting it. |
| 409 | has_history | A campaign that sent messages cannot be deleted. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Approve
POST /v1/campaigns/{campaign_id}/approve
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
note | string | No | A short note. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/approve" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"note":"Checked"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/approve', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"note":"Checked"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/approve",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"note":"Checked"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/approve');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"note":"Checked"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "sending",
"campaign": {
"id": 7,
"name": "Term 2 notice",
"status": "sending",
"note": "the full campaign object, as in GET /v1/campaigns/{id}"
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 409 | not_pending | This campaign is not waiting for approval. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Cancel
POST /v1/campaigns/{campaign_id}/cancel
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/cancel" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_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/campaigns/CAMPAIGN_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/campaigns/CAMPAIGN_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:
{
"status": "cancelled",
"already_sent": 120,
"campaign": {
"id": 7,
"name": "Term 2 notice",
"status": "cancelled",
"note": "the full campaign object, as in GET /v1/campaigns/{id}"
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 404 | not_found | Campaign not found |
| 409 | finished | The campaign is already completed. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Copy into a new draft
POST /v1/campaigns/{campaign_id}/duplicate
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/duplicate" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/duplicate', {
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/campaigns/CAMPAIGN_ID/duplicate",
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/campaigns/CAMPAIGN_ID/duplicate');
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 201:
{
"id": 4,
"name": "Term 2 notice (copy)",
"status": "draft",
"engine": 2,
"source": "web",
"environment": "test",
"livemode": false,
"batch_id": null,
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 0,
"sent": 0,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0,
"currency": null
},
"estimate": null,
"prepared": false,
"prepared_at": null,
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:31.563058+00:00",
"updated_at": "2026-11-07T17:01:31.563064+00:00",
"started_at": null,
"completed_at": null,
"test_sent_at": null,
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 0,
"estimated_cost": 0,
"sent_at": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Launch
POST /v1/campaigns/{campaign_id}/launch
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/launch" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/launch', {
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/campaigns/CAMPAIGN_ID/launch",
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/campaigns/CAMPAIGN_ID/launch');
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:
{
"status": "sending",
"campaign_id": 3,
"batch_id": "ed5032ec-fa72-46e6-9afa-2ab59196ca16",
"total_recipients": 2,
"estimated_cost": 70,
"campaign": {
"id": 3,
"name": "Term 2 notice",
"status": "sending",
"engine": 2,
"source": "api",
"environment": "test",
"livemode": false,
"batch_id": "ed5032ec-fa72-46e6-9afa-2ab59196ca16",
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 2,
"sent": 0,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0.0232,
"currency": "USD"
},
"estimate": {
"recipients": 2,
"candidates": 2,
"duplicates": 0,
"invalid": {},
"skipped": {},
"countries": [
{
"country_code": "NG",
"recipients": 2,
"segments": 2,
"unit_price": 0.0116,
"price_currency": "USD",
"sender": "MYSHOP",
"country_name": "Nigeria",
"cost": 0.0232,
"operators": {
"Airtel": 2
}
}
],
"total_segments": 2,
"total_cost": 0.0232,
"currency": "USD",
"balance": 0,
"sufficient_balance": false,
"longest": {
"segments": 1,
"encoding": "GSM7",
"chars": 34,
"phone": "+2348030001162",
"text": "Hello friend, term 2 fees are due."
},
"encodings": {
"GSM7": 2
},
"missing_fields": {},
"optout_line": null,
"prepared_at": "2026-11-07T17:01:20.219594+00:00"
},
"prepared": true,
"prepared_at": "2026-11-07T17:01:20.220009+00:00",
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:18.749866+00:00",
"updated_at": "2026-11-07T17:01:23.685519+00:00",
"started_at": "2026-11-07T17:01:23.681863+00:00",
"completed_at": null,
"test_sent_at": "2026-11-07T17:01:23.198501+00:00",
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 2,
"estimated_cost": 70,
"sent_at": "2026-11-07T17:01:23.681863+00:00"
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 409 | not_launchable | A completed campaign can't be launched. |
| 422 | launch_blocked | This campaign cannot be launched yet. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Pause
POST /v1/campaigns/{campaign_id}/pause
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/pause" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/pause', {
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/campaigns/CAMPAIGN_ID/pause",
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/campaigns/CAMPAIGN_ID/pause');
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:
{
"status": "paused",
"campaign": {
"id": 7,
"name": "Term 2 notice",
"status": "paused",
"note": "the full campaign object, as in GET /v1/campaigns/{id}"
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 404 | not_found | Campaign not found |
| 409 | not_running | A draft campaign can't be paused. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Build the audience and exact cost
POST /v1/campaigns/{campaign_id}/prepare
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/prepare" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/prepare', {
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/campaigns/CAMPAIGN_ID/prepare",
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/campaigns/CAMPAIGN_ID/prepare');
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:
{
"status": "ready",
"estimate": {
"recipients": 2,
"candidates": 2,
"duplicates": 0,
"invalid": {},
"skipped": {},
"countries": [
{
"country_code": "NG",
"recipients": 2,
"segments": 2,
"unit_price": 0.0116,
"price_currency": "USD",
"sender": "MYSHOP",
"country_name": "Nigeria",
"cost": 0.0232,
"operators": {
"Airtel": 2
}
}
],
"total_segments": 2,
"total_cost": 0.0232,
"currency": "USD",
"balance": 0,
"sufficient_balance": false,
"longest": {
"segments": 1,
"encoding": "GSM7",
"chars": 34,
"phone": "+2348030001162",
"text": "Hello friend, term 2 fees are due."
},
"encodings": {
"GSM7": 2
},
"missing_fields": {},
"optout_line": null,
"prepared_at": "2026-11-07T17:01:20.219594+00:00"
},
"review": {
"blocking": [],
"warnings": [],
"info": [],
"can_launch": true,
"needs_approval": false,
"approval_reason": null
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 409 | not_editable | |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Preview the messages
POST /v1/campaigns/{campaign_id}/preview
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
text | string | No | The message. | |
n | integer | No | 5 | How many to show. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/preview" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"n":2}'const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/preview', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"n":2}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/preview",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"n":2},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/preview');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"n":2}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"messages": [
{
"phone": "+2348030001161",
"name": null,
"country": "NG",
"text": "Hello Ada, term 2 fees are due.",
"encoding": "GSM7",
"segments": 1,
"chars": 33,
"missing": []
},
{
"phone": "+2348030001162",
"name": null,
"country": "NG",
"text": "Hello friend, term 2 fees are due.",
"encoding": "GSM7",
"segments": 1,
"chars": 34,
"missing": []
}
],
"scanned": 2,
"audience_estimate": 2,
"longest": {
"segments": 1,
"encoding": "GSM7",
"chars": 34,
"phone": "+2348030001162",
"text": "Hello friend, term 2 fees are due."
},
"unicode_messages": 0,
"missing_fields": {},
"variables": [
"name"
],
"fields": [
"name"
],
"optout_line": null,
"gsm_suggestions": [],
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Per-recipient status
GET /v1/campaigns/{campaign_id}/recipients
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
status | string | No | Only this status. | |
country | string | No | ||
q | string | No | Search text. | |
page | integer | No | 0 | Page number, starting at 0. |
limit | integer | No | 50 | Items per page. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/recipients" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/recipients', {
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/campaigns/CAMPAIGN_ID/recipients",
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/campaigns/CAMPAIGN_ID/recipients');
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:
{
"total": 2,
"page": 0,
"limit": 2,
"recipients": [
{
"phone": "+2348030001161",
"name": null,
"country": "NG",
"operator": "Airtel",
"status": "delivered",
"reason": null,
"segments": 1,
"cost": 0.0116,
"attempts": 1,
"message_id": "test_ed5b94fd1c0f49389494ae04c6c72b4e",
"text": "Hello Ada, term 2 fees are due.",
"sent_at": "2026-11-07T17:01:23.755193+00:00",
"delivered_at": "2026-11-07T17:01:23.755193+00:00",
"vars": {
"name": "Ada"
},
"clicks": null
},
{
"phone": "+2348030001162",
"name": null,
"country": "NG",
"operator": "Airtel",
"status": "delivered",
"reason": null,
"segments": 1,
"cost": 0.0116,
"attempts": 1,
"message_id": "test_f9689c3b054649e387c949ae603fd247",
"text": "Hello friend, term 2 fees are due.",
"sent_at": "2026-11-07T17:01:23.755193+00:00",
"delivered_at": "2026-11-07T17:01:23.755193+00:00",
"vars": {},
"clicks": null
}
]
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Export recipients
GET /v1/campaigns/{campaign_id}/recipients/export
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
format | string | No | csv | |
status | string | No | Only this status. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/recipients/export" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/recipients/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/campaigns/CAMPAIGN_ID/recipients/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/campaigns/CAMPAIGN_ID/recipients/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:
phone,name,country,operator,status,reason,segments,cost,currency,attempts,message_id,sent_at,delivered_at,clicks,text
+2348030001211,,NG,Airtel,delivered,,1,0.008,USD,1,test_663682712cba4a359e73bbc46c72ce0f,2026-11-07T17:50:29.179271+00:00,2026-11-07T17:50:29.179271+00:00,,Hello friend
+2348030001212| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Reject back to draft
POST /v1/campaigns/{campaign_id}/reject
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
note | string | No | A short note. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/reject" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"note":"Fix the date"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/reject', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"note":"Fix the date"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/reject",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"note":"Fix the date"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/reject');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"note":"Fix the date"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "draft",
"approval_status": "rejected",
"campaign": {
"id": 7,
"name": "Term 2 notice",
"status": "draft",
"note": "the full campaign object, as in GET /v1/campaigns/{id}"
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 409 | not_pending | This campaign is not waiting for approval. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Delivery report
GET /v1/campaigns/{campaign_id}/report
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/report" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/report', {
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/campaigns/CAMPAIGN_ID/report",
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/campaigns/CAMPAIGN_ID/report');
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:
{
"campaign": {
"id": 3,
"name": "Term 2 notice",
"status": "completed",
"engine": 2,
"source": "api",
"environment": "test",
"livemode": false,
"batch_id": "ed5032ec-fa72-46e6-9afa-2ab59196ca16",
"tags": [
"docs"
],
"audience": [
{
"type": "import",
"id": "imp_c428dff0e40e0cd6a7e0"
}
],
"text": "Hello {name|friend}, term 2 fees are due.",
"text_template": "Hello {name|friend}, term 2 fees are due.",
"template_id": null,
"message_type": "transactional",
"optout_text": null,
"sender_id": null,
"sender_fallback": true,
"schedule": {
"mode": "now",
"scheduled_at": null,
"timezone": null,
"recurrence": null,
"recurrence_text": null,
"next_run_at": null,
"runs": 0
},
"throttle_per_minute": null,
"quiet_hours": null,
"approval": {
"status": "not_required",
"note": null,
"submitted_by": null,
"approved_by": null,
"approved_at": null
},
"totals": {
"recipients": 2,
"sent": 2,
"failed": 0,
"skipped": 0,
"spent": 0,
"estimated_cost": 0.0232,
"currency": "USD"
},
"estimate": {
"recipients": 2,
"candidates": 2,
"duplicates": 0,
"invalid": {},
"skipped": {},
"countries": [
{
"country_code": "NG",
"recipients": 2,
"segments": 2,
"unit_price": 0.0116,
"price_currency": "USD",
"sender": "MYSHOP",
"country_name": "Nigeria",
"cost": 0.0232,
"operators": {
"Airtel": 2
}
}
],
"total_segments": 2,
"total_cost": 0.0232,
"currency": "USD",
"balance": 0,
"sufficient_balance": false,
"longest": {
"segments": 1,
"encoding": "GSM7",
"chars": 34,
"phone": "+2348030001162",
"text": "Hello friend, term 2 fees are due."
},
"encodings": {
"GSM7": 2
},
"missing_fields": {},
"optout_line": null,
"prepared_at": "2026-11-07T17:01:20.219594+00:00"
},
"prepared": true,
"prepared_at": "2026-11-07T17:01:20.220009+00:00",
"pause_reason": null,
"error": null,
"parent_id": null,
"callback_url": null,
"created_by": "you@example.mw",
"track_links": true,
"link_tracking": {
"enabled": false,
"available": false,
"domain": null,
"status": "off",
"reason": "Short links are not set up on this platform.",
"urls": [],
"links": []
},
"created_at": "2026-11-07T17:01:18.749866+00:00",
"updated_at": "2026-11-07T17:01:23.808489+00:00",
"started_at": "2026-11-07T17:01:23.681863+00:00",
"completed_at": "2026-11-07T17:01:23.806794+00:00",
"test_sent_at": "2026-11-07T17:01:23.198501+00:00",
"segment_id": null,
"contact_list_ids": [],
"route_code": null,
"schedule_mode": "now",
"scheduled_at": null,
"drip_rate": null,
"total_recipients": 2,
"estimated_cost": 70,
"sent_at": "2026-11-07T17:01:23.681863+00:00"
},
"totals": {
"recipients": 2,
"pending": 0,
"sending": 0,
"sent": 0,
"delivered": 2,
"unknown": 0,
"failed": 0,
"skipped": 0,
"cancelled": 0
},
"sent_total": 2,
"delivery_rate": 100,
"cost": {
"spent": 0,
"currency": null,
"estimated": 70
},
"time_to_deliver": {
"samples": 2,
"median_seconds": 0,
"p90_seconds": 0,
"average_seconds": 0
},
"failure_reasons": [],
"by_day": [
{
"date": "2026-11-07",
"sent": 2,
"delivered": 2,
"failed": 0
}
],
"by_country": [
{
"key": "NG",
"recipients": 2,
"delivered": 2,
"failed": 0,
"sent": 0,
"pending": 0,
"skipped": 0,
"country_name": "Nigeria",
"delivery_rate": 100,
"cost": 0.0232
}
],
"by_operator": [
{
"key": "Airtel",
"recipients": 2,
"delivered": 2,
"failed": 0,
"sent": 0,
"pending": 0,
"skipped": 0,
"delivery_rate": 100
}
],
"clicks": null,
"runs": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Resume
POST /v1/campaigns/{campaign_id}/resume
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/resume" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/resume', {
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/campaigns/CAMPAIGN_ID/resume",
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/campaigns/CAMPAIGN_ID/resume');
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:
{
"status": "sending",
"campaign": {
"id": 7,
"name": "Term 2 notice",
"status": "sending",
"note": "the full campaign object, as in GET /v1/campaigns/{id}"
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 404 | not_found | Campaign not found |
| 409 | not_paused | Only a paused campaign can be resumed. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Retry the failed recipients
POST /v1/campaigns/{campaign_id}/retry-failed
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/retry-failed" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/retry-failed', {
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/campaigns/CAMPAIGN_ID/retry-failed",
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/campaigns/CAMPAIGN_ID/retry-failed');
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:
{
"status": "sending",
"retrying": 3,
"campaign": {
"id": 7,
"name": "Term 2 notice",
"status": "sending",
"note": "the full campaign object, as in GET /v1/campaigns/{id}"
}
}| HTTP | code | Message |
|---|---|---|
| 400 | nothing_to_retry | No failed recipients to retry. |
| 401 | unauthorized | Not authenticated |
| 404 | not_found | Campaign not found |
| 409 | busy | Wait for the campaign to finish before retrying failed recipients. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Checks before launch
GET /v1/campaigns/{campaign_id}/review
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/review" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/review', {
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/campaigns/CAMPAIGN_ID/review",
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/campaigns/CAMPAIGN_ID/review');
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:
{
"status": "ready",
"estimate": {
"recipients": 2,
"candidates": 2,
"duplicates": 0,
"invalid": {},
"skipped": {},
"countries": [
{
"country_code": "NG",
"recipients": 2,
"segments": 2,
"unit_price": 0.0116,
"price_currency": "USD",
"sender": "MYSHOP",
"country_name": "Nigeria",
"cost": 0.0232,
"operators": {
"Airtel": 2
}
}
],
"total_segments": 2,
"total_cost": 0.0232,
"currency": "USD",
"balance": 0,
"sufficient_balance": false,
"longest": {
"segments": 1,
"encoding": "GSM7",
"chars": 34,
"phone": "+2348030001162",
"text": "Hello friend, term 2 fees are due."
},
"encodings": {
"GSM7": 2
},
"missing_fields": {},
"optout_line": null,
"prepared_at": "2026-11-07T17:01:20.219594+00:00"
},
"review": {
"blocking": [],
"warnings": [],
"info": [],
"can_launch": true,
"needs_approval": false,
"approval_reason": null
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Runs of a recurring campaign
GET /v1/campaigns/{campaign_id}/runs
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/runs" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/runs', {
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/campaigns/CAMPAIGN_ID/runs",
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/campaigns/CAMPAIGN_ID/runs');
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:
{
"runs": []
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Live counts
GET /v1/campaigns/{campaign_id}/stats
Who can call it: API key with the query scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
curl -X GET "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/stats" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/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/campaigns/CAMPAIGN_ID/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/campaigns/CAMPAIGN_ID/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:
{
"campaign_id": 3,
"status": "completed",
"batch_id": "ed5032ec-fa72-46e6-9afa-2ab59196ca16",
"total_recipients": 2,
"messages": 2,
"counts": {
"queued": 0,
"submitted": 0,
"sent": 0,
"delivered": 2,
"failed": 0,
"undelivered": 0
},
"spent": 0,
"currency": null,
"estimated_cost": 70,
"progress": {
"total": 2,
"done": 2,
"pending": 0,
"sending": 0,
"submitted": 2,
"failed": 0,
"skipped": 0,
"cancelled": 0,
"percent": 100
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Send a test
POST /v1/campaigns/{campaign_id}/test
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
campaign_id | integer | The campaign id. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
to | array of string | No | API only: up to 3 numbers. The web app sends to your verified phone. |
curl -X POST "https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/test" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["+2348030000000"]}'const resp = await fetch('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/test', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"to":["+2348030000000"]}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/test",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"to":["+2348030000000"]},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/campaigns/CAMPAIGN_ID/test');
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"]}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"results": [
{
"to": "+2348030001163",
"status": "queued",
"id": "test_b124137a6f344b5b8046a0212bc27241",
"segments": 1,
"cost": 0,
"environment": "test"
}
]
}| HTTP | code | Message |
|---|---|---|
| 400 | phone_not_verified | Add and verify your phone number in your profile to receive tests. |
| 400 | to_required | Pass to with up to 3 of your own numbers. |
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Campaign not found |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Render merge fields
POST /v1/personalize/preview
Who can call it: API key with the query scope, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
text | string | Yes | The message. | |
recipients | array of object | No | [] | Numbers in the request. Each has to, and optionally name, vars. |
message_type | string | No | "transactional" | transactional or promotional. |
sender_id | string | No | Sender 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/personalize/preview" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello {name|friend}","recipients":[{"to":"+2348030001209","vars":{"name":"Ada"}}]}'const resp = await fetch('https://api.sms.jtnoble.com/v1/personalize/preview', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"text":"Hello {name|friend}","recipients":[{"to":"+2348030001209","vars":{"name":"Ada"}}]}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/personalize/preview",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"text":"Hello {name|friend}","recipients":[{"to":"+2348030001209","vars":{"name":"Ada"}}]},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/personalize/preview');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"text":"Hello {name|friend}","recipients":[{"to":"+2348030001209","vars":{"name":"Ada"}}]}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"messages": [
{
"to": "+2348030001209",
"text": "Hello Ada",
"encoding": "GSM7",
"segments": 1,
"chars": 11,
"missing": []
}
],
"variables": [
"name"
],
"gsm_suggestions": [],
"gsm_fixed": "Hello {name|friend}"
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
List segments
GET /v1/segments
Who can call it: API key with the send scope, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/segments" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/segments', {
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/segments",
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/segments');
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": 1,
"name": "Parents",
"contact_list_ids": [
5
],
"filters": [],
"match_all": true,
"last_count": 0,
"created_at": "2026-11-07T17:49:56.818220+00:00"
}
]| 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. |
Create a segment
POST /v1/segments
Who can call it: API key with the send scope, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
name | string | Yes | A name. | |
contact_list_ids | array of integer | No | [] | Saved contact lists to send to. |
filters | array of object | No | [] | Conditions on contact fields. |
match_all | boolean | No | true | All conditions must match. |
curl -X POST "https://api.sms.jtnoble.com/v1/segments" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Abuja parents","contact_list_ids":[12],"filters":[{"field":"city","op":"equals","value":"Abuja"}],"match_all":true}'const resp = await fetch('https://api.sms.jtnoble.com/v1/segments', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Abuja parents","contact_list_ids":[12],"filters":[{"field":"city","op":"equals","value":"Abuja"}],"match_all":true}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/segments",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"name":"Abuja parents","contact_list_ids":[12],"filters":[{"field":"city","op":"equals","value":"Abuja"}],"match_all":True},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/segments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Abuja parents","contact_list_ids":[12],"filters":[{"field":"city","op":"equals","value":"Abuja"}],"match_all":true}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": 1,
"name": "Parents",
"contact_list_ids": [
5
],
"filters": [
{
"field": "city",
"op": "equals",
"value": "Abuja"
}
],
"match_all": true,
"last_count": null,
"created_at": "2026-11-07T17:49:56.818220+00:00"
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Read a segment
GET /v1/segments/{segment_id}
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
segment_id | integer | A saved segment. |
curl -X GET "https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/segments/SEGMENT_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/segments/SEGMENT_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/segments/SEGMENT_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": 1,
"name": "Parents",
"contact_list_ids": [
5
],
"filters": [
{
"field": "city",
"op": "equals",
"value": "Abuja"
}
],
"match_all": true,
"last_count": null,
"created_at": "2026-11-07T17:49:56.818220+00:00"
}| 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. |
Change a segment
PATCH /v1/segments/{segment_id}
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
segment_id | integer | A saved segment. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
name | string | Yes | A name. | |
contact_list_ids | array of integer | No | [] | Saved contact lists to send to. |
filters | array of object | No | [] | Conditions on contact fields. |
match_all | boolean | No | true | All conditions must match. |
curl -X PATCH "https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Abuja parents","contact_list_ids":[12],"filters":[],"match_all":true}'const resp = await fetch('https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID', {
method: 'PATCH',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Abuja parents","contact_list_ids":[12],"filters":[],"match_all":true}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.patch(
"https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"name":"Abuja parents","contact_list_ids":[12],"filters":[],"match_all":True},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Abuja parents","contact_list_ids":[12],"filters":[],"match_all":true}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": 1,
"name": "Parents",
"contact_list_ids": [
5
],
"filters": [],
"match_all": true,
"last_count": 0,
"created_at": "2026-11-07T17:49:56.818220+00:00"
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Delete a segment
DELETE /v1/segments/{segment_id}
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
segment_id | integer | A saved segment. |
curl -X DELETE "https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.delete(
"https://api.sms.jtnoble.com/v1/segments/SEGMENT_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/segments/SEGMENT_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "deleted"
}| 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. |
Preview a segment
GET /v1/segments/{segment_id}/preview
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
segment_id | integer | A saved segment. |
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
limit | integer | No | 25 | Items per page. |
curl -X GET "https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID/preview" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/segments/SEGMENT_ID/preview', {
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/segments/SEGMENT_ID/preview",
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/segments/SEGMENT_ID/preview');
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:
{
"count": 0,
"sample": []
}| 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. |