Skip to main content
Looking to update your church website?
Try MyPortal.Church. It's designed to perfectly integrate with Planning Center and keeps your calendar events, groups, and profile automatically in sync with your website.

Webhook Subscriptions

To start using the Webhooks API, add the following to the top of your file:

use EncoreDigitalGroup\PlanningCenter\Objects\Webhooks\WebhookSubscription;

WebhookSubscription Class

Now we can create a new instance of the WebhookSubscription class;

$webhookSubscription = WebhookSubscription::make($clientId, $clientSecret);

All Webhook Subscriptions

To get all webhook subscriptions that exist in Planning Center, use the following method:

$webhookSubscription->all();

Get a Specific Webhook Subscription

To get a single webhook subscription from Planning Center, use the forWebhookSubscriptionId() method and then chain the get() method.

$webhookSubscription->forWebhookSubscriptionId(YOUR_WEBHOOK_SUBSCRIPTION_ID)->get();

Create a Webhook Subscription

To create a new webhook subscription, you must set the name and url.

$webhookSubscription->attributes->name = "events.v2.events.created";
$webhookSubscription->attributes->url = "https://example.com/webhooks";
$webhookSubscription->create();

You can also set the webhook subscription to be active or inactive upon creation:

$webhookSubscription->attributes->name = "events.v2.events.created";
$webhookSubscription->attributes->url = "https://example.com/webhooks";
$webhookSubscription->attributes->active = true;
$webhookSubscription->create();
The name field represents the event you want to subscribe to. Planning Center uses a naming convention of {app}.v2.{resource}.{action} for webhook event names.

Update a Webhook Subscription

To update an already existing webhook subscription, you will need the ID of the subscription you wish to update. Only the active attribute can be updated on an existing webhook subscription.

$webhookSubscription->attributes->active = false;
$webhookSubscription->forWebhookSubscriptionId("123")->update();
The name and url fields cannot be changed after a webhook subscription has been created.

Delete a Webhook Subscription

To delete a webhook subscription from Planning Center, you just need to pass in the ID.

$webhookSubscription->forWebhookSubscriptionId("123")->delete();

Rotate Authenticity Secret

Webhook subscriptions include an authenticity secret that is used to verify that incoming webhooks are actually from Planning Center. If you need to rotate this secret, use the following method:

$webhookSubscription->forWebhookSubscriptionId("123")->rotateSecret();
After rotating the secret, you will need to retrieve the webhook subscription again to get the new authenticity secret value.

Attributes

When retrieving webhook subscriptions, the following attributes are available:

AttributeTypeDescription
webhookSubscriptionIdstringThe unique identifier for the webhook subscription
activeboolWhether the webhook subscription is active
applicationIdstringThe ID of the application that owns this subscription
authenticitySecretstringThe secret used to verify webhook authenticity
createdAtCarbonWhen the webhook subscription was created
namestringThe event name this subscription listens for
updatedAtCarbonWhen the webhook subscription was last updated
urlstringThe URL where webhooks will be sent