Webhooks

A webhook is a user-defined HTTP callback. It is a mechanism that sends real-time information to any third-party app or service.

Webhooks allow you to specify a URL to which you would like Cockpit to post data when an event happens. So, for instance, if you wish to be notified every time a new collection entry is created, you can create a webhook for it. Webhooks can be created for almost all events in Cockpit.

Create a webhook

Create a webhook

Advanced options

Advanced Options

All data will be send as application/json.

Using POST-data in the webhook destination script

Some hooks send data along to the webhook destination script as hook is triggered (like some of the collection-event-hooks which send the fresh new collection's name and configuration).

The data is posted to the webhook destination script in RAW-Post format.

// PHP example to get the raw request body

$body = file_get_contents('php://input');

List of events

  • admin.dashboard.widgets
  • cockpit.filestorages.init
  • cockpit.bootstrap
  • cockpit.media.upload
  • cockpit.media.removefiles
  • cockpit.media.rename
  • cockpit.update.before
  • cockpit.update.after
  • cockpit.clearcache
  • cockpit.export
  • cockpit.import
  • cockpit.assets.list
  • cockpit.assets.save
  • cockpit.assets.remove
  • cockpit.rest.init
  • cockpit.rest.authenticate
  • cockpit.rest.erroronrequest
  • collections.createcollection
  • collections.updatecollection
  • collections.removecollection
  • collections.find.before
  • collections.find.after
  • collections.save.before
  • collections.save.after
  • collections.remove.before
  • collections.remove.after
  • forms.save.before
  • forms.save.after
  • singleton.save.after
  • singleton.remove
  • singleton.saveData.before
  • singleton.saveData.after
  • singleton.getData.after

Events triggered in backend views:

  • cockpit.account.editview
  • admin.dashboard.top
  • admin.dashboard.bottom
  • app.layout.header
  • cockpit.menu.aside
  • cockpit.menu.main
  • app.layout.contentbefore
  • app.layout.contentafter
  • app.layout.footer
  • cockpit.view.settings.item
  • cockpit.view.settings