Register webhook
Subscribes a public URL to supported events. Each endpoint receives its own HMAC-SHA256 secret, shown once at creation. If it is lost, remove the endpoint and add it again.
https://notpanel.com/api/v3action=webhook.addapplication/x-www-form-urlencodedParameters
| Name | Type | Description |
|---|---|---|
| keyRequired | string | Your API key. |
| actionRequired | string | Must be the literal string "webhook.add". |
| urlRequired | string (URL) | Public HTTPS endpoint that will receive POSTs. Must be reachable from the public internet. |
| events | string (CSV) | Comma-separated subset of the six supported events below. Omit it to subscribe to all six. |
Example request
Replace YOUR_API_KEY with the key generated under your dashboard’s API page.
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=webhook.add&url=https://your-server.example.com/notpanel-webhook&events=order.completed,order.refunded"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "webhook.add",
url: "https://your-server.example.com/notpanel-webhook",
events: "order.completed,order.refunded",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "webhook.add",
"url": "https://your-server.example.com/notpanel-webhook",
"events": "order.completed,order.refunded",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'webhook.add',
'url' => 'https://your-server.example.com/notpanel-webhook',
'events' => 'order.completed,order.refunded',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
Example response
{
"webhook_id": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
"url": "https://your-server.example.com/notpanel-webhook",
"secret": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"events": [
"order.completed",
"order.refunded"
]
}Common errors
| Status | Body | Cause |
|---|---|---|
| 400 | {"error":"Maximum 5 webhook endpoints per API key"} | Existing endpoints exhausted the cap. Remove an unused endpoint with action=webhook.remove first. |
| 400 | {"error":"Webhook URL must be a publicly reachable HTTPS URL"} | The URL was not valid HTTPS, could not be parsed, or resolved to a private/loopback IP. |
| 400 | {"error":"Webhook event is invalid","error_code":"INVALID_WEBHOOK_EVENT"} | Event name is not on the allow-list. Re-check spelling — names use the form "order.<status>". |