# Webhooks

> Every webhook endpoint and delivery query and mutation.

Product: Clad API
Source: https://docs.useclad.ai/api/reference-webhooks

---

Subscribe to events, verify signed deliveries, and manage endpoints.

### Queries

#### `webhookDeliveries`

```graphql
webhookDeliveries(endpointId: ID!, first: Int): [WebhookDelivery!]
```

Recent deliveries for an endpoint, newest first (max 100).

| Argument | Type | Description |
| --- | --- | --- |
| `endpointId` | `ID!` | Required. |
| `first` | `Int` |  |

#### `webhookEndpoints`

```graphql
webhookEndpoints: [WebhookEndpoint!]
```

All webhook endpoints registered for the organization.

#### `webhookEventTypes`

```graphql
webhookEventTypes: [String!]
```

Every event type webhooks can subscribe to.

### Mutations

#### `createWebhookEndpoint`

```graphql
createWebhookEndpoint(input: CreateWebhookEndpointInput!): WebhookEndpointWithSecretResult
```

Register a webhook endpoint. Returns the signing secret exactly once.

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `CreateWebhookEndpointInput!` | Required. |

#### `deleteWebhookEndpoint`

```graphql
deleteWebhookEndpoint(id: ID!): DeleteWebhookEndpointResult
```

Delete a webhook endpoint (pending deliveries are dropped).

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `pingWebhookEndpoint`

```graphql
pingWebhookEndpoint(id: ID!): PingWebhookResult
```

Queue a signed webhook.ping delivery to test an endpoint end to end.

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `rotateWebhookSecret`

```graphql
rotateWebhookSecret(id: ID!): WebhookEndpointWithSecretResult
```

Rotate an endpoint's signing secret. The new secret is returned exactly once; the old one stops working immediately.

| Argument | Type | Description |
| --- | --- | --- |
| `id` | `ID!` | Required. |

#### `updateWebhookEndpoint`

```graphql
updateWebhookEndpoint(input: UpdateWebhookEndpointInput!): WebhookEndpointResult
```

Update a webhook endpoint's URL, description, event filter, or active flag.

| Argument | Type | Description |
| --- | --- | --- |
| `input` | `UpdateWebhookEndpointInput!` | Required. |
