API reference
Webhooks
Register endpoints in code and receive signed events as they happen.
List webhooks
GET/webhookswebhooks:read
Returns your webhook endpoints. Signing secrets are not included.
curl -X GET "https://baiocodesolutions.com/api/v1/webhooks" \
-H "Authorization: Bearer $DEEPBERTH_TOKEN"const response = await fetch("https://baiocodesolutions.com/api/v1/webhooks", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.DEEPBERTH_TOKEN}`,
},
});
console.log(await response.json());import os, requests
response = requests.get(
"https://baiocodesolutions.com/api/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['DEEPBERTH_TOKEN']}"},
)
print(response.status_code, response.json())$response = Http::withToken(env('DEEPBERTH_TOKEN'))
->get('https://baiocodesolutions.com/api/v1/webhooks');
dump($response->status(), $response->json());200 OK
{
"data": [
{
"id": 31,
"app_id": 12,
"url": "https://api.yourbrand.com/hooks/deepberth",
"events": [
"install",
"purchase"
],
"is_enabled": true,
"created_at": "2026-11-08T12:00:00+00:00"
}
]
}Create a webhook
POST/webhookswebhooks:write
Registers a public https address. signing_secret appears only in this response.
| Parameter | Type | Description |
|---|---|---|
app_idRequired |
integer | The app this belongs to, from GET /apps. |
urlRequired |
string | A public https address. |
events |
array | Event names to receive. Leave empty for all events. |
is_enabled |
boolean | Set to false to pause deliveries. |
curl -X POST "https://baiocodesolutions.com/api/v1/webhooks" \
-H "Authorization: Bearer $DEEPBERTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"app_id": 12,
"url": "https://api.yourbrand.com/hooks/deepberth",
"events": [
"install",
"purchase"
]
}'const response = await fetch("https://baiocodesolutions.com/api/v1/webhooks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DEEPBERTH_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"app_id": 12,
"url": "https://api.yourbrand.com/hooks/deepberth",
"events": [
"install",
"purchase"
]
}),
});
console.log(await response.json());import os, requests
response = requests.post(
"https://baiocodesolutions.com/api/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['DEEPBERTH_TOKEN']}"},
json={
"app_id": 12,
"url": "https://api.yourbrand.com/hooks/deepberth",
"events": [
"install",
"purchase"
]
},
)
print(response.status_code, response.json())$response = Http::withToken(env('DEEPBERTH_TOKEN'))
->post('https://baiocodesolutions.com/api/v1/webhooks',
[
'app_id' => 12,
'url' => 'https://api.yourbrand.com/hooks/deepberth',
'events' => [
'install',
'purchase',
],
]);
dump($response->status(), $response->json());201 Created
{
"data": {
"id": 31,
"app_id": 12,
"url": "https://api.yourbrand.com/hooks/deepberth",
"events": [
"install",
"purchase"
],
"is_enabled": true,
"created_at": "2026-11-08T12:00:00+00:00",
"signing_secret": "whsec_..."
}
}Update a webhook
PATCH/webhooks/{id}webhooks:write
Changes the address, events or enabled state.
| Parameter | Type | Description |
|---|---|---|
url |
string | A public https address. |
events |
array | Event names to receive. Leave empty for all events. |
is_enabled |
boolean | Set to false to pause deliveries. |
curl -X PATCH "https://baiocodesolutions.com/api/v1/webhooks/31" \
-H "Authorization: Bearer $DEEPBERTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": false
}'const response = await fetch("https://baiocodesolutions.com/api/v1/webhooks/31", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.DEEPBERTH_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"is_enabled": false
}),
});
console.log(await response.json());import os, requests
response = requests.patch(
"https://baiocodesolutions.com/api/v1/webhooks/31",
headers={"Authorization": f"Bearer {os.environ['DEEPBERTH_TOKEN']}"},
json={
"is_enabled": False
},
)
print(response.status_code, response.json())$response = Http::withToken(env('DEEPBERTH_TOKEN'))
->patch('https://baiocodesolutions.com/api/v1/webhooks/31',
[
'is_enabled' => false,
]);
dump($response->status(), $response->json());200 OK
{
"data": {
"is_enabled": false,
"id": 31,
"app_id": 12,
"url": "https://api.yourbrand.com/hooks/deepberth",
"events": [
"install",
"purchase"
],
"created_at": "2026-11-08T12:00:00+00:00"
}
}Delete a webhook
DELETE/webhooks/{id}webhooks:write
Stops deliveries to this endpoint.
curl -X DELETE "https://baiocodesolutions.com/api/v1/webhooks/31" \
-H "Authorization: Bearer $DEEPBERTH_TOKEN"const response = await fetch("https://baiocodesolutions.com/api/v1/webhooks/31", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.DEEPBERTH_TOKEN}`,
},
});
console.log(response.status);import os, requests
response = requests.delete(
"https://baiocodesolutions.com/api/v1/webhooks/31",
headers={"Authorization": f"Bearer {os.environ['DEEPBERTH_TOKEN']}"},
)
print(response.status_code)$response = Http::withToken(env('DEEPBERTH_TOKEN'))
->delete('https://baiocodesolutions.com/api/v1/webhooks/31');
dump($response->status());204 No Content
Verify each delivery
Each delivery has an X-Deepberth-Signature header with a timestamp and an HMAC-SHA256 signature of the timestamp, a period and the raw body. Check it before trusting the request. Respond with a 2xx status quickly. Failed deliveries are retried up to five times over about seven hours.
import { createHmac, timingSafeEqual } from "node:crypto";
function isValid(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest();
const received = Buffer.from(parts.v1, "hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && received.length === expected.length && timingSafeEqual(received, expected);
}