Two-way and opt-outs
Every two-way and opt-outs route, with request, response, errors and samples in curl, Node, Python and PHP.
See the overview for sign-in and the error shape.
List conversations
GET /v1/conversations
Who can call it: Any API key, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
q | string | No | Search text. | |
unread | boolean | No | false | |
archived | boolean | No | false | Archive or restore. |
environment | string | No | live or test. | |
limit | integer | No | 100 | Items per page. |
curl -X GET "https://api.sms.jtnoble.com/v1/conversations" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/conversations', {
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/conversations",
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/conversations');
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:
{
"conversations": [
{
"phone": "+2348031000111",
"number": null,
"last_text": "START",
"last_direction": "inbound",
"last_at": "2026-11-07T17:01:07.785001+00:00",
"unread": 3,
"archived": false,
"opted_out": false,
"environment": "test"
}
],
"unread": 3
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Read one conversation
GET /v1/conversations/{phone}
The newest limit messages, oldest first for display.
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
phone | string | Mobile number in international format. |
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
environment | string | No | live or test. | |
limit | integer | No | 200 | Items per page. |
curl -X GET "https://api.sms.jtnoble.com/v1/conversations/+2348030000000" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/conversations/+2348030000000', {
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/conversations/+2348030000000",
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/conversations/+2348030000000');
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:
{
"phone": "+2348031000111",
"opted_out": false,
"messages": [
{
"id": "d7aa94ff-351d-4d29-99f2-9de9a5b41f78",
"text": "FEES hello",
"direction": "inbound",
"status": "received",
"purpose": null,
"created_at": "2026-11-07T17:01:06.789078+00:00"
},
{
"id": "test_f3810d1ac5d843489f0c670085e70b43",
"text": "Thanks again.",
"direction": "outbound",
"status": "delivered",
"purpose": "auto_reply",
"created_at": "2026-11-07T17:01:06.822665+00:00"
}
]
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 404 | conversation_not_found | No conversation with this number. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Mark read or archive
PATCH /v1/conversations/{phone}
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
phone | string | Mobile number in international format. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
archived | boolean | No | Archive or restore. | |
read | boolean | No | Mark read. | |
environment | string | No | live or test. |
curl -X PATCH "https://api.sms.jtnoble.com/v1/conversations/+2348030000000" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"read":true,"environment":"test"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/conversations/+2348030000000', {
method: 'PATCH',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"read":true,"environment":"test"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.patch(
"https://api.sms.jtnoble.com/v1/conversations/+2348030000000",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"read":True,"environment":"test"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/conversations/+2348030000000');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"read":true,"environment":"test"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"phone": "+2348031000111",
"unread": 0
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 404 | conversation_not_found | No conversation with this number. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Reply in a conversation
POST /v1/conversations/{phone}/reply
Who can call it: API key with the send scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
phone | string | Mobile number in international format. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
text | string | Yes | The message. | |
environment | string | No | live or test. |
curl -X POST "https://api.sms.jtnoble.com/v1/conversations/+2348030000000/reply" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Thanks","environment":"test"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/conversations/+2348030000000/reply', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"text":"Thanks","environment":"test"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/conversations/+2348030000000/reply",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"text":"Thanks","environment":"test"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/conversations/+2348030000000/reply');
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":"Thanks","environment":"test"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": "test_ebd53f466a054d98bc7ccdbc3940bef3",
"status": "queued",
"segments": 1,
"cost": 0,
"currency": "USD",
"balance_after": null
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | conversation_not_found | No conversation with this number. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
List opt-outs
GET /v1/opt-outs
Who can call it: Any API key, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
limit | integer | No | 200 | Items per page. |
curl -X GET "https://api.sms.jtnoble.com/v1/opt-outs" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/opt-outs', {
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/opt-outs",
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/opt-outs');
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:
{
"opt_outs": [
{
"phone": "+2348030001153",
"source": "api",
"keyword": null,
"created_at": "2026-11-07T17:01:12.056526+00:00"
},
{
"phone": "+2348030001152",
"source": "api",
"keyword": null,
"created_at": "2026-11-07T17:01:12.056521+00:00"
}
]
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Add an opt-out
POST /v1/opt-outs
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
phone | string | Yes | Mobile number in international format. |
curl -X POST "https://api.sms.jtnoble.com/v1/opt-outs" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone":"+2348030000000"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/opt-outs', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"phone":"+2348030000000"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/opt-outs",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"phone":"+2348030000000"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/opt-outs');
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":"+2348030000000"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 201:
{
"phone": "+2348030001151",
"opted_out": true
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | |
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Export opt-outs as CSV
GET /v1/opt-outs/export
Who can call it: Any API key, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/opt-outs/export" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/opt-outs/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/opt-outs/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/opt-outs/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,source,keyword,created_at
| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Add many opt-outs
POST /v1/opt-outs/import
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
numbers | array of string | Yes | Mobile numbers in international format. |
curl -X POST "https://api.sms.jtnoble.com/v1/opt-outs/import" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"numbers":["+2348030001152","+2348030001153"]}'const resp = await fetch('https://api.sms.jtnoble.com/v1/opt-outs/import', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"numbers":["+2348030001152","+2348030001153"]}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/opt-outs/import",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"numbers":["+2348030001152","+2348030001153"]},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/opt-outs/import');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"numbers":["+2348030001152","+2348030001153"]}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"added": 2,
"already_listed": 0,
"invalid": 0
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Remove an opt-out
DELETE /v1/opt-outs/{phone}
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
phone | string | Mobile number in international format. |
curl -X DELETE "https://api.sms.jtnoble.com/v1/opt-outs/+2348030000000" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/opt-outs/+2348030000000', {
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/opt-outs/+2348030000000",
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/opt-outs/+2348030000000');
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:
{
"phone": "+2348030001151",
"opted_out": false
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Numbers, keywords and auto-replies
GET /v1/two-way
Who can call it: Any API key, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/two-way" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/two-way', {
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/two-way",
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/two-way');
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:
{
"numbers": [],
"keywords": [],
"settings": {
"default_reply_enabled": false,
"default_reply": null,
"stop_reply": null
}
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Reserve a keyword
POST /v1/two-way/keywords
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
keyword | string | Yes | One word, 2 to 30 characters. STOP, START and HELP words are reserved. | |
number_id | integer | No | Which number the keyword is on. Leave it out for all your numbers. | |
reply_text | string | No | Auto-reply, up to 612 characters. | |
forward_url | string | No | Public URL that receives the signed inbound event for this keyword. | |
is_active | boolean | No | true | On or off. |
curl -X POST "https://api.sms.jtnoble.com/v1/two-way/keywords" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword":"FEES","reply_text":"Thanks, we got your message."}'const resp = await fetch('https://api.sms.jtnoble.com/v1/two-way/keywords', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"keyword":"FEES","reply_text":"Thanks, we got your message."}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/two-way/keywords",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"keyword":"FEES","reply_text":"Thanks, we got your message."},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/two-way/keywords');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"keyword":"FEES","reply_text":"Thanks, we got your message."}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 201:
{
"id": 1,
"keyword": "FEES",
"number_id": null,
"number": null,
"reply_text": "Thanks, we got your message.",
"forward_url": null,
"is_active": true,
"hits": 0,
"last_hit_at": null
}| HTTP | code | Message |
|---|---|---|
| 400 | keyword_one_word | A keyword is one word. |
| 400 | keyword_reserved | This word is reserved. |
| 401 | unauthorized | Not authenticated |
| 409 | keyword_taken | This keyword is already in use. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Change a keyword
PUT /v1/two-way/keywords/{kid}
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
kid | integer | The keyword id. |
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
keyword | string | Yes | One word, 2 to 30 characters. STOP, START and HELP words are reserved. | |
number_id | integer | No | Which number the keyword is on. Leave it out for all your numbers. | |
reply_text | string | No | Auto-reply, up to 612 characters. | |
forward_url | string | No | Public URL that receives the signed inbound event for this keyword. | |
is_active | boolean | No | true | On or off. |
curl -X PUT "https://api.sms.jtnoble.com/v1/two-way/keywords/KID" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword":"FEES","reply_text":"Thanks again."}'const resp = await fetch('https://api.sms.jtnoble.com/v1/two-way/keywords/KID', {
method: 'PUT',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"keyword":"FEES","reply_text":"Thanks again."}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.put(
"https://api.sms.jtnoble.com/v1/two-way/keywords/KID",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"keyword":"FEES","reply_text":"Thanks again."},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/two-way/keywords/KID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"keyword":"FEES","reply_text":"Thanks again."}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": 1,
"keyword": "FEES",
"number_id": null,
"number": null,
"reply_text": "Thanks again.",
"forward_url": null,
"is_active": true,
"hits": 0,
"last_hit_at": null
}| HTTP | code | Message |
|---|---|---|
| 400 | keyword_one_word | A keyword is one word. |
| 400 | keyword_reserved | This word is reserved. |
| 401 | unauthorized | Not authenticated |
| 404 | keyword_not_found | No such keyword. |
| 409 | keyword_taken | This keyword is already in use. |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Delete a keyword
DELETE /v1/two-way/keywords/{kid}
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
kid | integer | The keyword id. |
curl -X DELETE "https://api.sms.jtnoble.com/v1/two-way/keywords/KID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/two-way/keywords/KID', {
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/two-way/keywords/KID",
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/two-way/keywords/KID');
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 204, no body.
| HTTP | code | Message |
|---|---|---|
| 400 | keyword_one_word | A keyword is one word. |
| 400 | keyword_reserved | This word is reserved. |
| 401 | unauthorized | Not authenticated |
| 404 | keyword_not_found | No such keyword. |
| 409 | keyword_taken | This keyword is already in use. |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Auto-reply settings
PUT /v1/two-way/settings
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
default_reply_enabled | boolean | No | false | Answer every other inbound message. |
default_reply | string | No | That answer, up to 612 characters. | |
stop_reply | string | No | Sent after a STOP, up to 320 characters. |
curl -X PUT "https://api.sms.jtnoble.com/v1/two-way/settings" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"default_reply_enabled":true,"default_reply":"Thanks for your message.","stop_reply":"You will get no more messages."}'const resp = await fetch('https://api.sms.jtnoble.com/v1/two-way/settings', {
method: 'PUT',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"default_reply_enabled":true,"default_reply":"Thanks for your message.","stop_reply":"You will get no more messages."}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.put(
"https://api.sms.jtnoble.com/v1/two-way/settings",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"default_reply_enabled":True,"default_reply":"Thanks for your message.","stop_reply":"You will get no more messages."},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/two-way/settings');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"default_reply_enabled":true,"default_reply":"Thanks for your message.","stop_reply":"You will get no more messages."}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"default_reply_enabled": true,
"default_reply": "Thanks for your message.",
"stop_reply": "You will get no more messages."
}| HTTP | code | Message |
|---|---|---|
| 400 | reply_required | Write the auto-reply first. |
| 401 | unauthorized | Not authenticated |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Simulate an inbound message (sandbox)
POST /v1/two-way/simulate
Who can call it: API key with the send scope, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
from | string | No | "+2348031000111" | |
to | string | No | "" | Mobile number in international format, for example +2348030000000. Also accepted: 2348030000000, or 08030000000 in your default country. |
text | string | Yes | The message. |
curl -X POST "https://api.sms.jtnoble.com/v1/two-way/simulate" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"from":"+2348031000111","text":"FEES hello"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/two-way/simulate', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"from":"+2348031000111","text":"FEES hello"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/two-way/simulate",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"from":"+2348031000111","text":"FEES hello"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/two-way/simulate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"from":"+2348031000111","text":"FEES hello"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "received",
"attributed_to": "3f0c7a52-6d1e-4b9a-8f21-7c5e2a9d1b40",
"action": null,
"keyword": "FEES",
"message_id": "d7aa94ff-351d-4d29-99f2-9de9a5b41f78"
}| 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. |