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

# Webhooks

> TypeScript SDK reference for the Webhooks resource

## createWebhook

`POST /v1/webhooks` — Create Webhook

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.createWebhook({
  body: {
    url: 'https://your-app.example.com/anchor/webhooks',
    subscribed_events: ['task.completed']
  }
});
console.log(result);
```

## listWebhooks

`GET /v1/webhooks` — List Webhooks

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.listWebhooks();
console.log(result);
```

## getWebhook

`GET /v1/webhooks/{id}` — Get Webhook

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.getWebhook({
  path: {
    id: 'your-id'
  }
});
console.log(result);
```

## updateWebhook

`PATCH /v1/webhooks/{id}` — Update Webhook

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.updateWebhook({
  path: {
    id: 'your-id'
  },
  body: {}
});
console.log(result);
```

## deleteWebhook

`DELETE /v1/webhooks/{id}` — Delete Webhook

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.deleteWebhook({
  path: {
    id: 'your-id'
  }
});
console.log(result);
```

## rotateWebhookSecret

`POST /v1/webhooks/{id}/rotate-secret` — Rotate Webhook Signing Secret

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.rotateWebhookSecret({
  path: {
    id: 'your-id'
  }
});
console.log(result);
```

## sendWebhookTestEvent

`POST /v1/webhooks/{id}/test` — Send Test Event

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.sendWebhookTestEvent({
  path: {
    id: 'your-id'
  },
  body: {
    event_type: 'task.completed'
  }
});
console.log(result);
```

## listWebhookEvents

`GET /v1/webhooks/{id}/events` — List Webhook Deliveries

```typescript theme={null}
import { client, Webhooks } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Webhooks.listWebhookEvents({
  path: {
    id: 'your-id'
  }
});
console.log(result);
```
