Webhooks
Every webhooks route, with request, response, errors and samples in curl, Node, Python and PHP.
See the overview for sign-in and the error shape.
Webhook delivery log
GET /v1/webhook-deliveries
Who can call it: Any API key, or a dashboard session token.
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
page | integer | No | 0 | Page number, starting at 0. |
limit | integer | No | 50 | Items per page. |
success | boolean | No | ||
event_type | string | No |
curl -X GET "https://api.sms.jtnoble.com/v1/webhook-deliveries" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/webhook-deliveries', {
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/webhook-deliveries",
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/webhook-deliveries');
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:
{
"deliveries": [],
"total": 0,
"page": 0,
"limit": 2,
"failed_24h": 0
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Send a webhook again
POST /v1/webhook-deliveries/{delivery_id}/replay
Re-POST a past webhook payload to your current endpoint, freshly signed.
Who can call it: API key with the webhooks scope, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
delivery_id | integer | The delivery id from the log. |
curl -X POST "https://api.sms.jtnoble.com/v1/webhook-deliveries/DELIVERY_ID/replay" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/webhook-deliveries/DELIVERY_ID/replay', {
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/webhook-deliveries/DELIVERY_ID/replay",
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/webhook-deliveries/DELIVERY_ID/replay');
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:
{
"replayed": true,
"success": true,
"delivery": {
"id": 13,
"event_type": "dlr",
"url": "https://example.mw/sms/dlr",
"status_code": 200,
"success": true,
"attempt": 1
}
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | Webhook URL is not publicly reachable |
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Delivery not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Read webhook settings
GET /v1/webhooks
Who can call it: API key with the webhooks scope, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/webhooks" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/webhooks', {
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/webhooks",
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/webhooks');
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:
{
"dlr_url": null,
"mo_url": null,
"campaign_url": null,
"signing_secret": "whsec_YOUR_SECRET",
"is_active": true
}| 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. |
Set webhook URLs
PUT /v1/webhooks
Who can call it: API key with the webhooks scope, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
dlr_url | string | No | Receives delivery reports. Empty string clears it. | |
mo_url | string | No | Receives inbound messages. Empty string clears it. | |
campaign_url | string | No | Receives campaign events. Empty string clears it. | |
is_active | boolean | No | On or off. |
curl -X PUT "https://api.sms.jtnoble.com/v1/webhooks" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dlr_url":"https://example.mw/sms/dlr","mo_url":"https://example.mw/sms/inbound","campaign_url":"https://example.mw/sms/campaign"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/webhooks', {
method: 'PUT',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"dlr_url":"https://example.mw/sms/dlr","mo_url":"https://example.mw/sms/inbound","campaign_url":"https://example.mw/sms/campaign"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.put(
"https://api.sms.jtnoble.com/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"dlr_url":"https://example.mw/sms/dlr","mo_url":"https://example.mw/sms/inbound","campaign_url":"https://example.mw/sms/campaign"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/webhooks');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"dlr_url":"https://example.mw/sms/dlr","mo_url":"https://example.mw/sms/inbound","campaign_url":"https://example.mw/sms/campaign"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "updated"
}| HTTP | code | Message |
|---|---|---|
| 400 | invalid_webhook_url | The webhook URL must be public and reachable. |
| 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. |
Make a new signing secret
POST /v1/webhooks/rotate-secret
Who can call it: API key with the webhooks scope, or a dashboard session token.
curl -X POST "https://api.sms.jtnoble.com/v1/webhooks/rotate-secret" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/webhooks/rotate-secret', {
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/webhooks/rotate-secret",
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/webhooks/rotate-secret');
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:
{
"signing_secret": "whsec_YOUR_SECRET"
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 403 | insufficient_scope | This API key is not authorised for this action. |
| 404 | not_found | Webhook config not found |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Send test events
POST /v1/webhooks/test
Send sample HMAC-signed DLR + MO events to the configured endpoints so users can verify their integration.
Who can call it: API key with the webhooks scope, or a dashboard session token.
curl -X POST "https://api.sms.jtnoble.com/v1/webhooks/test" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/webhooks/test', {
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/webhooks/test",
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/webhooks/test');
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:
{
"dlr": {
"ok": true,
"status": 200
},
"mo": {
"ok": true,
"status": 200
}
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | No webhook endpoints configured. Add a DLR or MO URL first. |
| 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. |