FAQ / Webhooks

On this page

What are the IP ranges for webhook calls?

The webhook system is hosted in AWS us-east-1 region and eu-west-1.

The IP ranges for AWS are provided in the following link:

http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html

For Premium customers with global organizations we guarantee sending webhooks exclusively from the following list of IPs:

markdown
18.214.214.181
23.22.58.212
35.175.4.28
50.16.105.152
54.91.243.203
54.147.156.145
44.196.27.223
100.24.203.24
54.80.73.183

For Premium customers with EU data residency we guarantee sending webhooks exclusively from the following list of IPs:

markdown
54.154.151.83
34.249.53.189
34.251.36.56
54.72.39.248
18.200.159.121
46.137.11.75
34.254.165.154
34.255.74.136
52.31.144.248

In case there are any changes to the list of IPs, they will be broadly and proactively communicated upfront through all available channels to all active registered users.

What are webhooks

The webhooks are used to notify you when content has been changed. Specify a URL, configure your webhook, and we will send an HTTP POST request whenever something happens to your content.

What type of event will trigger my webhook?

While creating your webhook, you will be asked to choose what type of events should trigger it. Events are separated by the type of entity (Content Type, Entry and Asset) and the underlying action (Create, Save, Autosave, etc). For example, you can create a webhook that will be triggered whenever an Entry is Unpublished.

For even more fine control have a look at webhook filters.

Is it possible to filter webhooks based on environment or entity IDs?

Yes, webhooks have a filter property which can be used to filter webhooks based on properties of the entity that triggered the webhook. It is possible to filter on:

  • entity ID e.g. sys.id

  • environment ID e.g. sys.environment.sys.id

  • content type ID e.g. sys.contentType.sys.id (for entries only)

For more information see: Webhook filters.

How do I configure a webhook?

Go to Settings → Webhooks from the navigation bar at the top. From there, hit Add webhook, and you will be directed to your new webhook.

Then choose a name, put in the information of your HTTP endpoint (URL and authentication), specify any custom headers and select the types of events that should trigger the webhook. You can also specify filters for more fine control.

Why has the URL of my webhook been rejected?

When creating a new webhook, the URL field will reject:

  • Private IPs (10.x, 192.x, etc.)

  • Localhost

  • Hostnames without a Top Level Domain

  • URLs that resolve to localhost or redirects

If I received a publish event, why do I get an old version in the CDA?

The delivery API is powered by a CDN network consisting of hundreds of servers distributed across continents. The CDN layer is purged when you publish an entry in a space. Purging is instantaneous and the fresh content propagtes within seconds. However, there is throttling logic that slows down cache purging if you publish a space programatically (e.g. every few seconds).

If you depend on fresh data in a webhook target which triggers for publish, its usually best to implement a small polling script to ensure the data you get from the CDN is fresh.

Following is a snippet to implement a polling script:

javascript
import { createClient } from 'contentful'

const pollContentful = async (space, accessToken, id, publishedVersion) => {
const client = createClient({ space, accessToken })

const resp = await client.getEntries({
  'sys.id': id
})

const element = resp.items[0]
const cdnVersion = element.sys.revision

if (publishedVersion > cdnVersion) {
  return await pollContentful(id, publishedVersion)
} else {
  return element
}}

export default pollContentful

add-circle arrow-right remove style-two-pin-marker subtract-circle remove