Skip to content

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
FieldTypeDescription
settingsWebhookSettings
sourcestring
envWebhookSettings
lastobject
queuedinteger
json
{
  "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

bash
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

FieldTypeRequiredDescription
addressesstring[]noDefault: [].
secretstringno
eventsobjectnoDefault: {}.
usage_percentinteger[]noDefault: [80].
days_leftinteger[]noDefault: [3].
retry_secondsintegernoDefault: 180.
retriesintegernoDefault: 3.
json
{
  "addresses": [],
  "secret": "",
  "events": {},
  "usage_percent": [
    80
  ],
  "days_left": [
    3
  ],
  "retry_seconds": 180,
  "retries": 3
}

Response 200 Successful Response · WebhookState

Response fields
FieldTypeDescription
settingsWebhookSettings
sourcestring
envWebhookSettings
lastobject
queuedinteger
json
{
  "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

bash
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
FieldTypeDescription
settingsWebhookSettings
sourcestring
envWebhookSettings
lastobject
queuedinteger
json
{
  "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

bash
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

FieldTypeRequiredDescription
addressesstring[]no
secretstringno
json
{
  "addresses": [
    "string"
  ],
  "secret": "string"
}

Response 200 Successful Response

Errors: 401 Unauthorized

bash
curl -X POST 'https://YOUR-PANEL/api/webhook/test' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"addresses": ["string"], "secret": "string"}'

Alexen v2.3.16 · 208 API endpoints