Resend webhook events

In some cases you may need to re-trigger webhooks, for your front end or other integration you made. This can be accomplished by triggering the following endpoint.

GET /content_items/bulk/webhooks

Info

Uses the same query options as GET /content_items

We advise you to query first your content items you like to trigger. By using all possible query options listed in the left sidebar.

You can merge all those criteria in the same request, so only the content items that matches your criteria, get a webhook trigger with your defined event.

Parameters

All filtering parameters from the Publications collection endpoint can be added to this request.

argumenttyperequireddescriptiondefault
eventStringtrueDefines the webhook event, content_item.created, content_item.changed, content_item.published.
webhook_idObjectfalseDefines the which webhooks should be triggered.
skipIntfalseYou can specify an offset with the skip query parameter.0
limitIntfalseYou can specify the maximum number of resources send as a limit query parameter. (max 1000)25

Sending events to one specified webhook

In this example we will resend events for all the publications with the tag 1fb70a05-7cab-4f7e-bae7-bbf7f69fd091 or f9b73994-76bf-49a0-87f8-505252e21086 to the webhook 312cae95-9343-43e8-bf4a-93898261acd7.

{
    "event" : "content_item.published",
    "webhook_id" : [
        {
            "eq": "312cae95-9343-43e8-bf4a-93898261acd7"
        }
    ],

    "limit" : 1000,
    "skip": 0,

    "tags" : [
        {
            "in" : [
                "1fb70a05-7cab-4f7e-bae7-bbf7f69fd091",
                "f9b73994-76bf-49a0-87f8-505252e21086"
            ]
        }
    ]
}

Sending events to multiple webhooks

In this example we will resend events for all the publications with one of the specified tags to two webhook endpoints.

{
    "event" : "publication.published",
    "webhook_id" : [
        {
            "in": [
                "312cae95-9343-43e8-bf4a-93898261acd7",
                "312cae95-9343-43e8-bf4a-93898261acd7",
            ]
        }
    ],

    "limit" : 1000,
    "skip": 0,

    "tags" : [
        {
            "in" : [
                "1fb70a05-7cab-4f7e-bae7-bbf7f69fd091",
                "f9b73994-76bf-49a0-87f8-505252e21086"
            ]
        }
    ]
}

Response

{
    "webhooks": {
        "0336be22-2b1e-a91a-a259-d805c38190d3": [
            "https://yourwebhookurlone.io/callback",
            "https://yourwebhookurltwo.io/callback",
            "https://yourwebhookurlthree.io/callback"
        ],
        "0336be22-2b1e-a91a-a259-d805c38190d3": [
          ...
        ]
    }
}

Warning

Delay

Remember that the trigger webhooks are in the queue, and that the number of webhooks can increase rapidly, due to the number of webhooks that have been set up, and the number of content items that meet your criteria.

Example calculation:

  • 3 webhooks that are listening to the event publication.published
  • 1,000 publications that meet with the criteria.

Will result in (3 webhooks x 1,000 publications) = 3,000 webhooks triggered. Be patient ❤️

Recuse delay:
We advise you to always use webhook_id parameter like described here below, instead of every webhook.