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"

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.

ParameterTypeDescription
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"
    ]
}'

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.

ParameterTypeDescription
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
}'

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"

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);
}