---
title: "WebhookSubscription (Webhooks)"
description: "The WebhookSubscription resource in Planning Center Webhooks: how to reach it, its attributes, and what you can query and write."
---

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

# WebhookSubscription (Webhooks)

| Property | Value |
| --- | --- |
| Product | [Webhooks](/reference/webhooks/) (`pco.webhooks`, API version `2022-10-20`) |
| Resource type | `WebhookSubscription` |
| TypeScript | `Webhooks.WebhookSubscription`, attributes `Webhooks.WebhookSubscriptionAttributes`, schema `Webhooks.WebhookSubscriptionSchema` |
| Planning Center path | `/webhooks/v2/webhook_subscriptions` |
| Planning Center docs | [WebhookSubscription](https://api.planningcenteronline.com/docs/apps/webhooks/versions/2022-10-20/vertices/webhook_subscription) |

## How to reach it

| Client path | Returns | Filters | Create |
| --- | --- | --- | --- |
| `pco.webhooks.webhook_subscriptions` | Collection |  | Yes |

From a collection, `.id(webhookSubscriptionId)` addresses one WebhookSubscription: `pco.webhooks.webhook_subscriptions.id(webhookSubscriptionId)`. Collections support [`where`, `include`, `order`, and pagination](/guides/querying/); single resources have `get()`.

## Attributes

On `Webhooks.WebhookSubscriptionAttributes`. Every resource also has `id` and `type` (`'WebhookSubscription'`) next to its attributes.

| Name | Type | Description |
| --- | --- | --- |
| `active` | `boolean \| null` |  |
| `application_id` | `string \| null` |  |
| `authenticity_secret` | `string \| null` | See [details](#authenticity-secret). |
| `created_at` | `string \| null` |  |
| `name` | `string \| null` |  |
| `updated_at` | `string \| null` |  |
| `url` | `string \| null` |  |

### Attribute details

#### `authenticity_secret` {#authenticity-secret}

Every delivery will include a header `X-PCO-Webhooks-Authenticity`.

This header will be the `HMAC-SHA256` value of this the `authenticity_secret` used as the key,
and the message as the webhook body.

`hmac_sha256(authenticity_secret, webhook_body)`

## Querying

### Where

`where(field, value)` for equality; `where(field, op, value)` with the operators listed.

| Field | Value type | Operators |
| --- | --- | --- |
| `application_id` | `string` | Equality only |

No documented `order` fields.

## Edges

Follow these from one WebhookSubscription, `ref = pco.webhooks.webhook_subscriptions.id(webhookSubscriptionId)`:

| Edge | Leads to | Returns | Filters | Create |
| --- | --- | --- | --- | --- |
| `ref.events` | [Event](/reference/webhooks/event/) | Collection |  | No |

## Writing

| Property | Value |
| --- | --- |
| Create | Yes, `create()` on `pco.webhooks.webhook_subscriptions` |
| Update | Yes, `update()` on a reference |
| Delete | Yes, `delete()` on a reference |

### Create attributes

Typed as `Webhooks.WebhookSubscriptionSchema['create']`.

| Attribute | Type |
| --- | --- |
| `active` | `boolean \| null` |
| `name` | `string \| null` |
| `url` | `string \| null` |

### Update attributes

Typed as `Webhooks.WebhookSubscriptionSchema['update']`.

| Attribute | Type |
| --- | --- |
| `active` | `boolean \| null` |

See [Writing data](/guides/writing-data/).

## Actions

Run with `ref.action(name, body?)`. Bodies are untyped: see Planning Center's docs for each action.

| Action | Path | Description |
| --- | --- | --- |
| `rotate_secret` | `POST /webhooks/v2/webhook_subscriptions/{webhook_subscription_id}/rotate_secret` |  |

## Example

```ts
import type { Webhooks } from '@mackenly/planningcenterkit';

const page = await pco.webhooks.webhook_subscriptions.perPage(25).list();
const items: Webhooks.WebhookSubscription[] = page.data;
```

Source: https://planningcenterkit.mackenly.com/reference/webhooks/webhook-subscription/index.mdx
