Setup Webhooks
Webhooks can be used to notify your own application of deployment status changes. They are configured per project.
Complete the following steps to setup a webhook:
- Open an existing Project on Railway.
- Click on the
Settings
button in the top right-hand corner. - Navigate to the Webhooks page.
- Input your desired webhook URL.
- Click
Save Webhook
.
The URL you provide will receive a webhook payload when any service's deployment status changes or an alert is triggered. 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.
- 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.
- Click on the integrations tab.
- Click on the webhooks option.
- You will see an option to create a new webhook, click this button and fill out your preferred bot name and channel.
- Once created, you will have the option to copy the new webhook URL. Copy that URL.
- Back in Railway, open the project you wish to integrate with.
- Click on the project's deployments menu.
- Navigate to the settings tab.
- Input the copied webhook URL into the input under "Build and Deploy Webhooks".
- 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.
Edit this file on GitHub