Webhooks

Webhooks

Events out. Signed. IDs only. Register a public https address. When something happens in your organisation, Terania sends a signed POST. The delivery names the event and the record by ID. It never carries names, email addresses or amounts. Your server fetches the detail through the API.

Four jobs.

  1. React to events. 39 event kinds across approvals, money, cases, sales, work, AI and chat. Examples: saas.invoice.paid, saas.case.opened, saas.mission.succeeded. The list is closed. The full list is on the events reference.

  2. Register in the app or by API. In Administration, Webhooks (/admin/webhooks), or POST /api/v1/webhooks with the webhook:manage scope.

  3. Keep a log. Each endpoint has a delivery log with the newest 50 deliveries: event, created, status, attempts, answer, last error, next try.

  4. Replay a dead delivery. Once your endpoint is fixed, replay re-sends a dead delivery under the same event ID.

Five things to know.

  1. A delivery has an ID. Dedupe on it. A timeout is recorded as Ambiguous and retried, so a delivery can arrive twice.

  2. The body is canonical JSON. Fixed key order, no whitespace. Verify the signature on the raw bytes, never on a re-serialised copy.

  3. A secret per endpoint. 32 random bytes, shown once, as base64url text. Rotating gives you five minutes where both the new and the old secret sign.

  4. Webhooks push data out. Automations run work inside Terania. They use different event lists.

  5. Public https only. Terania resolves the name when you save it and again on every delivery. Private, loopback and metadata addresses and Terania's own hosts are refused.

What arrives.

A POST with Content-Type: application/json and a 10 second timeout.

json
{"id":"<delivery id>","type":"saas.invoice.paid","occurredAt":"<ISO time>","tenant":"<tenant slug>","company":"<company id>","data":{"subjectKind":"invoice","subjectId":"<invoice id>"}}

Return 2xx and we stop.

Any 2xx is a success.

  1. Retried. A 408, a 429, any 5xx, and blocked answers retry after 1 minute, 5 minutes, 30 minutes and 2 hours: five attempts in all. After the fifth failure the delivery is dead.

  2. Dead at once. Any other 4xx.

  3. Ambiguous. A timeout or transport failure retries and may deliver twice.

  4. Never sent. If the record was erased between the event and the send, the delivery is dead and nothing is sent.

  5. Endpoint disabled. After 20 consecutive failures the endpoint is disabled with the reason failing, and every owner and admin is told in the app and by email. Enable it again in the app once it is fixed.

  6. Statuses. Queued, Sending, Delivered, Ambiguous, Dead.

The numbers.

  1. 20 live endpoints per organisation.

  2. 10 live subscriptions per API key maker.

  3. Address up to 2,048 characters. Up to 64 events per endpoint.

  4. A 10 second timeout per attempt.

  5. The delivery log shows the newest 50 per endpoint.

  6. Not over REST: rotate secret, enable, disable, the delivery log and replay are app screens only.

  7. Not built: a test event or ping button. Trigger a real event in a test record.

  8. Managing webhooks in the app asks for fresh proof.

Build the receiver.