---
title: "createWebhookDelivery"
---

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

# createWebhookDelivery

Path: Forge API › webhookDeliveries

`POST /hooks/{repo_id}/{webhook_id}`

Where a provider sends a webhook's events, at the URL the repo's subscription gives it; a person or an agent never calls it. The extension's handler checks the request with the webhook's secret, then answers the provider itself or accepts the event as a delivery, which runs the webhook's tool on main.

## Path parameters

- `repo_id` (`createWebhookDelivery.path.repo_id`; string, required)
  - pattern: `^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `webhook_id` (`createWebhookDelivery.path.webhook_id`; string, required)
  - pattern: `^webhook_[0-7][0-9a-hjkmnp-tv-z]{25}$`

## Request body (application/json)

_Required._

Type: `string`

- format: `binary`

## Example request

```json
"string"
```

## Request body (application/x-www-form-urlencoded)

Type: `string`

- format: `binary`

### Example

```text
string
```

## Request body (text/plain)

Type: `string`

- format: `binary`

### Example

```text
string
```

## Request body (text/xml)

Type: `string`

- format: `binary`

### Example

```text
string
```

## Request body (application/octet-stream)

Type: `string`

- format: `binary`

### Example

```text
string
```

## Request body (application/xml)

Type: `string`

- format: `binary`

### Example

```text
string
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/hooks/<repo_id>/<webhook_id>' \
  --header 'Content-Type: application/json' \
  --data '"string"'
```

### TypeScript

```typescript
const url = '<base-url>/hooks/<repo_id>/<webhook_id>';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify('string')
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/hooks/<repo_id>/<webhook_id>"

payload = "string"
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 202

ExtensionWebhookDelivery

#### Example

```json
{
  "id": "string",
  "extension_name": "string",
  "webhook": "string",
  "dedupe_key": "string",
  "status": "queued",
  "received_at": "string",
  "started_at": "string",
  "finished_at": "string",
  "failure": "string"
}
```

- `id` (`createWebhookDelivery.response.202.id`; string, required)
  - pattern: `^extension_webhook_delivery_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `extension_name` (`createWebhookDelivery.response.202.extension_name`; string, required)
  - maxLength: `129` · pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$`
- `webhook` (`createWebhookDelivery.response.202.webhook`; string, required)
  - maxLength: `128` · pattern: `^[A-Za-z_][A-Za-z0-9_]*$`
- `dedupe_key` (`createWebhookDelivery.response.202.dedupe_key`; any of, required)
  - any of the following: `string`, `null`
- `status` (`createWebhookDelivery.response.202.status`; string, required)
  - one of `"queued"`, `"running"`, `"succeeded"`, `"failed"`, `"interrupted"`
- `received_at` (`createWebhookDelivery.response.202.received_at`; string, required)
- `started_at` (`createWebhookDelivery.response.202.started_at`; any of, required)
  - any of the following: `string`, `null`
- `finished_at` (`createWebhookDelivery.response.202.finished_at`; any of, required)
  - any of the following: `string`, `null`
- `failure` (`createWebhookDelivery.response.202.failure`; any of, required)
  - any of the following: `string`, `null`

### 400

InvalidRequest

#### Example

```json
{
  "_tag": "InvalidRequest",
  "part": "path",
  "issues": [
    {
      "path": [
        "string"
      ],
      "message": "string"
    }
  ]
}
```

- `_tag` (`createWebhookDelivery.response.400._tag`; string, required)
  - one of `"InvalidRequest"`
- `part` (`createWebhookDelivery.response.400.part`; string, required)
  - one of `"path"`, `"query"`, `"headers"`, `"body"`
- `issues` (`createWebhookDelivery.response.400.issues`; array of object, required)
  - `path` (`createWebhookDelivery.response.400.issues.path`; array\<any of\>, required)
    - any of the following: `string`, `integer`
  - `message` (`createWebhookDelivery.response.400.issues.message`; string, required)

### 402

ComputeLimitReached

#### Example

```json
{
  "_tag": "ComputeLimitReached",
  "plan": "free",
  "included_runs": -9007199254740991,
  "resets_at": "string"
}
```

- `_tag` (`createWebhookDelivery.response.402._tag`; string, required)
  - one of `"ComputeLimitReached"`
- `plan` (`createWebhookDelivery.response.402.plan`; string, required)
  - one of `"free"`, `"pro"`, `"team"`
- `included_runs` (`createWebhookDelivery.response.402.included_runs`; integer, required)
  - maximum: `9007199254740991` · minimum: `-9007199254740991`
- `resets_at` (`createWebhookDelivery.response.402.resets_at`; string, required)

### 403

Forbidden

#### Example

```json
{
  "_tag": "Forbidden",
  "message": "string"
}
```

- `_tag` (`createWebhookDelivery.response.403._tag`; string, required)
  - one of `"Forbidden"`
- `message` (`createWebhookDelivery.response.403.message`; string, required)

