> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paddockai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connector webhook

> POST https://webhook.paddock.build/{id}: the endpoint other services post events to, and how it answers.

```http theme={null}
POST https://webhook.paddock.build/{id}
```

The URL of a [connector](https://docs.paddockai.dev/guides/connectors.md)'s inbound side, as `connector.inbound.url` returns it. Any service posts events to it. It takes no API key: the URL is unguessable, and the connector's [inbound function](https://docs.paddockai.dev/guides/connector-functions.md#inbound-contract) checks whatever a request must prove, such as a signature with the connector's secrets.

| Part | Rule |
| - | - |
| Method | `POST` only |
| `{id}` | The connector's ID, `con_...` |
| Body | At most 1 MiB, in any format the function reads; the `Content-Type` is not checked |
| Headers and query | Given to the function as received, header names in lowercase |
| CORS | None; the endpoint is for servers |

## Answers

paddock answers in this order and records a delivery for every request to an existing inbound side. A `2xx` answer means the delivery is stored; its routes are delivered after it. The function runs before deduplication, so it runs on a duplicate too.

| Step | When | Answer | Recorded |
| - | - | - | - |
| 1. Find the connector | Unknown, deleted, or without an inbound side | `404 not_found` | Nothing |
| 2. Read the body | Over 1 MiB | `413 payload_too_large`, `details.reason: "invalid_body"` | A rejected delivery, without the body |
| 3. Run the function | The side has none | `503 unavailable`, `details.reason: "no_function"` | A rejected delivery |
| | It rejects the request | `401 unauthorized`, `details.reason: "function_rejected"`, its reason as the message | A rejected delivery |
| | It throws, answers outside the contract, or cannot be invoked | `503 unavailable`, `details.reason: "function_error"` | A rejected delivery; the sender retries |
| | It does not answer in time | `503 unavailable`, `details.reason: "function_timeout"` | A rejected delivery; the sender retries |
| | It answers with `respond` | Its status, headers, and body | A `handshake` delivery with the answer; no route |
| 4. Deduplicate | The dedupe key of a recorded delivery | `200` with `{ "deliveryId", "duplicate": true }`, naming the first delivery | Nothing new |
| 5. Store the delivery and its routes | Storage briefly unavailable | `503 unavailable` | Nothing; the sender may retry |
| 6. Accept | Otherwise | `202` with `{ "deliveryId" }` | A delivery, `pending`, or `done` when there is no route |

A rejected request's error body names the delivery recorded for it in `details.deliveryId`, so you can find it in the connector's deliveries.

```json 202 Accepted theme={null}
{ "deliveryId": "dlv_01h455vb4pex5vsknk084sn02q" }
```

```json 200 OK (duplicate) theme={null}
{ "deliveryId": "dlv_01h455vb4pex5vsknk084sn02q", "duplicate": true }
```

```json 401 Unauthorized theme={null}
{
  "error": {
    "code": "unauthorized",
    "message": "x-hub-signature-256 does not match",
    "details": { "reason": "function_rejected", "deliveryId": "dlv_01h455vb4pex5vsknk084sn03r" }
  }
}
```

The answer never says what the routes or the agents will do: those are the delivery's outcomes, which you read with `connector.deliveries.get(deliveryId)` or in the console.

## Try it

Against a connector whose function is the `github` preset, sign the exact bytes you send with its `default` secret:

```bash theme={null}
body='{"zen":"Keep it logically awesome."}'
signature="sha256=$(printf '%s' "$body" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')"
curl -X POST "$CONNECTOR_URL" \
  -H "Content-Type: application/json" \
  -H "X-GitHub-Event: ping" \
  -H "X-Hub-Signature-256: $signature" \
  -d "$body"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.