Docs · Webhooks

Webhooks

Webhooks are in private beta. The event catalog is provisioned per workspace; we do not publish a fixed count that the code does not expose.

Back to docs
Status

Private beta

Access is provisioned by the team. No public package is promised before it exists.

Availability

Private beta. Request access through the contact form. The production event catalog will be generated from the API code, not typed by hand.

Delivery

Signed payloads with HMAC-SHA256, retries with exponential backoff, replay from the dead-letter queue, and a request id for every attempt.

Verification

Verify the signature against the raw request body before parsing JSON. Reject timestamps older than five minutes.

Local testing

Use a tunnel to expose your local endpoint, or replay a stored delivery from the dashboard once access is provisioned.

A small brass bell on a dark desk beside a folded note.

The short version

  • No public webhook surface is live on loopnow.in today. This page is the delivery contract the receiver side is being built against, not a tour of a dashboard that already sends events.
  • Delivery is designed to be at-least-once, so a receiver must deduplicate on the event id and tolerate events arriving out of order.
  • Payloads are signed with HMAC-SHA256 over the exact bytes of the request body. Verify first, parse JSON second.
  • Reject signatures whose timestamp is more than five minutes old, and keep a short replay cache keyed by event id.
  • Retries follow an exponential backoff with jitter and end in a dead-letter queue that can be replayed by hand.
  • A healthy receiver acknowledges in a second or two, writes the event id, and does the real work in a queue.

What exists today, and what this page is

LoopNow does not expose a public webhook surface today. The webhooks page in these docs describes the feature as a private beta, and that is the accurate description: event types are provisioned per workspace for design partners rather than published as a fixed catalog. Any complete-looking list of event names elsewhere on this site should be read as illustrative, not as a promise about what the sender will emit.

This page is therefore a contract rather than a reference. It describes the envelope, the signing scheme, the retry behaviour and the obligations a receiver takes on, all of which the implementation is being built to satisfy. If you write against it now, you are writing the part you fully control: signature verification, deduplication, acknowledgement speed and failure handling. None of that changes when the sender ships.

A four-layer diagram showing a workspace event source, the delivery layer with signing and retries, the customer endpoint with its verifier, and the delivery records kept for replay. Workspace Event source Rule filter Delivery Signer Queue Retry Your side Endpoint Verifier Records Delivery log Dead letter
Figure 1. The planned path from a workspace event to a customer endpoint, with delivery records kept on the LoopNow side and verification owned by the receiver.

One caution before the details. A contract written ahead of the implementation can drift. Where a detail here is a target rather than a shipped behaviour, the sentence says so. When the surface opens, the delivery log inside the workspace will be the source of truth for what was actually sent, and this page will be corrected to match it rather than the other way round.

The envelope you will receive

Every delivery carries the same outer shape regardless of what changed inside the workspace. A stable identifier names the event, a dotted type names the kind of change, a Unix timestamp records when the event was created, and a data object holds the payload. Two more fields matter to receivers: the version of the payload contract the event was rendered against, and the workspace the event belongs to.

Treat the type as a routing hint, not as a schema. New event types will be added without breaking the envelope, and a receiver that switches on type with no default branch will start dropping events silently the day one appears. Log unknown types, acknowledge them, and alert on the rate rather than throwing. The data object is the part that is allowed to grow; the outer shape is the part meant to stay still.

An annotated diagram of the webhook envelope showing the event id, type, timestamp and payload as separate fields around a central delivery object. LoopNow runtime id idempotency key type routing hint only created_at unix seconds data event payload
Figure 2. The six envelope fields, with the event id and the API version carrying most of the receiver-side risk if they are ignored.

