> Call POST /v1/check before a tool that writes. DENY means do not invoke the tool. For clean Markdown of any page, append .md to the page URL. For the complete index, fetch https://docs.withwrit.com/llms.txt.

# GitHub App webhook receiver

POST https://api.withwrit.com/v1/github/webhooks

Receives GitHub App events. Verifies the `X-Hub-Signature-256` HMAC
signature, checks delivery deduplication, and acknowledges quickly.
The delivery is recorded only after handling succeeds: a handling
failure answers 500 and writes no record, so GitHub's redelivery is
processed instead of being swallowed as a duplicate. Scan jobs are
queued without GitHub API calls and run asynchronously; install-time
jobs resolve the default-branch HEAD in the worker. Subscribe to
`push`, `pull_request`, `installation`, `installation_repositories`,
and `marketplace_purchase` events.


Reference: https://docs.withwrit.com/api-reference/git-hub-app/git-hub-app-webhook-receiver

## Servers

- `https://api.withwrit.com` (Writ gate, default)
- `https://j72ckh66ukck2kcbq3oiwxaalm0olxwb.lambda-url.us-east-1.on.aws` (Direct Lambda Function URL (fallback))

## Response

### 202

Event received (or duplicate delivery).

## Errors

### 400 Bad Request Error

Invalid signature or non-JSON body.

- `any`

### 500 Internal Server Error

Handling failed; delivery not recorded so GitHub redelivers.

- `any`

### 503 Service Unavailable Error

GitHub App credentials not configured.

- `any`

## Examples

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.withwrit.com/v1/github/webhooks"

response = requests.post(url)

print(response.json())
```

```javascript
const url = 'https://api.withwrit.com/v1/github/webhooks';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withwrit.com/v1/github/webhooks"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.withwrit.com/v1/github/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withwrit.com/v1/github/webhooks")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withwrit.com/v1/github/webhooks');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.withwrit.com/v1/github/webhooks");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withwrit.com/v1/github/webhooks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```