Heroku Webhooks: Powering New Integrations and Real-time Notifications

We're happy to announce that Heroku app webhooks is now generally available for all Heroku customers.

App webhooks provide notifications when your Heroku app changes, including modifications to domain settings, releases, add-ons, and dyno formations. These notifications can empower your internal communications, dashboards, bots or anything else that can receive HTTP POST requests. Integrating with Heroku webhooks provides easy support for driving custom workflows and 3rd party tools.

Creating webhooks

With the webhooks CLI plugin, you can subscribe to events with a single command.

heroku plugins:install heroku-webhooks        
heroku webhooks:add -i api:release -l notify -u https://example.com/hooks -a your-app  

In this example, after a new release is created for your-app, Heroku sends a POST request to your server endpoint with the details of the event. The example below shows the first section of a typical POST request:

webhooks_blog2

Receiving webhooks

Webhooks are delivered by POST requests to a designated, publicly accessible URL. By specifying the sync notification level when setting up webhooks, Heroku will automatically retry delivery of failed webhook events.

When to Use webhooks

Integrating with webhooks simplifies reacting to changes from your Heroku apps. Instead of repeatedly polling the Platform API and comparing the responses to identify changes, a webhook will automatically be delivered when a change has occurred.

Webhooks can power many real-time use cases, from internal dashboards that aggregate events from your Heroku applications to customized email notifications for specific members of your team. Chat notifications are a great example of how webhooks can be used to keep your team informed. While Heroku ChatOps provides a ready-built solution for pipeline events in Slack, you can also use webhooks to build custom notifications.

Easy to Setup

The app webhooks tutorial allows you to deploy a “webhook viewer” application in just a few clicks. The application walks you through creating a webhook and allows you to check the webhook contents before integrating webhook reception into your own application. The application also enables easier debugging as you’re able to easily view all the HTTP request data.

After completing the tutorial, learn about all the supported event types and the webhooks API in the full webhooks documentation.

Feedback

We plan to support more event types in the future and welcome your suggestions. If you have feedback you can reach us at ecosystem-feedback@heroku.com.

Browse the archives for news or all blogs Subscribe to the RSS feed for news or all blogs.