The id is what your idempotency depends on, so persist it before doing any work and keep it longer than the retry window. A day is a reasonable floor and a week is safer. Do not derive your own key from the payload contents: two genuine events can carry identical data, and collapsing them throws away a real state change.

  • id: stable string, identical across every retry of the same event
  • type: dotted name such as resource plus action, never parsed for business rules
  • created_at: Unix seconds, set when the event is recorded rather than when it is delivered
  • data: the event payload, additive over time, safe to store raw
  • api_version: pins the payload shape so a receiver migrates on its own schedule

The delivery path, step by step

The event is recorded inside the workspace first, in the same transaction that changes the underlying record. Delivery is a separate step that reads from an outbox, which is why a rollback cannot leave an event claiming something that never happened. The outbox row is the durable record; everything after it is retryable.

A per-workspace rule decides which endpoints want the event. The payload is rendered once, signed once, and the signed bytes are what gets retried, so a receiver comparing hashes across attempts sees the same body every time. Re-rendering the payload on each attempt is the classic way to break signature verification, because the underlying record may have moved on.

A five-step flow diagram running from the recorded event through rule matching and signing to the HTTP attempt and its acknowledgement. 1 Event recorded 2 Rule matched 3 Payload signed 4 Attempt sent 5 2xx acknowledged
Figure 3. Five stages of one delivery attempt, ending at the only signal the sender trusts: a 2xx response to that specific request.

An attempt succeeds on any 2xx response. Redirects are not followed, because following a 301 changes where the payload lands and can leak it to a host you did not configure. A timeout is a failure even if your handler eventually finished the work: without a receipt, the sender has no choice but to assume the event was lost and retry it.

At-least-once, and why that is the honest choice

The guarantee is at-least-once. Every event that is recorded will eventually reach every matching endpoint, but a given event may arrive more than once. Duplicates come from ordinary failures: your handler committed the work and then the connection dropped before the response was written, or the acknowledgement was lost in a proxy. The sender cannot distinguish that from a failure it should retry.

Exactly-once delivery over HTTP would require both sides to share transactional state, and it still breaks when a process dies between the commit and the response. Promising it would push a hard distributed systems problem onto every customer. Duplicates you can handle with one indexed column are a much better trade than a guarantee nobody can verify.

A side-by-side comparison of at-least-once delivery with duplicate handling against exactly-once delivery and its coupling requirements. At-least-once (planned) Exactly-once (not offered) • Every event arrives• Duplicates are possible• Receiver deduplicates• Order is not guaranteed• Simple to operate • Needs shared state• Couples both sides• Breaks on partial writes• Not achievable over HTTP• Would be a false promise
Figure 4. Why the honest guarantee is at-least-once with receiver-side deduplication, rather than an exactly-once promise that HTTP cannot keep.

The practical consequence is that the event id is part of your data model, not an implementation detail of the handler. Insert it with a unique constraint in the same transaction as the side effect, and return success when the insert conflicts. That one pattern turns at-least-once delivery into effectively-once processing, which is the guarantee that actually matters to the business.

What happens when verification fails

The check order matters more than the check itself. Read the raw body, pull the timestamp and signature from the headers, recompute the digest over the raw bytes, compare in constant time, then check that the timestamp is within five minutes. Only after all of that should you call a JSON parser. Parsing first and re-serialising to verify is how receivers end up with signatures that pass in testing and fail in production.

A failed digest means the request did not come from the sender, or a proxy rewrote the body. Return 401 and do nothing else. A stale timestamp with a valid digest is usually clock skew on your host, so log the delta before rejecting; if the same endpoint reports a steady drift, fix the clock rather than widening the window. A duplicate id is not an error and should return 200 so the sender stops retrying.

A decision diagram branching from a failed verification into a bad signature, a stale timestamp and a duplicate event, each with its own response. Verification fails. What comes next? decision Digest mismatch reject with 401 Stale timestamp reject, log clock skew Duplicate event id return 200, skip work
Figure 5. The three outcomes a receiver should distinguish on the verification path, and the response each one deserves.

