> For the complete documentation index, see [llms.txt](https://docs.scaleconnect.com.au/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleconnect.com.au/api/webhooks/delivery.md).

# Delivery

{% @scale-docs-page-title/page-title title="Delivery" %}

{% hint style="warning" %}
**Confirm before publishing:** exact signature encoding and version, timestamp/replay defence, raw-body verification fixture, timeout and redirect policy, retry schedule, secret storage, replay window and delivery retention. The HMAC and timing values below are the proposed outbound contract; no deployed partner dispatcher has been verified.
{% endhint %}

A webhook delivery is an HTTPS `POST` to your registered endpoint. It contains one JSON [event envelope](/api/webhooks.md). Treat the body as untrusted until its signature is verified.

## Headers

| Header                     | Use                                   |
| -------------------------- | ------------------------------------- |
| `X-ScaleConnect-Event`     | Event type                            |
| `X-ScaleConnect-Signature` | HMAC-SHA256 signature of the raw body |
| `X-ScaleConnect-Delivery`  | Identifier for this delivery attempt  |
| `X-ScaleConnect-Attempt`   | Attempt number                        |

Verification must use the **exact bytes received**, before JSON parsing or reserialization. Compute an HMAC with the subscription signing secret and compare it to the supplied signature in constant time. The precise prefix, timestamp and digest encoding must be fixed in a test vector before publishing executable verification code.

## Acknowledge and process

1. Verify the signature and reject a failed check.
2. Parse the JSON and validate the event type.
3. Insert the envelope `id` into your processed-event store with a uniqueness constraint.
4. If it already exists, return 2xx without repeating side effects.
5. Queue your business work and return 2xx quickly.

The envelope `id` is stable across attempts and replay. The delivery header is not: do **not** deduplicate on the delivery ID. There is no guaranteed event ordering. Fetch the resource if your decision requires its current state.

## Retry and recovery

The proposed policy is a 10-second timeout and at most three attempts with delays of 30 seconds, two minutes and 15 minutes. A non-2xx response or timeout is retryable. After failure, inspect the subscription's delivery history and request replay of the **stored original body**. Rotating a signing secret should allow a 24-hour overlap while receivers update.

See [Subscriptions](/api/webhooks/subscriptions.md) for registration, delivery history and replay routes. Design receivers to tolerate duplicates even when normal deliveries succeed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.scaleconnect.com.au/api/webhooks/delivery.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
