JT Noble SMS documentation home

Templates

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

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

List templates

GET /v1/templates

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

QueryTypeRequiredDefaultMeaning
categorystringNoTemplate category.
message_typestringNotransactional or promotional.
qstringNoSearch text.
limitintegerNo200Items per page.
curl -X GET "https://api.sms.jtnoble.com/v1/templates" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates', {
  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/templates",
    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/templates');
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:

{
  "templates": [
    {
      "id": 1,
      "name": "Parents",
      "text": "Hello {name|friend}",
      "category": "other",
      "message_type": "transactional",
      "description": null,
      "variables": [
        "name"
      ],
      "visibility": "team",
      "sender_id": null,
      "created_by": "you@example.mw",
      "starter_key": null,
      "use_count": 0,
      "encoding": "GSM7",
      "segments": 1,
      "created_at": "2026-11-07T17:01:36.098256+00:00",
      "updated_at": "2026-11-07T17:01:36.098261+00:00"
    }
  ],
  "categories": {
    "reminder": "Reminders",
    "bank_alert": "Bank and transaction alerts",
    "otp": "One-time passwords",
    "delivery": "Delivery notices",
    "appointment": "Appointment reminders",
    "payment_due": "Payment due",
    "promotion": "Promotions",
    "event": "Event invites",
    "other": "Other"
  }
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
429rate_limitedToo many requests. Try again in a moment.

Create a template

POST /v1/templates

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

Body (JSON):

FieldTypeRequiredDefaultMeaning
namestringYesA name.
textstringYesThe message.
categorystringNo"other"Template category.
message_typestringNo"transactional"transactional or promotional.
descriptionstringNoA short note.
visibilitystringNo"team"team (whole workspace) | private (only you)
sender_idstringNoSender name, up to 11 characters. It must be approved on your account. Without it the default sender is used.
curl -X POST "https://api.sms.jtnoble.com/v1/templates" \
  -H "Authorization: Bearer $JTSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Parents","text":"Hello {name|friend}"}'
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"name":"Parents","text":"Hello {name|friend}"}),
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.post(
    "https://api.sms.jtnoble.com/v1/templates",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    json={"name":"Parents","text":"Hello {name|friend}"},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/templates');
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":"Parents","text":"Hello {name|friend}"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 201:

{
  "id": 1,
  "name": "Parents",
  "text": "Hello {name|friend}",
  "category": "other",
  "message_type": "transactional",
  "description": null,
  "variables": [
    "name"
  ],
  "visibility": "team",
  "sender_id": null,
  "created_by": "you@example.mw",
  "starter_key": null,
  "use_count": 0,
  "encoding": "GSM7",
  "segments": 1,
  "created_at": "2026-11-07T17:01:36.098256+00:00",
  "updated_at": "2026-11-07T17:01:36.098261+00:00"
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
422validation_errorRequest validation failed
429rate_limitedToo many requests. Try again in a moment.

Render a template

POST /v1/templates/render

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

Body (JSON):

FieldTypeRequiredDefaultMeaning
textstringYesThe message.
varsobjectNoMerge field values.
namestringNoA name.
phonestringNoMobile number in international format.
curl -X POST "https://api.sms.jtnoble.com/v1/templates/render" \
  -H "Authorization: Bearer $JTSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello {name|friend}","vars":{"name":"Ada"}}'
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates/render', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"text":"Hello {name|friend}","vars":{"name":"Ada"}}),
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.post(
    "https://api.sms.jtnoble.com/v1/templates/render",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    json={"text":"Hello {name|friend}","vars":{"name":"Ada"}},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/templates/render');
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}","vars":{"name":"Ada"}}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 200:

{
  "text": "Hello Ada",
  "missing": [],
  "encoding": "GSM7",
  "segments": 1,
  "chars": 11,
  "variables": [
    "name"
  ],
  "gsm_suggestions": []
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
422validation_errorRequest validation failed
429rate_limitedToo many requests. Try again in a moment.

Ready-made templates

GET /v1/templates/starter-pack

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

curl -X GET "https://api.sms.jtnoble.com/v1/templates/starter-pack" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates/starter-pack', {
  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/templates/starter-pack",
    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/templates/starter-pack');
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:

{
  "templates": [
    {
      "key": "payment-reminder",
      "category": "reminder",
      "message_type": "transactional",
      "name": "Payment reminder",
      "description": "A friendly nudge before a payment is due.",
      "text": "Hi {first_name|there}, a reminder that your payment of {currency|USD} {amount} is due on {due_date}. Pay via {pay_link|our app} to avoid late fees.",
      "variables": [
        "first_name",
        "currency"
      ],
      "encoding": "GSM7",
      "segments": 1
    },
    {
      "key": "renewal-reminder",
      "category": "reminder",
      "message_type": "transactional",
      "name": "Subscription renewal",
      "description": "Tell customers their plan is about to expire.",
      "text": "Hi {first_name|there}, your {plan|subscription} expires on {expiry_date}. Renew now to keep your service running: {link|reply to this message}.",
      "variables": [
        "first_name",
        "plan"
      ],
      "encoding": "GSM7",
      "segments": 1
    }
  ],
  "categories": {
    "reminder": "Reminders",
    "bank_alert": "Bank and transaction alerts",
    "otp": "One-time passwords",
    "delivery": "Delivery notices",
    "appointment": "Appointment reminders",
    "payment_due": "Payment due",
    "promotion": "Promotions",
    "event": "Event invites",
    "other": "Other"
  }
}
HTTPcodeMessage
401unauthorizedNot authenticated
429rate_limitedToo many requests. Try again in a moment.

Add a ready-made template

POST /v1/templates/starter-pack/{key}

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

Path valueTypeMeaning
keystringThe notice key.
curl -X POST "https://api.sms.jtnoble.com/v1/templates/starter-pack/KEY" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates/starter-pack/KEY', {
  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/templates/starter-pack/KEY",
    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/templates/starter-pack/KEY');
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": "Payment reminder",
  "text": "Hi {first_name|there}, a reminder that your payment of {currency|USD} {amount} is due on {due_date}. Pay via {pay_link|our app} to avoid late fees.",
  "category": "reminder",
  "message_type": "transactional",
  "description": "A friendly nudge before a payment is due.",
  "variables": [
    "first_name",
    "currency"
  ],
  "visibility": "team",
  "sender_id": null,
  "created_by": "you@example.mw",
  "starter_key": "payment-reminder",
  "use_count": 0,
  "encoding": "GSM7",
  "segments": 1,
  "created_at": "2026-11-07T17:50:09.806777+00:00",
  "updated_at": "2026-11-07T17:50:09.806804+00:00"
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
404not_foundStarter template not found
429rate_limitedToo many requests. Try again in a moment.

Read a template

GET /v1/templates/{template_id}

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

Path valueTypeMeaning
template_idintegerA saved template.
curl -X GET "https://api.sms.jtnoble.com/v1/templates/TEMPLATE_ID" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates/TEMPLATE_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/templates/TEMPLATE_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/templates/TEMPLATE_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": "Parents",
  "text": "Hello {name|friend}",
  "category": "other",
  "message_type": "transactional",
  "description": null,
  "variables": [
    "name"
  ],
  "visibility": "team",
  "sender_id": null,
  "created_by": "you@example.mw",
  "starter_key": null,
  "use_count": 0,
  "encoding": "GSM7",
  "segments": 1,
  "created_at": "2026-11-07T17:50:06.907922+00:00",
  "updated_at": "2026-11-07T17:50:06.907926+00:00"
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
429rate_limitedToo many requests. Try again in a moment.

Change a template

PATCH /v1/templates/{template_id}

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

Path valueTypeMeaning
template_idintegerA saved template.

Body (JSON):

FieldTypeRequiredDefaultMeaning
namestringNoA name.
textstringNoThe message.
categorystringNoTemplate category.
message_typestringNotransactional or promotional.
descriptionstringNoA short note.
visibilitystringNoWho sees it.
sender_idstringNoSender name, up to 11 characters. It must be approved on your account. Without it the default sender is used.
curl -X PATCH "https://api.sms.jtnoble.com/v1/templates/TEMPLATE_ID" \
  -H "Authorization: Bearer $JTSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hi {name|friend}"}'
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates/TEMPLATE_ID', {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"text":"Hi {name|friend}"}),
});
console.log(resp.status, await resp.text());
import os
import requests

