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

# Webhooks

> Scripts API routes: webhooks.

| Method | Path | What it does |
| - | - | - |
| `GET` | `/scripts/{script_id}/webhooks` | Script event webhooks. |
| `POST` | `/scripts/{script_id}/webhooks` | Creates a webhook (max. 5). The signing key (whsec\_…) appears only in this response. Signature: X-DoglyTdc-Signature = sha256=HMAC\_SHA256(key, "X-DoglyTdc-Timestamp.body"). |
| `PATCH` | `/scripts/{script_id}/webhooks/{webhook_id}` | Changes the URL, events, or enabled/disabled state. |
| `DELETE` | `/scripts/{script_id}/webhooks/{webhook_id}` | Deletes the webhook. |
| `POST` | `/scripts/{script_id}/webhooks/{webhook_id}/test` | Sends a "ping" event now. |
| `GET` | `/scripts/{script_id}/webhooks/{webhook_id}/deliveries` | Latest 50 deliveries. |

## GET /scripts/\{script\_id}/webhooks

Script event webhooks.

**Authentication:** Scope: `scripts.read`

**Path parameters:** `script_id`

**Response:** `Webhook[]`

```bash cURL theme={null}
curl -X GET "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/webhooks" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```

## POST /scripts/\{script\_id}/webhooks

Creates a webhook (max. 5). The signing key (whsec\_…) appears only in this response. Signature: X-DoglyTdc-Signature = sha256=HMAC\_SHA256(key, "X-DoglyTdc-Timestamp.body").

**Authentication:** Scope: `scripts.write`

> [!NOTE]
>
> Up to 5 webhooks per script. The signing key `whsec_…` appears **only in this response**.

**Path parameters:** `script_id`

**Body:** `{ url (public https), events?: (repo.commit | functions.deploy | access.granted)[] }`

**Response:** `{ webhook, secret }`

```bash cURL theme={null}
curl -X POST "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/webhooks" \
  -H "Authorization: Bearer dts_SEU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://exemplo.com/hook","events":["repo.commit"]}'
```

## PATCH /scripts/\{script\_id}/webhooks/\{webhook\_id}

Changes the URL, events, or enabled/disabled state.

**Authentication:** Scope: `scripts.write`

**Path parameters:** `script_id`, `webhook_id`

**Body:** `{ url?, events?, active? }`

**Response:** `Webhook`

```bash cURL theme={null}
curl -X PATCH "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/webhooks/{webhook_id}" \
  -H "Authorization: Bearer dts_SEU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"active":false}'
```

## DELETE /scripts/\{script\_id}/webhooks/\{webhook\_id}

Deletes the webhook.

**Authentication:** Scope: `scripts.write`

**Path parameters:** `script_id`, `webhook_id`

**Response:** `204`

```bash cURL theme={null}
curl -X DELETE "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/webhooks/{webhook_id}" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```

## POST /scripts/\{script\_id}/webhooks/\{webhook\_id}/test

Sends a "ping" event now.

**Authentication:** Scope: `scripts.write`

**Path parameters:** `script_id`, `webhook_id`

**Response:** `Delivery`

```bash cURL theme={null}
curl -X POST "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/webhooks/{webhook_id}/test" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```

## GET /scripts/\{script\_id}/webhooks/\{webhook\_id}/deliveries

Latest 50 deliveries.

**Authentication:** Scope: `scripts.read`

**Path parameters:** `script_id`, `webhook_id`

**Response:** `Delivery[]`

```bash cURL theme={null}
curl -X GET "https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-scripts-api/scripts/{script_id}/webhooks/{webhook_id}/deliveries" \
  -H "Authorization: Bearer dts_SEU_TOKEN"
```


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