Register webhook
Subscribes a public URL to one or more events. Each endpoint receives its own HMAC-SHA256 secret — used to sign every outbound delivery, with replay-window protection. The secret is shown once at creation; if you lose it, regenerate by removing and re-adding the endpoint.
https://notpanel.com/api/v2action=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 list of events to subscribe to. Defaults to all events. See list below. |
Example request
Replace YOUR_API_KEYwith the key generated under your dashboard’s API page.
curl -X POST https://notpanel.com/api/v2 \
-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.failed,balance.low"const res = await fetch("https://notpanel.com/api/v2", {
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.failed,balance.low",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v2",
data={
"key": "YOUR_API_KEY",
"action": "webhook.add",
"url": "https://your-server.example.com/notpanel-webhook",
"events": "order.completed,order.failed,balance.low",
},
)
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.failed,balance.low',
]);
$response = file_get_contents('https://notpanel.com/api/v2', 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": "whk_01HG9X...",
"url": "https://your-server.example.com/notpanel-webhook",
"secret": "rotate-this-immediately-it-is-shown-once",
"events": [
"order.completed",
"order.partial",
"order.cancelled",
"order.failed",
"order.processing",
"order.in_progress",
"order.refunded",
"order.refill_completed",
"balance.low"
]
}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":"Invalid URL"} | URL was not http/https, did not parse, or resolved to a private/loopback IP. |
| 400 | {"error":"Invalid event: foo"} | Event name is not on the allow-list. Re-check spelling — names use the form "order.<status>". |