background image

Webhooks

Have your server told over HTTPS when records, tables or fields change.

Webhooks

Introduction

A webhook tells your own server when something changes in a project: a record is added, changed or deleted, or a table or field changes. StellarDS.io sends an HTTPS POST with the change as JSON to the URL you register, signs it so you can check where it came from, and retries it when your server doesn't answer.

Manage webhooks on the Webhooks page of the console, or through the API below. Both need the Manage webhooks permission, which project owners and the Admin role have.

Availability

Plan Webhooks per project
Free not included
Basic not included
Pro 10
Ultimate 50

Events

Event Sent when
record.created a record is added
record.updated a record changes
record.deleted a record is deleted
table.created, table.updated, table.deleted a table is added, changed or deleted
field.created, field.updated, field.deleted a field is added, changed or deleted

A webhook gets the events you pick, for the tables you pick. With no events picked it gets every record event; with no tables picked it gets events for every table, including tables added later. Bulk changes send one event per record.

The request

POST /your/webhook HTTP/1.1
Content-Type: application/json
User-Agent: StellarDS-Webhooks/1.0
StellarDS-Event-Id: evt_0192f3c4a1b27c3e9d5f6a7b8c9d0e1f
StellarDS-Signature: t=1761921000,v1=5f1c...e9a2

{
  "id": "evt_0192f3c4a1b27c3e9d5f6a7b8c9d0e1f",
  "type": "record.updated",
  "createdAt": "2026-10-31T14:30:00Z",
  "project": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "table": { "id": 12, "name": "Orders" },
  "actor": { "userId": "6d0c3b9e-..." },
  "data": {
    "record": { "id": 1041, "Customer": "Globex", "Total": 149.50, "Status": "paid" },
    "changed": ["Status"]
  }
}
  • data.record is the record as the API returns it: after an insert or update, and before a delete. Blob fields hold their URL.
  • data.changed lists the fields an update set.
  • Field events have data.field with the field's id, name and type instead of a record.
  • actor is who made the change: a user id, and clientId when it came through an OAuth application.

The event id is the same on every attempt to deliver it. Use it to ignore an event you already handled.

Answering

Answer with any 2xx status within 10 seconds. Do the real work after answering, for example by putting the event on a queue.

Anything else counts as a failure, and the event is sent again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours: 8 attempts over about two days. Redirects are not followed.

A webhook that keeps failing for 3 days is switched off, and the project's owners get an email. Fix your endpoint, then switch the webhook on again on the Webhooks page or with PUT /v1/webhooks/{id} and "isActive": true. Events that happened while it was off are not sent afterwards; deliveries that failed can be sent again from the delivery log.

Checking the signature

Every request has a StellarDS-Signature header:

StellarDS-Signature: t=1761921000,v1=5f1c...e9a2

t is the time it was signed, in Unix seconds, and v1 is the hexadecimal HMAC-SHA256 of "{t}.{body}", keyed with the webhook's signing secret (the whole whsec_... string). To check a request:

  1. Read the raw request body, before any JSON parsing.
  2. Compute the HMAC-SHA256 of t + "." + body with your secret and compare it to v1 with a constant-time comparison.
  3. Refuse requests whose t is more than 5 minutes away from your clock, so a captured request can't be replayed later.

With the .NET SDK this is one call:

var body = await new StreamReader(Request.Body).ReadToEndAsync();
if (!WebhookSignature.Verify(body, Request.Headers["StellarDS-Signature"], secret))
    return Unauthorized();

The TypeScript and Python SDKs have the same check. In Node.js without the SDK:

const crypto = require("crypto");

function verify(body, header, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(",").map(p => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > toleranceSeconds) return false;
  const expected = Buffer.from(crypto.createHmac("sha256", secret).update(`${parts.t}.${body}`).digest("hex"));
  return header.split(",").filter(p => p.startsWith("v1=")).some(p => {
    const actual = Buffer.from(p.slice(3));
    return actual.length === expected.length && crypto.timingSafeEqual(actual, expected);
  });
}

Rotating the secret

The secret is shown once, when you create the webhook. Rotating it gives you a new one; for the next 24 hours requests carry a v1 signature for both the old and the new secret, so you can update your server without missing events. Check that any v1 matches.

API

Every route takes the project as ?project={projectId}.

Method Route Does
GET /v1/webhooks list the webhooks
POST /v1/webhooks create one; the response has the secret, only this once
GET, PUT, DELETE /v1/webhooks/{id} read, change, delete
POST /v1/webhooks/{id}/test send a ping event now
POST /v1/webhooks/{id}/rotate-secret get a new secret
GET /v1/webhooks/{id}/deliveries the delivery log, newest first (offset, take up to 200)
POST /v1/webhooks/{id}/deliveries/{deliveryId}/redeliver send a delivered or failed event again
curl -X POST "https://api.stellards.io/v1/webhooks?project=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
        "url": "https://example.com/stellar/webhook",
        "events": ["record.created", "record.updated"],
        "tableIds": [12]
      }'

The URL must use HTTPS and can't point to a private or local network address. The test ping is sent once, without retries, also to a webhook that is switched off, so you can check a fixed endpoint before switching it back on.