Webhooks

Webhook payloads

The payload sent with your webhook will vary depending on the configuration of your webhook. If the webhook is configured to include payload, a snapshot of the entry from the associated stage the action will be sent.

Below are example payloads for each available webhook action.

Create

The create action is triggered whenever a new content entry is created.

The create action is only available on the draft stage.

Example webhook payload

The payload may differ depending on your webhook configuration.

{
"operation": "create",
"data": {
"__typename": "Post",
"author": null,
"content": "since introducing Granular Webhooks in our new system, we have seen a major increase in messages being served daily. In order to upkeep with the steady increase, we have been working on several improvements under the hood.\n\nThese performance and reliability enhancements also involve a change to the payload of each webhook that is being sent.\nWebhook Payloads are now served with a new flat message structure and also includes reference fields (ID and typename). Additionally, it also includes the localizations of that model.",
"createdAt": "2020-09-24T12:00:03.222506+00:00",
"description": "This is a description",
"id": "ckfgrkybc0p900109k03cu858",
"image": {
"__typename": "Asset",
"id": "ckf5em5hc02100157x5n00lwb"
},
"localizations": [
{
"locale": "en",
"title": "GraphCMS Webhook Payload Changes"
}
],
"publishedAt": null,
"stage": "DRAFT",
"updatedAt": "2020-09-24T12:00:03.222506+00:00"
}
}

Update

The update action is triggered whenever an existing content entry is updated.

The update action is only available on the draft stage.

Connecting and disconnecting entries via a reference field will also trigger an update webhook for the related model.

Example webhook payload

The payload may differ depending on your webhook configuration.

{
"operation": "update",
"data": {
"__typename": "Post",
"author": null,
"content": "since introducing Granular Webhooks in our new system, we have seen a major increase in messages being served daily. In order to upkeep with the steady increase, we have been working on several improvements under the hood.\n\nThese performance and reliability enhancements also involve a change to the payload of each webhook that is being sent.\nWebhook Payloads are now served with a new flat message structure and also includes reference fields (ID and typename). Additionally, it also includes the localizations of that model.",
"createdAt": "2020-09-24T12:00:03.222506+00:00",
"description": "This is a description",
"id": "ckfgrkybc0p900109k03cu858",
"image": {
"__typename": "Asset",
"id": "ckf5em5hc02100157x5n00lwb"
},
"localizations": [
{
"locale": "en",
"title": "Webhook Payload Changes"
}
],
"publishedAt": null,
"stage": "DRAFT",
"updatedAt": "2020-09-24T12:02:42.352668+00:00"
}
}

Delete

The delete action is triggered whenever a new content entry is created.

The delete action is only available on the draft stage.

Example webhook payload

The payload may differ depending on your webhook configuration.

{
"operation": "delete",
"data": {
"__typename": "Post",
"author": null,
"content": "since introducing Granular Webhooks in our new system, we have seen a major increase in messages being served daily. In order to upkeep with the steady increase, we have been working on several improvements under the hood.\n\nThese performance and reliability enhancements also involve a change to the payload of each webhook that is being sent.\nWebhook Payloads are now served with a new flat message structure and also includes reference fields (ID and typename). Additionally, it also includes the localizations of that model.",
"createdAt": "2020-09-24T12:00:03.222506+00:00",
"description": "This is a description",
"id": "ckfgrkybc0p900109k03cu858",
"image": {
"__typename": "Asset",
"id": "ckf5em5hc02100157x5n00lwb"
},
"localizations": [
{
"locale": "en",
"title": "Webhook Payload Changes"
}
],
"publishedAt": null,
"stage": "DRAFT",
"updatedAt": "2020-09-24T12:02:42.352668+00:00"
}
}

Publish

The publish action is triggered whenever a new content entry or an update to an existing content entry is published.

The publish action is only available on the published stage.

Example webhook payload

The payload may differ depending on your webhook configuration.

{
"operation": "publish",
"data": {
"__typename": "Post",
"author": null,
"content": "since introducing Granular Webhooks in our new system, we have seen a major increase in messages being served daily. In order to upkeep with the steady increase, we have been working on several improvements under the hood.\n\nThese performance and reliability enhancements also involve a change to the payload of each webhook that is being sent.\nWebhook Payloads are now served with a new flat message structure and also includes reference fields (ID and typename). Additionally, it also includes the localizations of that model.",
"createdAt": "2020-09-24T12:00:03.222506+00:00",
"description": "This is a description",
"id": "ckfgrkybc0p900109k03cu858",
"image": {
"__typename": "Asset",
"id": "ckf5em5hc02100157x5n00lwb"
},
"localizations": [
{
"locale": "en",
"title": "Webhook Payload Changes"
}
],
"publishedAt": "2020-09-24T12:03:25.54949+00:00",
"stage": "PUBLISHED",
"updatedAt": "2020-09-24T12:02:42.352668+00:00"
}
}

Unpublish

The unpublish action is triggered whenever an existing content entry is unpublished.

The unpublish action is only available on the published stage.

Example webhook payload

The payload may differ depending on your webhook configuration.

{
"operation": "unpublish",
"data": {
"__typename": "Post",
"author": null,
"content": "since introducing Granular Webhooks in our new system, we have seen a major increase in messages being served daily. In order to upkeep with the steady increase, we have been working on several improvements under the hood.\n\nThese performance and reliability enhancements also involve a change to the payload of each webhook that is being sent.\nWebhook Payloads are now served with a new flat message structure and also includes reference fields (ID and typename). Additionally, it also includes the localizations of that model.",
"createdAt": "2020-09-24T12:00:03.222506+00:00",
"description": "This is a description",
"id": "ckfgrkybc0p900109k03cu858",
"image": {
"__typename": "Asset",
"id": "ckf5em5hc02100157x5n00lwb"
},
"localizations": [
{
"locale": "en",
"title": "Webhook Payload Changes"
}
],
"publishedAt": "2020-09-24T12:03:25.54949+00:00",
"stage": "PUBLISHED",
"updatedAt": "2020-09-24T12:02:42.352668+00:00"
}
}

Were you expecting something more?

We are constantly contributing to our documentation, but if you spot something we're missing, let us know and we'll be sure to add it.

This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy