Rooftop can send a webhook to your application, letting it know when something has changed. We trigger on update and save events for every content type, as well as taxonomies and media entries.
## Adding a webhook endpoint
Your webhook endpoint is a URL which can accept a POST request from the Rooftop server. You can add as many endpoints as you need - an HTTP request will be sent to each.
Rooftop sends a multipart form request with the following fields:
id: the ID of the entity
blog_id: your blog ID on Rooftop
sub_domain: your subdomain on Rooftop
type: the content type which is being updated
status: the new status of the content
Sending JSON in webhooks is planned
There's an open issue to add an option to POST a JSON blob instead of multipart form data.
## Give it a try
If you make a POST request to the demo website API, you'll be able to see the webhook being sent to https://requestb.in/1f76wn61?inspect
curl -X POST --header "api-token:ab27bfd005ad2a8314f6cad4401ec5ca" https://docs.demo.rooftopcms.io/wp-json/wp/v2/pages/100
Updated over 3 years ago