Setup Webhooks

Webhooks can be used to notify your own application of deployment status changes.

Screenshot of Webhooks Menu

Complete the following steps to setup a webhook:

  1. Open an existing project on Railway.
  2. Click on the project settings menu.
  3. Navigate to the webhooks page.
  4. Input your desired webhook URL into the input under "Build and Deploy Webhooks".
  5. Click the checkmark to the right of the input to save.

The URL you provide will receive a webhook payload when the current project's deployment status changes. This will be executed across all environments in the project.

To see what payload will be transmitted to the URL, you can expand the "Example webhook payload" panel.

Muxers

Webhooks contain Muxers which will automatically identify webhook URLs and transform the payload based on where it's going. Below are the currently supported Muxers:

  • Discord
  • Slack

Setting up a webhook for Discord

Discord supports integrating directly with webhooks. To enable this on a server you will need to be an admin or otherwise have the appropriate permissions.

  1. On Discord, open the settings for a server text channel. This menu can be accessed via the cogwheel/gear icon where the channel is listed on the server.
  2. Click on the integrations tab.
  3. Click on the webhooks option.
  4. You will see an option to create a new webhook, click this button and fill out your preferred bot name and channel.
  5. Once created, you will have the option to copy the new webhook URL. Copy that URL.
  6. Back in Railway, open the project you wish to integrate with.
  7. Click on the project's deployments menu.
  8. Navigate to the settings tab.
  9. Input the copied webhook URL into the input under "Build and Deploy Webhooks".
  10. Click the checkmark to the right of the input to save.

At this point, the Discord Muxer will identify the URL and change the payload to accommodate the Discord integration. You can see this if you expand the payload preview panel.

You are now done! When your project deploys again, that Discord channel will get updates on the deployment!

Setting up a webhook for Slack

Slack supports integrating directly with webhooks.

  1. Enable incoming webhooks for your Slack instance (Tutorial here)
  2. Get a hooks.slack.com address for your channel (Tutorial here)
  3. Open up Railway, navigate to your project. Under Deployments -> Settings -> Webhooks, paste your URL
  4. Click the checkmark to save

Edit this file on GitHub