# Sigfox webhooks in production: duplicates, ordering, retries and timeouts

Agent skill: `npx skills add hookdeck/webhook-skills --skill sigfox-webhooks` ([details](https://hookdeck.com/webhooks/sigfox/skill))

This guide covers the problems Sigfox webhooks, which Sigfox calls callbacks, cause in production and how to handle each one. What Sigfox sends is on the [Sigfox webhooks](/webhooks/sigfox) overview, the documented event values are on [Sigfox webhook events](/webhooks/sigfox/events), and the secret header check is on [Verify Sigfox webhooks](/webhooks/sigfox/verify).

Sigfox defines no fixed payload. Each callback sends the URL, headers and body you write, with variables such as `{device}` and `{data}` filled in, so the fixes below depend on what you put in your templates.

## At a glance

| Problem | What to do | With Event Gateway |
| --- | --- | --- |
| [Timeouts](#timeouts) | Return a `2xx` within 10 seconds; process in a background job | Accepts each one-way callback at once, then queues it for your service |
| [Duplicates](#duplicates) | Key on `{device}`, `{seqNumber}` and `{time}` | Can drop repeats before they reach your handler |
| [Ordering](#ordering) | Sort on `{time}`, and don't assume arrival order | Logs every event, so you can see what arrived when |
| [Retries](#retries) | Plan for three retries over minutes, and check the error log | Accepts callbacks while your service is down and replays them |
| [Choosing events](#choosing-events) | Use one path per callback type; add `{eventType}` to Event callbacks | Filters and routes on the path or the fields you template |
| [Other limits](#other-limits) | Keep Bidir direct, use a CA-issued certificate, split batches | Checks the secret header on every request |

## Sigfox webhook timeouts and slow handlers {#timeouts}

Your server has 10 seconds to return a status code. Store the request, return a `2xx`, and do the rest in a background job.

**Why it happens:** Sigfox treats a reply after 10 seconds as a timeout and applies its retry policy, even if your handler went on to finish. Sigfox recommends managing received data asynchronously because of this limit.

**Fix it in your handler:**

1. Check the secret header, store the raw request and return a `2xx`.
2. Decode the payload, write to your time-series store and trigger alerts in a worker. See [why to process webhooks asynchronously](/webhooks/guides/why-implement-asynchronous-processing-webhooks).
3. Treat Bidir callbacks separately, because they need an answer in the response. See [Other limits](#other-limits).

**With Event Gateway:** Hookdeck accepts each one-way callback as it arrives, then queues it and delivers it to your service with its own retries. Your handler's speed no longer affects Sigfox's 10 second limit.

## Duplicate Sigfox webhooks {#duplicates}

The same message can reach you more than once, and Sigfox recommends deduplicating. Key on `{device}`, `{seqNumber}` and `{time}`.

**Why it happens:** A reply that arrives after the 10 second limit still triggers a retry. Batch callbacks with the duplicate option, which needs the Network Metadata contract option, can also put duplicates of one message in different batches. `{seqNumber}` isn't unique by itself: it restarts after a full cycle of 4096 messages, and restarts at 0 if the device's firmware is re-flashed.

**Fix it in your handler:**

1. Template `{device}`, `{seqNumber}` and `{time}` into every data callback, then store that key before you process the message. See our [guide to webhook idempotency](/webhooks/guides/implement-webhook-idempotency).
2. Keep Uplink and Data Advanced callbacks apart, because both describe the same device message.
3. Deduplicate across batches as well as within one request.
4. Return a `2xx` for a repeat, so a duplicate doesn't look like a failure.

**With Event Gateway:** [Deduplication](/docs/deduplication) can compare the fields you choose, such as `device`, `seqNumber` and `time`, and drop repeats within a time window before they reach your handler.

## Out-of-order Sigfox webhooks {#ordering}

Sigfox's docs don't promise an order, and a retry can arrive minutes after newer messages. Sort on `{time}` rather than arrival.

**Why it happens:** A failed callback waits at least a minute for its first retry, while later messages are still sent as they arrive. Data Advanced callbacks also arrive about 30 seconds after the message, so an Uplink and a Data Advanced callback for one message reach you at different times.

**Fix it in your handler:**

1. Store `{time}` with each reading, and treat the newest time as current.
2. Don't compare `{seqNumber}` values to decide which message is newer, because the number cycles.

**With Event Gateway:** Hookdeck logs every event and attempt, so you can see the order things arrived in when you're debugging.

## Sigfox webhook retries {#retries}

Sigfox sends three retries, 1, 2 and 4 minutes after the timeout or error code. Its docs describe nothing after the third, so assume a longer outage loses messages.

**Why it happens:** The retry window is measured in minutes, and the docs don't say which status codes count as errors. When callbacks fail, the evidence is in the error column on the device type's Callbacks page, where HTTP status codes and Sigfox's own `6xx` codes appear. The `6xx` codes come with a text description, and Sigfox refers you to your Sigfox Distributor Service Desk for more.

**Fix it in your handler:**

1. Return a `2xx` for anything you've stored, and keep the endpoint highly available.
2. Check the callback error log after any incident, and compare against the device's messages in the Backend.
3. Alert when a device type's message rate drops, since a broken callback looks the same as a fleet that has stopped transmitting.

**With Event Gateway:** Hookdeck accepts callbacks while your service is down, retries delivery on a schedule you control, and lets you replay any message once a fix is deployed.

## Choosing Sigfox callback types and events {#choosing-events}

Pick the callback type for the data you need, and put what you need to route on into its template. The request names a type only if you make it.

**Why it happens:** Data, Service and Error callbacks have no event name at all. Event callbacks offer an `{eventType}` variable with values such as `OFF_CONTRACT` and `TOKEN_RENEWAL`, listed on [Sigfox webhook events](/webhooks/sigfox/events), but Sigfox only sends the variables you template.

Two event types aren't in that list, because the docs don't settle their values. Out of message sequence has a page that shows two different values, and Receive first repeated message has no page. Log `{eventType}` to see what yours send. An Out of message sequence error matters: Sigfox says it discards the device's incoming messages until it receives an acceptable sequence number.

**Fix it in your handler:**

1. Give each callback its own path, such as `/sigfox/uplink` and `/sigfox/error`, or add a constant field to the template.
2. Add `{eventType}` to every Event callback template, and ignore values you don't recognise.
3. Use Data Advanced for link quality, duplicates and computed location, and allow for its delay of about 30 seconds.
4. Move away from Service Status callbacks. Sigfox disables new ones from September 2026 and ends the service in April 2027.

**With Event Gateway:** Filters and routing rules can send each path or template field to a different destination. See [transformations](/docs/transformations) if you need to reshape a body first.

## Other Sigfox webhook limits {#other-limits}

Bidir callbacks, certificates, batches and forbidden headers each catch people out.

**Why it happens:** A Data > Bidir callback expects your HTTP response to carry the downlink, as JSON keyed by device ID, for example `{"1234": {"downlinkData": "1234567890123456"}}`, or a `204` or `noData` for no answer. A proxy that answers on your behalf replaces that response with its own. Sigfox doesn't trust self-signed certificates, so a server presenting one never receives callbacks. Batch callbacks are `POST` only, with `batch={batch}` required in the URL, and one request can hold many messages. With a form-encoded `POST`, variables in the URL's query string are also appended to the body. All standard headers are forbidden except `Authorization`.

**Fix it in your handler:**

1. Point Bidir callbacks directly at the server that computes the downlink, and answer quickly.
2. Use a certificate from a Certificate Authority.
3. Split the `batch` field on newlines and handle each line as a message.
4. If you allowlist source IPs, use the range Sigfox publishes, `185.110.96.0/22`, and watch the Sigfox Backend release notes for changes. Keep checking the secret header as well.
5. Write JSON templates with care: Sigfox rejects a template that isn't valid JSON, so quote string variables and leave numbers such as `{seqNumber}` bare.

**With Event Gateway:** Hookdeck answers each request itself and delivers it to your service asynchronously, so use it for one-way callbacks such as Uplink, Data Advanced, Error and Event, and leave Bidir callbacks on a direct URL. Its Sigfox source type checks the secret header you name. It pre-selects `POST`, so allow `GET` or `PUT` on the source if your callback uses them.