### 404

WebhookSubscriptionNotFound | ExtensionWebhookNotFound | RepoNotFound

#### Example

```json
{
  "_tag": "WebhookSubscriptionNotFound",
  "webhook_id": "string"
}
```

Any of the following:

- `WebhookSubscriptionNotFoundEncoded`
  - `_tag` (`WebhookSubscriptionNotFoundEncoded._tag`; string, required)
    - one of `"WebhookSubscriptionNotFound"`
  - `webhook_id` (`WebhookSubscriptionNotFoundEncoded.webhook_id`; string, required)
    - pattern: `^webhook_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `ExtensionWebhookNotFoundEncoded`
  - `_tag` (`ExtensionWebhookNotFoundEncoded._tag`; string, required)
    - one of `"ExtensionWebhookNotFound"`
  - `extension_name` (`ExtensionWebhookNotFoundEncoded.extension_name`; string, required)
    - minLength: `1`
  - `webhook` (`ExtensionWebhookNotFoundEncoded.webhook`; string, required)
    - minLength: `1`
- `RepoNotFoundEncoded`
  - `_tag` (`RepoNotFoundEncoded._tag`; string, required)
    - one of `"RepoNotFound"`

### 409

RepoArchived

#### Example

```json
{
  "_tag": "RepoArchived"
}
```

- `_tag` (`createWebhookDelivery.response.409._tag`; string, required)
  - one of `"RepoArchived"`

### 413

WriteTooLarge | RequestBodyTooLarge

#### Example

```json
{
  "_tag": "WriteTooLarge",
  "message": "string"
}
```

Any of the following:

- `WriteTooLargeEncoded`
  - `_tag` (`WriteTooLargeEncoded._tag`; string, required)
    - one of `"WriteTooLarge"`
  - `message` (`WriteTooLargeEncoded.message`; string, required)
- `RequestBodyTooLargeEncoded`
  - `_tag` (`RequestBodyTooLargeEncoded._tag`; string, required)
    - one of `"RequestBodyTooLarge"`
  - `max_bytes` (`RequestBodyTooLargeEncoded.max_bytes`; integer, required)
    - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 429

RateLimited

#### Example

```json
{
  "_tag": "RateLimited"
}
```

- `_tag` (`createWebhookDelivery.response.429._tag`; string, required)
  - one of `"RateLimited"`

### 500

ExtensionWebhookRequestHandlerFailed | RepoFailure | OrgFailure

#### Example

```json
{
  "_tag": "ExtensionWebhookRequestHandlerFailed",
  "extension_name": "string",
  "webhook": "string",
  "delivery_id": "string"
}
```

Any of the following:

- `ExtensionWebhookRequestHandlerFailedEncoded`
  - `_tag` (`ExtensionWebhookRequestHandlerFailedEncoded._tag`; string, required)
    - one of `"ExtensionWebhookRequestHandlerFailed"`
  - `extension_name` (`ExtensionWebhookRequestHandlerFailedEncoded.extension_name`; string, required)
    - minLength: `1`
  - `webhook` (`ExtensionWebhookRequestHandlerFailedEncoded.webhook`; string, required)
    - minLength: `1`
  - `delivery_id` (`ExtensionWebhookRequestHandlerFailedEncoded.delivery_id`; string, required)
    - pattern: `^extension_webhook_delivery_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `RepoFailureEncoded`
  - `_tag` (`RepoFailureEncoded._tag`; string, required)
    - one of `"RepoFailure"`
  - `reason` (`RepoFailureEncoded.reason`; string, required)
- `OrgFailureEncoded`
  - `_tag` (`OrgFailureEncoded._tag`; string, required)
    - one of `"OrgFailure"`
  - `reason` (`OrgFailureEncoded.reason`; string, required)

### 503

ExtensionWebhookUnavailable | RepoBusy | RateLimitUnavailable

#### Example

```json
{
  "_tag": "ExtensionWebhookUnavailable",
  "extension_name": "string",
  "webhook": "string"
}
```

Any of the following:

- `ExtensionWebhookUnavailableEncoded`
  - `_tag` (`ExtensionWebhookUnavailableEncoded._tag`; string, required)
    - one of `"ExtensionWebhookUnavailable"`
  - `extension_name` (`ExtensionWebhookUnavailableEncoded.extension_name`; string, required)
    - minLength: `1`
  - `webhook` (`ExtensionWebhookUnavailableEncoded.webhook`; string, required)
    - minLength: `1`
- `RepoBusyEncoded`
  - `_tag` (`RepoBusyEncoded._tag`; string, required)
    - one of `"RepoBusy"`
  - `message` (`RepoBusyEncoded.message`; string, required)
- `RateLimitUnavailableEncoded`
  - `_tag` (`RateLimitUnavailableEncoded._tag`; string, required)
    - one of `"RateLimitUnavailable"`


Source: https://buildrforge.com/docs/api/create-webhook-delivery/index.md
