Skip to content
v2.7

Webhooks

Notify a server of yours over HTTP when something happens in the project, with the events, the signature with the secret, Basic authentication, custom headers and body template, deliveries kept for 14 days and manual resending from the console.

A webhook sends a POST with the event’s JSON to a URL of yours when something happens in the project: a user created, a row changed, a file uploaded, a build finished. Use it to notify an ERP, a CRM or a chat channel without polling the API.

Webhooks live under the project’s Settings → Webhooks (the Integrations card on the overview also takes you there). Owner, Admin and Developer create and change them; the Viewer role doesn’t open the tab. Through the API, with a project API key, webhooks are in the Webhooks service; the delivery history and resending are in the console only.

Create webhook opens a four-step wizard:

  1. Destination: the name (shown only in the console) and the URL that receives the POST. Your server needs to respond 2xx within 15 s. The URL has to be public: internal addresses (localhost, private network) can’t be reached by Owbase; to test on your machine, use a tunnel. Without HTTPS, the body and the signature travel unencrypted.
  2. Events: what triggers a delivery. Each event becomes a separate POST.
  3. Security: the signing secret, HTTP Basic authentication (optional) and TLS certificate verification (on; turn it off only to test with a self-signed certificate).
  4. Review: check everything and, if you want, use Send test, which sends a signed test POST to the URL before creating.

The wizard offers these events, in groups:

Group Event When
Users users.*.create · users.*.update · users.*.delete User created, changed or deleted
users.*.sessions.*.create · users.*.sessions.*.delete Sign-in (session created) and sign-out (session ended)
users.*.update.status User blocked or unblocked
Databases databases.*.tables.*.rows.*.create · …rows.*.update · …rows.*.delete Row created, changed or deleted
databases.*.tables.*.create Table created
Storage buckets.*.files.*.create · …files.*.update · …files.*.delete File uploaded, changed or deleted
Functions functions.*.deployments.*.create · functions.*.deployments.*.update Deployment created; build finished or failed
functions.*.executions.*.create · functions.*.executions.*.update Execution started and finished
Teams teams.*.create · teams.*.memberships.*.create · teams.*.memberships.*.delete Team created; member added or removed

To listen to a single resource, replace the * with its ID under Event for a specific resource, such as buckets.products.files.*.create or databases.shop.tables.orders.rows.*.create.

Each delivery carries these headers:

Header What it carries
X-Owbase-Webhook-Id The webhook ID
X-Owbase-Webhook-Events The events that triggered the delivery, comma-separated
X-Owbase-Webhook-Name The webhook name
X-Owbase-Webhook-User-Id The user who caused the event, when there is one
X-Owbase-Webhook-Project-Id The project ID
X-Owbase-Webhook-Signature The signature

The signature is the base64 HMAC-SHA1 of the webhook URL followed by the raw body, computed with the signing secret. Check it on your server before trusting the delivery:

webhook-assinatura.ts (your server)
// Checks, on your server, the signature of a webhook delivery (X-Owbase-Webhook-Signature header).
// The signature is the HMAC-SHA1, in base64, of the webhook URL followed by the raw request body, computed with the signing secret.
// Use the body as it arrived (before JSON.parse) and the URL exactly as it is registered on the webhook.
// crypto.subtle.verify compares in constant time.
export async function validSignature(url: string, rawBody: string, signature: string, secret: string): Promise<boolean> {
const text = new TextEncoder();
const key = await crypto.subtle.importKey('raw', text.encode(secret), { name: 'HMAC', hash: 'SHA-1' }, false, ['verify']);
return crypto.subtle.verify('HMAC', key, Buffer.from(signature, 'base64'), text.encode(url + rawBody));
}
// Example: the secret lives in an environment variable, and the URL is the webhook's.
const valid = await validSignature(
'https://api.example.com/hooks/owbase',
'{"$id":"order-123","status":"paid"}',
'signature received in the header',
process.env.OWBASE_WEBHOOK_SECRET ?? '',
);
if (!valid) console.log('Reject the delivery: the signature does not match.');
  • The secret shows up in the webhook’s Settings tab (Reveal and Copy). Owbase only knows it after the first delivery or when you generate a new one.
  • Generate new secret takes effect right away: the next deliveries are already signed with the new one. Update your server right after.
  • Changing the URL changes the signature, because it is computed over the URL and the body.
  • With HTTP Basic authentication on, each delivery also carries the Authorization: Basic … header.

