Webhooks
Endpoints de la ressource Webhooks. Tous les appels exigent une authentification et renvoient l’enveloppe JSON standard.
URL de base: https://companybelgium.be/api/v2 · Authentification
List all webhooks#
Every webhook registered for the authenticated company.
Cet endpoint ne prend aucun paramètre.
Requête
curl https://companybelgium.be/api/v2/webhooks \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhooks", {
method: "GET",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": [
{
"id": "wh_1a2b",
"name": "Prod listener",
"url": "https://example.be/hooks/bce",
"disabled": false
}
],
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Create a webhook#
Registers an outbound webhook. The HMAC signing secret is returned only once, in this response — store it securely.
Corps de requête
{
"name": "Prod listener",
"url": "https://example.be/hooks/bce",
"entityNumbers": [
"0403.170.701"
]
}Requête
curl -X POST https://companybelgium.be/api/v2/webhook \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{"name":"Prod listener","url":"https://example.be/hooks/bce","entityNumbers":["0403.170.701"]}'const res = await fetch("https://companybelgium.be/api/v2/webhook", {
method: "POST",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
"Content-Type": "application/json",
},
body: JSON.stringify({"name":"Prod listener","url":"https://example.be/hooks/bce","entityNumbers":["0403.170.701"]}),
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"id": "wh_1a2b",
"name": "Prod listener",
"url": "https://example.be/hooks/bce",
"hmacSecret": "whsec_8f3...redacted",
"disabled": false
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Retrieve a webhook#
A single webhook by id.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Requête
curl https://companybelgium.be/api/v2/webhook/wh_1a2b \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b", {
method: "GET",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"id": "wh_1a2b",
"name": "Prod listener",
"url": "https://example.be/hooks/bce",
"disabled": false
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Update a webhook#
Update name, url or disabled flag.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Corps de requête
{
"name": "Prod listener (paused)",
"disabled": true
}Requête
curl -X PUT https://companybelgium.be/api/v2/webhook/wh_1a2b \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{"name":"Prod listener (paused)","disabled":true}'const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b", {
method: "PUT",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
"Content-Type": "application/json",
},
body: JSON.stringify({"name":"Prod listener (paused)","disabled":true}),
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"id": "wh_1a2b",
"name": "Prod listener (paused)",
"disabled": true
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Delete a webhook#
Deletes the webhook and cascades its subscriptions and delivery events.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Requête
curl -X DELETE https://companybelgium.be/api/v2/webhook/wh_1a2b \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b", {
method: "DELETE",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"deleted": true
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Rotate the HMAC signing secret#
Generates a new HMAC secret, returned only once. The old secret stops being valid immediately.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Requête
curl -X PATCH https://companybelgium.be/api/v2/webhook/wh_1a2b/hmac-secret \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b/hmac-secret", {
method: "PATCH",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"id": "wh_1a2b",
"hmacSecret": "whsec_new...redacted"
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Send a test delivery#
Manually triggers a test event so you can verify your endpoint and signature handling.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Requête
curl -X POST https://companybelgium.be/api/v2/webhook/wh_1a2b/trigger \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b/trigger", {
method: "POST",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"delivered": true,
"eventId": "evt_test_001"
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}List subscribed entity numbers#
Entity numbers this webhook is subscribed to.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Requête
curl https://companybelgium.be/api/v2/webhook/wh_1a2b/subscriptions \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b/subscriptions", {
method: "GET",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": [
"0403.170.701",
"0738.916.702"
],
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Add entity subscriptions#
Subscribe the webhook to one or more enterprise/establishment numbers.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Corps de requête
{
"entityNumbers": [
"0738.916.702"
]
}Requête
curl -X POST https://companybelgium.be/api/v2/webhook/wh_1a2b/subscriptions \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{"entityNumbers":["0738.916.702"]}'const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b/subscriptions", {
method: "POST",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
"Content-Type": "application/json",
},
body: JSON.stringify({"entityNumbers":["0738.916.702"]}),
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"added": 1
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Remove entity subscriptions#
Unsubscribe the webhook from given entity numbers.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Corps de requête
{
"entityNumbers": [
"0738.916.702"
]
}Requête
curl -X DELETE https://companybelgium.be/api/v2/webhook/wh_1a2b/subscriptions \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{"entityNumbers":["0738.916.702"]}'const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b/subscriptions", {
method: "DELETE",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
"Content-Type": "application/json",
},
body: JSON.stringify({"entityNumbers":["0738.916.702"]}),
});
const { data } = await res.json();Réponse
{
"success": true,
"data": {
"removed": 1
},
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}Delivery log#
The last 100 delivery attempts with status, response code and timestamp.
Paramètres
| Nom | Dans/Type | Requis | Description |
|---|---|---|---|
id |
path string | Requis | Webhook id. |
Requête
curl https://companybelgium.be/api/v2/webhook/wh_1a2b/events \
-H "X-API-Key: $API_KEY" -H "X-API-Secret: $API_SECRET"const res = await fetch("https://companybelgium.be/api/v2/webhook/wh_1a2b/events", {
method: "GET",
headers: {
"X-API-Key": process.env.API_KEY,
"X-API-Secret": process.env.API_SECRET,
},
});
const { data } = await res.json();Réponse
{
"success": true,
"data": [
{
"eventId": "evt_001",
"status": "delivered",
"responseCode": 200,
"at": "2026-06-05T09:00:00Z"
}
],
"error": null,
"timestamp": "2026-06-05T09:00:00.000Z",
"meta": null
}