Webhook endpoints
POST /v1/webhooks
Create a webhook endpoint. The secret in the response is shown only once — store it immediately for signature verification.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
url | string | Yes | HTTPS endpoint to receive event deliveries. |
label | string | Yes | Human-readable label. |
events | array | Yes | List of event types to subscribe to. See event reference. |
import requests
r = requests.post(
"https://api.reachcell.com/v1/webhooks",
headers={
"Authorization": "Bearer ak_your_api_key",
"Content-Type": "application/json",
},
json={
"url": "https://yourapp.com/webhooks/reachcell",
"label": "Production",
"events": ["sms.received", "call.missed", "call.incoming"],
},
)
wh = r.json()["data"]
print(wh["id"], wh["secret"]) # save secret for signature verification<?php
$ch = curl_init('https://api.reachcell.com/v1/webhooks');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ak_your_api_key',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://yourapp.com/webhooks/reachcell',
'label' => 'Production',
'events' => ['sms.received', 'call.missed', 'call.incoming'],
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// Store $body['data']['secret'] — shown only at creation
$secret = $body['data']['secret'];
$id = $body['data']['id'];const res = await fetch('https://api.reachcell.com/v1/webhooks', {
method: 'POST',
headers: {
Authorization: 'Bearer ak_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/reachcell',
label: 'Production',
events: ['sms.received', 'call.missed', 'call.incoming'],
}),
});
const { data } = await res.json();
// Store data.secret — shown only at creation
console.log(data.id, data.secret);GET /v1/webhooks
List all webhooks for your account.
import requests
r = requests.get(
"https://api.reachcell.com/v1/webhooks",
headers={"Authorization": "Bearer ak_your_api_key"},
)
for wh in r.json()["data"]:
print(wh["id"], wh["url"], wh["active"])<?php
$ch = curl_init('https://api.reachcell.com/v1/webhooks');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ak_your_api_key'],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
foreach ($body['data'] as $wh) {
echo $wh['id'] . ' — ' . $wh['url'] . "\n";
}const res = await fetch('https://api.reachcell.com/v1/webhooks', {
headers: { Authorization: 'Bearer ak_your_api_key' },
});
const { data } = await res.json();
data.forEach(wh => console.log(wh.id, wh.url, wh.active));GET /v1/webhooks/{id}
Get a single webhook by ID.
PUT /v1/webhooks/{id}
Update a webhook. Supply only the fields you want to change (url, label, events, active).
import requests
webhook_id = 3
r = requests.put(
f"https://api.reachcell.com/v1/webhooks/{webhook_id}",
headers={
"Authorization": "Bearer ak_your_api_key",
"Content-Type": "application/json",
},
json={"events": ["sms.received", "call.missed", "sms.delivered"]},
)
print(r.json()["data"]["events"])<?php
$webhookId = 3;
$ch = curl_init("https://api.reachcell.com/v1/webhooks/{$webhookId}");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ak_your_api_key',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'events' => ['sms.received', 'call.missed', 'sms.delivered'],
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);const webhookId = 3;
const res = await fetch(
`https://api.reachcell.com/v1/webhooks/${webhookId}`,
{
method: 'PUT',
headers: {
Authorization: 'Bearer ak_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
events: ['sms.received', 'call.missed', 'sms.delivered'],
}),
},
);
const { data } = await res.json();
console.log(data.events);POST /v1/webhooks/{id}/test
Send a test webhook.test event to the registered URL. Useful for verifying your endpoint is reachable and your signature check is correct.
import requests
webhook_id = 3
r = requests.post(
f"https://api.reachcell.com/v1/webhooks/{webhook_id}/test",
headers={"Authorization": "Bearer ak_your_api_key"},
)
print(r.json())
# Your endpoint receives a webhook.test event payload<?php
$webhookId = 3;
$ch = curl_init("https://api.reachcell.com/v1/webhooks/{$webhookId}/test");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ak_your_api_key'],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// Your endpoint receives a webhook.test eventconst webhookId = 3;
const res = await fetch(
`https://api.reachcell.com/v1/webhooks/${webhookId}/test`,
{ method: 'POST', headers: { Authorization: 'Bearer ak_your_api_key' } },
);
const result = await res.json();
// Your endpoint receives a webhook.test event payloadDELETE /v1/webhooks/{id}
Permanently delete a webhook.
import requests
webhook_id = 3
r = requests.delete(
f"https://api.reachcell.com/v1/webhooks/{webhook_id}",
headers={"Authorization": "Bearer ak_your_api_key"},
)
print(r.status_code) # 200<?php
$webhookId = 3;
$ch = curl_init("https://api.reachcell.com/v1/webhooks/{$webhookId}");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ak_your_api_key'],
]);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 200
curl_close($ch);const webhookId = 3;
const res = await fetch(
`https://api.reachcell.com/v1/webhooks/${webhookId}`,
{ method: 'DELETE', headers: { Authorization: 'Bearer ak_your_api_key' } },
);
console.log(res.status); // 200