Skip to content

WebhookSubscription (Webhooks)

The WebhookSubscription resource in Planning Center Webhooks: how to reach it, its attributes, and what you can query and write.

Property Value
Product 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

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; 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.
created_at string | null
name string | null
updated_at string | null
url string | null

Attribute details

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 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.

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

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

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

Type to search…

↑↓ navigate↵ selectEsc close