resp = requests.patch(
    "https://api.sms.jtnoble.com/v1/templates/TEMPLATE_ID",
    headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
    json={"text":"Hi {name|friend}"},
    timeout=30,
)
print(resp.status_code, resp.text)
<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/templates/TEMPLATE_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 => '{"text":"Hi {name|friend}"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;

HTTP 200:

{
  "id": 3,
  "name": "Parents",
  "text": "Hi {name|friend}",
  "category": "other",
  "message_type": "transactional",
  "description": null,
  "variables": [
    "name"
  ],
  "visibility": "team",
  "sender_id": null,
  "created_by": "you@example.mw",
  "starter_key": null,
  "use_count": 0,
  "encoding": "GSM7",
  "segments": 1,
  "created_at": "2026-11-07T17:50:06.907922+00:00",
  "updated_at": "2026-11-07T17:50:08.408241+00:00"
}
HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
422validation_errorRequest validation failed
429rate_limitedToo many requests. Try again in a moment.

Delete a template

DELETE /v1/templates/{template_id}

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

Path valueTypeMeaning
template_idintegerA saved template.
curl -X DELETE "https://api.sms.jtnoble.com/v1/templates/TEMPLATE_ID" \
  -H "Authorization: Bearer $JTSMS_API_KEY"
const resp = await fetch('https://api.sms.jtnoble.com/v1/templates/TEMPLATE_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/templates/TEMPLATE_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/templates/TEMPLATE_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 204, no body.

HTTPcodeMessage
401unauthorizedNot authenticated
403insufficient_scopeThis API key is not authorised for this action.
429rate_limitedToo many requests. Try again in a moment.

On this page