Resend webhook events

Resending webhooks

In some cases you may need to re-trigger multiple webhook requests for your front end or an integration.

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 first query the content items you want to trigger. Check out the filter options for more details. You can merge all the criteria in the same request, so only the content items that match your criteria, trigger the webhook request 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. Possible values are: content_item.created
content_item.changed content_item.published content_item.unpublished content_item.deleted
webhook_idObjectfalseDefines which webhooks should be triggered.
skipIntfalseYou can specify an offset with the skip query parameter.0
limitIntfalseYou can specify the maximum number of items as a limit query parameter. The highest limit you can set is 1000.25

Resending one webhook

The example below resends webhook events for all the content items with the tag 1fb70a05-7cab-4f7e-bae7-bbf7f69fd091 or f9b73994-76bf-49a0-87f8-505252e21086 to a webhook with the ID 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"
            ]
        }
    ]
}

Resending multiple webhooks

The example below resends 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 IDs 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

When you trigger multiple webhook requests with the bulk endpoint, they end up in a queue, and the number of requests can increase rapidly depending on the number of webhooks and the number of content items that meet your criteria.

Example calculation:

  • 3 webhooks listening to the event content_item.published
  • 1,000 content items meet the filter criteria.

Results in (3 webhooks x 1,000 content items) = 3,000 webhook events triggered. So, please be patient. ❤️

Recuse delay:
We advise you to always use the webhook_id parameter like in the examples above.


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