Keep the rejection path cheap. Signature checks run before any database access, so a flood of forged requests cannot amplify into query load. Log the endpoint id and the reason, never the secret and never the full body, because a verification failure log is exactly the kind of file that gets copied into a support ticket.

The retry schedule

Retries are spaced rather than immediate, because the failures worth retrying are usually transient: a deploy, a cold start, a saturated connection pool. The planned schedule starts with a short delay and doubles from there, with jitter applied so a thousand endpoints that all failed during the same incident do not come back in the same second. The chart shows the base delay before jitter, in seconds.

Not every response deserves a retry. A 5xx, a 429, a connection reset or a timeout is worth another attempt. A 400 or a 422 means the payload or the endpoint is wrong, and repeating it five times only fills your logs. A 401 from a receiver that rotates its verification secret is a special case: it should be retried slowly while the operator fixes the configuration, and it should raise an alert rather than disappear into the queue.

A bar chart of retry delays in seconds, rising from ten seconds on the first retry to an hour on the fifth. First retry 10s Second retry 60s Third retry 300s Fourth retry 900s Fifth retry 3600s
Figure 6. Base delays between retry attempts in the planned schedule, before jitter is applied and before the endpoint-level circuit breaker trips.

Retry state belongs to the endpoint, not to the individual event. An endpoint that fails ten events in a row is broken, and continuing to hammer it at the normal rate turns a small outage into a large one. After a threshold of consecutive failures the sender should pause that endpoint, keep queueing, and notify the workspace owner. Pausing is reversible; a flood is not.

Dead letters and manual replay

When the schedule runs out, the event is not deleted. It moves to a dead-letter queue with the last response status, the last error body truncated to a sane length, and the number of attempts. The queue is per endpoint, which makes the common case obvious: one endpoint with two hundred dead letters is a broken receiver, while two hundred endpoints with one each is usually an outage on the customer side.

Replay is a deliberate action, not an automatic one. An operator picks a time range or a set of event ids, inspects one payload, and re-sends through the same signing path so the receiver sees an ordinary delivery. Because the event id does not change, a receiver that deduplicates correctly will ignore anything it already processed. That is the property that makes replay safe to offer without a confirmation dialog per event.

A timeline showing a failed first attempt, the retry window, the move to the dead-letter queue, an optional manual replay and final retention expiry. T+0 Attempt fails status and body recorded T+90m Retries exhausted six attempts, jittered T+90m Moved to dead letter replay stays possible on demand Operator replays same id, new signature T+7d Payload expires metadata kept for audit
Figure 7. The life of a delivery that never succeeds, from the first failed attempt through dead-letter retention and the point where replay is no longer possible.

Dead letters need an owner and an expiry. The planned retention is seven days, after which the payload is dropped and only the metadata remains for audit. A queue that never expires becomes a second, worse database, and a queue nobody watches is indistinguishable from a feature that silently stopped working. Both failure modes are worth designing against before the first customer hits them.

Writing a receiver that survives

The single most useful rule is to acknowledge before you work. Verify the signature, write the event id into a durable queue or table, return 200, and let a worker do the slow part. If the worker dies, the event is still in your queue. If the handler times out because it called three APIs and resized an image, the sender retries and you process the same thing twice while the first attempt is still running.

Most web frameworks parse the body for you, which is exactly what breaks signature verification. Express, Fastify, Hono, Astro endpoints and serverless handlers all offer a raw-body path; use it for this route and parse manually. If the framework has already consumed the stream, the bytes are gone and recomputing a digest over a re-serialised object will produce a different signature for anything involving key order, unicode escaping or whitespace.

A wireframe of a receiver handler showing five ordered rows from signature verification through enqueue and the final 200 response. Verify signature Parse raw JSON Insert event id Enqueue for worker Return 200
Figure 8. The order of operations inside a receiver route: verify, persist, acknowledge, and only then hand the payload to a worker.

