Resend webhook events

Resend webhooks

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

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 content items collection endpoint can be added to this request.

argumenttyperequireddescriptiondefault
eventStringtrueDefines the webhook event, content_item.created, content_item.changed, content_item.published, content_item.deleted.
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 webhook events for all the content items 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 webhook events for all the content items with one of the specified tags to two webhook endpoints.

{
    "event" : "content_item.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

The API response includes arrays of ID's for queued content items and webhooks. Additionally, it provides a count for queued webhooks events labeled as total_queued and a count for the number of filtered content items labeled as total_items. This supports straightforward pagination of content items when necessary.

{
  "queued": [
    {
      "content_item_id": "e52342340-85a4-443e-be05-69919e1ab9bc",
      "webhook_id": "0336be22-2b1e-a91a-a259-d805c38190d3"
    }
  ],
  "total_items": 233
  "total_queued": 1
}
⚠️

Delay

Remember that the triggered webhook events are in the queue, and that the number of webhook events can increase rapidly depending on 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 content_item.published
  • 1,000 content items that meet with the criteria.

Will result in (3 webhooks x 1,000 content items) = 3,000 webhook events triggered. Be patient ❤️

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



Webhook events filters:
Filters set on the webhook; like only triggering for some models will not apply when using this bulk endpoint. All content items selected will be delivered to the selected webhooks.

Was this article helpful?

We’d love to learn from your feedback