Developer
Webhooks
11 min
webhooks enable notifications about content publishing events configure webhooks as custom properties on publications to receive http callbacks when content is published or updated quick start here is a minimal configuration to get started { "processonce" false, "filter" { "type" "post", "properties" \[] }, "notification" { "url" "https //your endpoint com/webhook", "method" "post", "parameters" { "id" "{{id}}", "preview" "{{preview}}" } } } this configuration will send a webhook notification to your endpoint whenever post content in the publication is published or updated when webhooks trigger webhooks are triggered in the following scenarios when content is published for the first time when already published content is saved/updated (unless processonce is set to true ) when content is republished when the publication date is reached for scheduled content (if sendpublicationdatereachednotifications is enabled, release mode only) webhooks are not triggered when content status changes (e g , from draft to review) content is created but not published content is deleted webhook configuration settings are applied as custom properties on the publication using the key webhook config example configuration { "processonce" true, "sendpublicationdatereachednotifications" false, "filter" { "type" "post", "properties" \[ { "key" "print transfer", "value" "true" } ] }, "notification" { "url" "https //your endpoint com/webhook", "method" "post", "headers" { "x api key" "your api key" }, "parameters" { "id" "{{id}}", "preview" "{{preview}}", "publicationdate" "{{publicationdate}}", "scheduled" "{{scheduled}}" } } } property type required default description processonce boolean no true if set to true , the webhook will only be triggered on the first publish event subsequent updates to already published content will not trigger the webhook sendpublicationdatereachednotifications boolean no false if set to true , webhooks will be triggered when the publication date is reached for scheduled content this notification is only sent for release mode, not preview mode filter contentfilter yes specifies which content should trigger the webhook notification notificationconfig yes specifies how the webhook notification should be sent contentfilter property type required description type string yes the type of content that should trigger the webhook possible values issue , post , bundle properties array no an array of custom property filters only content that has all specified properties with the specified values will trigger the webhook if the array is empty, all content of the specified type will trigger the webhook properties each property filter has the following structure property type description key string the property key value string the property value notificationconfig property type required description url string yes the url to send the webhook notification to method string yes the http method to use for the webhook request possible values get , post headers map\<string,string> no custom headers to include in the webhook request (e g , api keys, authorization headers) parameters map\<string,string> no parameters to include in the webhook request values can use template variables (see below) parameters & variables parameters support dynamic values using template variables variables are wrapped in double curly braces {{variablename}} the following variables are available variable description {{id}} the content id {{name}} the content name {{posttype}} the post type (only for post content) {{preview}} boolean indicating if this is preview mode ( true ) or release mode ( false ) {{externalid}} the external id {{publicationdate}} the publication date in iso 8601 utc format (e g , 2024 03 15t14 30 00z ) {{scheduled}} boolean indicating if the publication date is in the future ( true ) or not ( false ) this parameter is automatically excluded when preview=true {{property your property key}} the value of a custom property with the key your property key when using the get method, parameters are sent as query parameters in the url https //your endpoint com/webhook?id=123\&preview=false when using the post method, parameters are sent as json in the request body { "id" "123", "preview" "false" } testing before deploying to production, test your webhook configuration using services like https //webhook site , https //requestbin com , or https //hookbin com these services provide temporary urls that capture and display incoming webhook requests, allowing you to verify the payload and headers testing workflow create a temporary webhook url using a testing service configure your publication with the test webhook url publish or update content that matches your filter check the testing service to verify the webhook was received verify the parameters and headers are correct update configuration with your production endpoint troubleshooting if your webhook is not being triggered, check the following required fields ensure all required fields are present in the configuration ( filter , notification , url , method , type ) content type verify that the content type matches the filter configuration property filters if using property filters, ensure the content has all specified properties with the correct values json syntax validate your json configuration using a json validator trigger conditions ensure the content is being published (not just saved as draft) and that processonce is not preventing subsequent triggers limitations no retry when the webhook endpoint is temporarily unavailable (i e , due to a network error) webhook requests timeout after 20 seconds