Make the worker idempotent for the same reason the endpoint is: a queue can deliver twice, and a retried job is normal. Put the deduplication constraint in the database rather than in application memory, because the process that handled the first copy is usually not the process handling the second. In-memory sets look correct in development and fail the first time you run two instances.

Where deliveries actually break

The interesting failures are rarely in your business logic. They are in DNS, in TLS, in a load balancer that answers before your application does. An expired certificate looks exactly like an endpoint that is down, and it will keep looking that way for every retry until someone renews it. A hostname that resolves to an old IP after a migration produces a steady trickle of failures that no amount of retrying can fix.

Timeouts are the next most common cause, and they are usually self-inflicted. A serverless function that cold-starts, opens a database connection and calls two external APIs can easily spend more than the sender is willing to wait. The fix is architectural: accept the request, write to a queue, return. Body size limits and proxy buffering cause stranger symptoms, including a 502 that your application never sees and therefore never logs.

A map of six failure surfaces for webhook delivery: DNS, TLS, timeouts, server errors, rate limits and body parsing. DNS resolution stale records TLS handshake expired certs Read timeouts slow cold starts 5xx responses dependency down Rate limiting your own edge Body parsing consumed stream
Figure 9. The six places a delivery usually dies, ordered roughly by how often they are misdiagnosed as an application bug.

Finally, expect your own dependencies to fail at the worst moment. If the receiver writes to a database that is briefly unavailable, the event is not lost, but it will be retried, and the retry arrives while the first attempt is still waiting on a connection. Timeouts inside the handler should be shorter than the sender timeout, so the handler fails on its own terms and can record why.

Deduplication and ordering

Order is not guaranteed, and it is worth being precise about what that means. Two events about the same contact can arrive in either order, and a retry can place an older event after a newer one. If your handler applies a full record from the payload, a late arrival can overwrite a correct newer state with a stale one. That is a silent data bug, and it is much harder to notice than a duplicate.

The usual defence is a version or a timestamp on the entity itself. Compare the incoming version with the stored one and drop anything older; store the version in the same row you are updating so the check is atomic. When the payload carries only a partial change, apply it as an operation rather than as a replacement, and let the operation be idempotent so applying it twice is harmless.

A five-step flow showing an event arriving, an id lookup, a skip or process branch, an id record and an acknowledgement. 1 Receive event 2 Look up event id 3 Skip or process 4 Record id 5 Acknowledge
Figure 10. The deduplication loop a receiver runs on every delivery, where the insert and the side effect share one transaction.

Partial failure between the side effect and the acknowledgement is the case that catches people. The work is done, the response never leaves, and the retry repeats the work. If the side effect is a payment, an email or a message, that is a customer-visible bug rather than a duplicate row. The event id constraint has to cover the side effect, not just the log line that says it happened.

Testing before the first real event

You can build the whole receiver before the sender exists. Start with fixtures: store two or three realistic payloads as files, sign them with a test secret, and post them at your own endpoint. A test that signs the exact bytes it sends catches the raw-body bug immediately, which is the one that would otherwise surface on the first production delivery at an inconvenient hour.

Then test the unglamorous cases. Send a body with a signature computed over different bytes and assert a 401. Send a valid signature with a timestamp twenty minutes old and assert rejection. Send the same event twice and assert one side effect. Send an unknown type and assert a 200 with a log line. These four tests cover most of the ways a webhook integration fails in its first week.

A decision diagram offering a tunnel to localhost, replayed fixture files and self-signed requests, each with the property it verifies. How do you test a receiver before launch? decision Tunnel to localhost real transport, fake data Replay fixtures deterministic, repeatable Sign your own request unit-tests verifier
Figure 11. Three ways to exercise a receiver before the sender ships, and what each one actually proves.

For end-to-end testing, expose a local port through a tunnel and point a staging endpoint at it, or replay stored fixtures from a script. Do not test against production with real events and a handler that writes to a production database. When the surface opens, rotate the signing secret per environment, keep the staging secret out of the repository, and treat the first live event as a monitored deployment rather than a formality.

