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

# Webhooks

> API endpoints for managing webhooks.

# Webhooks Endpoints

Endpoints for creating and managing webhooks that notify your systems when data changes.

## List Webhooks

Retrieve all webhooks for a project.

```bash theme={null}
GET /api/v1/{project}/webhooks
```

<ParamField header="X-Api-Key" type="string" required>
  Your API key
</ParamField>

### Response

```json theme={null}
{
  "data": [
    {
      "id": "wh_123",
      "url": "https://example.com/webhook",
      "events": ["record.created", "record.updated"],
      "active": true
    }
  ]
}
```

## Create Webhook

Register a new webhook.

```bash theme={null}
POST /api/v1/{project}/webhooks
```

### Request Body

```json theme={null}
{
  "url": "https://example.com/webhook",
  "events": ["record.created", "record.updated", "record.deleted"]
}
```

## Webhook Events

| Event            | Description              |
| ---------------- | ------------------------ |
| `record.created` | A new record was created |
| `record.updated` | A record was updated     |
| `record.deleted` | A record was deleted     |

## Webhook Payload

```json theme={null}
{
  "event": "record.created",
  "project": "my-project",
  "cube": "blog-posts",
  "record": {
    "id": 1,
    "title": "New Post"
  },
  "timestamp": "2025-01-01T00:00:00Z"
}
```

## Delete Webhook

```bash theme={null}
DELETE /api/v1/{project}/webhooks/{webhook_id}
```
