Webhook
Where the panel tells another service about users, with the secret, events and thresholds.
4 endpoints
GET /api/webhook
Read Webhook
The webhook settings in effect: addresses, the secret (shown in full: this is sudo only), which events are sent, the usage and days-left thresholds, the retry settings, whether they come from the panel or from .env, the latest attempt and how many notifications are waiting.
Sudo admin only
Response 200 Successful Response · WebhookState
Response fields
| Field | Type | Description |
|---|---|---|
settings | WebhookSettings | |
source | string | |
env | WebhookSettings | |
last | object | |
queued | integer |
{
"settings": {
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
},
"source": "string",
"env": {
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
},
"last": {},
"queued": 0
}Errors: 401 Unauthorized
curl -X GET 'https://YOUR-PANEL/api/webhook' \
-H 'Authorization: Bearer $TOKEN'PUT /api/webhook
Update Webhook
Save the webhook settings in the panel. From now on they win over the .env values.
Sudo admin only
Request body application/json · WebhookSettings
| Field | Type | Required | Description |
|---|---|---|---|
addresses | string[] | no | Default: []. |
secret | string | no | |
events | object | no | Default: {}. |
usage_percent | integer[] | no | Default: [80]. |
days_left | integer[] | no | Default: [3]. |
retry_seconds | integer | no | Default: 180. |
retries | integer | no | Default: 3. |
{
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
}Response 200 Successful Response · WebhookState
Response fields
| Field | Type | Description |
|---|---|---|
settings | WebhookSettings | |
source | string | |
env | WebhookSettings | |
last | object | |
queued | integer |
{
"settings": {
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
},
"source": "string",
"env": {
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
},
"last": {},
"queued": 0
}Errors: 401 Unauthorized
curl -X PUT 'https://YOUR-PANEL/api/webhook' \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"addresses": [], "secret": "", "events": {}, "usage_percent": [80], "days_left": [3], "retry_seconds": 180, "retries": 3}'DELETE /api/webhook
Reset Webhook
Forget the settings saved in the panel and use the .env values again.
Sudo admin only
Response 200 Successful Response · WebhookState
Response fields
| Field | Type | Description |
|---|---|---|
settings | WebhookSettings | |
source | string | |
env | WebhookSettings | |
last | object | |
queued | integer |
{
"settings": {
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
},
"source": "string",
"env": {
"addresses": [],
"secret": "",
"events": {},
"usage_percent": [
80
],
"days_left": [
3
],
"retry_seconds": 180,
"retries": 3
},
"last": {},
"queued": 0
}Errors: 401 Unauthorized
curl -X DELETE 'https://YOUR-PANEL/api/webhook' \
-H 'Authorization: Bearer $TOKEN'POST /api/webhook/test
Test Webhook
Send a test event (action: "test") to every address, or to the addresses you pass, and return what each one answered: HTTP status, time in ms, or the error.
Sudo admin only
Request body application/json · WebhookTestIn
| Field | Type | Required | Description |
|---|---|---|---|
addresses | string[] | no | |
secret | string | no |
{
"addresses": [
"string"
],
"secret": "string"
}Response 200 Successful Response
Errors: 401 Unauthorized
curl -X POST 'https://YOUR-PANEL/api/webhook/test' \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"addresses": ["string"], "secret": "string"}'