Frequently asked questions

Is there a public webhook API I can subscribe to today?

No. The webhook surface is a private beta provisioned per workspace, so there is no self-serve endpoint configuration and no published event catalog. You can request access through the contact form. Everything on this page describes the contract being implemented, which is enough to build and test a receiver now, but it is not a claim that deliveries are flowing to self-serve accounts.

Why at-least-once instead of exactly-once delivery?

Because exactly-once over HTTP is not achievable without shared transactional state on both sides, and even then a crash between committing work and writing the response breaks it. At-least-once with a deduplication key gives you effectively-once processing, which is what your business logic actually needs, and it fails in ways you can observe and repair rather than in ways you cannot.

Which header carries the signature, and what exactly is signed?

The planned scheme sends a timestamp and a hexadecimal HMAC-SHA256 digest in separate headers, computed over the timestamp, a dot, and the raw request body. The body is signed before any parsing, so byte order, whitespace and unicode escaping all matter. The exact header names will be fixed when the surface is provisioned, and the delivery log will show them for each attempt.

How large is the timestamp tolerance window?

Five minutes either side of the current time. That is wide enough to absorb ordinary clock drift between hosts and narrow enough that a captured request cannot be replayed indefinitely. If your endpoint reports a consistent drift, fix the host clock rather than widening the window. NTP is usually one configuration change away, and a widened window quietly weakens the replay protection you built.

What counts as a successful delivery?

Any 2xx status returned within the timeout. Redirects are not followed, so a 301 or 302 is treated as a failure and eventually lands in the dead-letter queue. A 3xx usually means the endpoint URL moved without the workspace configuration being updated, which is a configuration fix rather than a code fix, and the delivery log records the status so the cause is visible.

Can I replay an event I processed incorrectly?

Yes, once the surface is provisioned. Replay is manual and operates on the dead-letter queue or on a stored delivery. The event keeps its original id, so a receiver that deduplicates correctly will ignore a replay it already handled. If you need to reprocess deliberately, delete your stored id for that event first, and understand that the side effect will happen a second time.

How long are failed payloads retained?

The planned retention is seven days in the dead-letter queue, after which the payload is discarded and only metadata such as the event id, endpoint, status and attempt count remains for audit. Retention exists so an operator has a working window to fix a receiver and replay, not so the queue becomes a long-term archive. Store what you need on your side.

Do events arrive in the order they happened?

No, and the design does not pretend otherwise. Retries, parallel workers and network paths all reorder deliveries. If order matters for a given entity, put a version or timestamp in the payload and reject anything older than what you have stored. Applying partial changes as idempotent operations is more robust than expecting the transport to preserve sequence.

What should a receiver return when it does not recognise the event type?

Return 200 and log the type. A new event type is an additive change, not an error, and a receiver that returns 4xx will be retried until it lands in the dead-letter queue for no useful reason. Alert on the rate of unknown types instead, because a sudden rise usually means the payload contract moved and your parser needs a branch it does not have yet.

How do I rotate the signing secret without dropping deliveries?

Accept two secrets during a rotation window: the new one and the previous one. Provision the new secret, deploy the receiver so it verifies against either, then switch the sender and finally remove the old secret once the delivery log shows no failures. Rotating by replacing the secret in one step guarantees a burst of 401 responses that looks exactly like an outage.

Sources and further reading

  1. RFC 2104 — HMAC: Keyed-Hashing for Message Authentication
  2. RFC 7231 — HTTP/1.1 Semantics and Content
  3. Cloudflare Workers — Request and Response objects
  4. Node.js crypto — createHmac and timingSafeEqual
LoopNow AI Answers from published LoopNow pages
Hi — ask me about LoopNow products, pricing, DPDP or migration. I answer from the published site and can connect you to the team.
Contact page