By default a webhook sends the event JSON and only supports Basic as authentication. To call the API of a service that asks for a token in a header (GitHub’s repository_dispatch, for example), a webhook takes two optional fields, in the API (headers and bodyTemplate) and in the Security step of the wizard and of the Settings tab:

  • HTTP headers (headers): up to 10, like Authorization: Bearer … or X-Api-Key. The values are secret and write-only: Owbase stores them encrypted, and neither the API, the console nor the MCP show a value back, only the names (headerNames). To change them, Replace headers sends the whole list again; Remove all erases them.
  • Request body (bodyTemplate): empty sends the event JSON; with a template, the body sent is the template, and the signature is computed over it.

Header rules:

  • Names use letters, digits and hyphens (up to 64); values have 1 to 2048 characters and no line breaks.
  • These are reserved and refused: Host, Content-Length, Transfer-Encoding, Connection, Upgrade, TE, Trailer, Expect, Cookie, Proxy-* and X-Owbase-*. Accept, Content-Type and User-Agent can be replaced.
  • Authorization and Basic authentication don’t go together: use one of them.
  • Changing the URL or turning certificate verification off erases the saved headers, so a token never follows to a destination you haven’t checked. Enter them again afterwards.
  • The delivery history shows only the header names (•••••• instead of the value), and a resend sends the stored value.

In the template, each variable between double curly braces becomes its JSON value (text with quotes and escapes, bare number, bare object), so the event’s content can never break your JSON:

Variable Value
event The delivery’s first event, like databases.shop.tables.orders.rows.p1.update
events The list of the delivery’s events
projectId, webhookId, deliveryId The IDs of the project, the webhook and the delivery
timestamp The send time, in ISO 8601 (UTC)
payload The whole event JSON
payload.field One field of the event, by path: payload.$id, payload.data.title, payload.tags.0. A path that doesn’t exist becomes null

An unknown variable or a malformed path refuses the webhook when you save it. The wizard shows a preview with a sample event.

Trigger a build on GitHub, Vercel or Netlify

Section titled “Trigger a build on GitHub, Vercel or Netlify”

No Function in the middle: the webhook calls the service’s API when content changes.

GitHub (repository_dispatch). Create a fine-grained token for that repository only, with the Contents: Read and write permission, and a webhook with the wizard’s GitHub preset (or through the API):

{
"url": "https://api.github.com/repos/OWNER/REPOSITORY/dispatches",
"events": ["databases.*.tables.posts.rows.*.update"],
"headers": {
"Authorization": "Bearer github_pat_…",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28"
},
"bodyTemplate": "{\"event_type\":\"owbase\",\"client_payload\":{\"event\":{{event}}}}"
}

In the repository, the workflow listens for the event type (on: repository_dispatch: types: [owbase]) and runs the build.

Vercel and Netlify. A deploy hook is a secret URL that accepts a POST with no body: use that URL as the webhook’s, with no headers or template (the event body is ignored). Treat the URL as a secret.

The webhook’s Deliveries tab shows the deliveries with the event, the status (Delivered, Failed or Retrying), the HTTP code, the duration, the attempts and the date, with filters by status and event and search by event or delivery ID. At the top are the deliveries and the success rate in 24 hours, your server’s p95 latency and the failures in a row. Each delivery opens the request (headers and body), the response and the attempts.

  • Retention: deliveries are kept for 14 days (up to 500 per webhook); after that they leave the history. The request body is kept up to 16 KB and the response body up to 8 KB; the Authorization header never goes into the history.
  • No automatic retry: a delivery that doesn’t get a 2xx within 15 s stays as Failed. Resending is manual: Resend, in a delivery’s detail, sends the same body again with a new signature; Retry failures puts every failed delivery in a queue, from the oldest to the newest, and the retry runs on the server (you can leave the screen). To resend, Owbase needs to know the secret.
  • Turned off after 10 failures in a row: the webhook stops delivering on its own. Fix the destination server and use Turn webhook back on. While off (by you or by the failures), new events don’t create deliveries and aren’t kept for later.
  • Delete webhook (in the Danger zone) also deletes the delivery history.
Was this page helpful?