# GitHub's webhook deliveries for the Koidog App.

> Needs no session or key: GitHub signs each delivery with the App's webhook secret (`X-Hub-Signature-256`, checked against the raw body; `401 invalid_signature`).
> https://koi.dog/docs/api/github/receive-git-hub-webhook/

`POST /api/v1/github/webhook` · Key: `none`

Reads `installation`, `installation_repositories` and `repository` events for linked installations, once per `X-GitHub-Delivery` (a repeat answers `duplicate`). `409 not_configured` without a webhook secret. Bodies over 1 MB are refused (`413`).

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Response.

202 Accepted · JSON object. Follow progress on the timeline.

## Request.

```sh
curl -X POST https://api.koi.dog/api/v1/github/webhook \
    -H "Origin: https://app.koi.dog"
```

```js
const res = await fetch("https://api.koi.dog/api/v1/github/webhook", {
  method: "POST",
  headers: {
    Origin: "https://app.koi.dog",
  },
});
console.log(await res.json());
```

```python
import requests

r = requests.post(
    "https://api.koi.dog/api/v1/github/webhook",
    headers={
        "Origin": "https://app.koi.dog",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "outcome": "applied"
}
```
