Incoming Webhooks
Incoming webhooks allow you to trigger actions in Forge by sending HTTP requests to specific URLs. This enables you to integrate Forge with external services and automate your deployment workflow.
What are Incoming Webhooks?
Incoming webhooks are HTTP endpoints that accept requests from external services to trigger specific actions within Forge. They provide a simple way to integrate Forge with your existing tools and workflows.
You've likely encountered webhooks if you've used services like IFTTT, Zapier, or set up Slack integrations. They're a clean and easy way to trigger real-time responses to events and pass information between services.
Available Incoming Webhooks
Redeploy Webhook
The redeploy webhook allows you to trigger a new deployment of your site by sending an HTTP request. This is perfect for integrating with CI/CD systems, Slack commands, or any external service that can make HTTP requests.
How to Find Your Webhook URL
- Log into your Forge account at getforge.com
- Select one of your sites
- Click the Settings tab at the top of the page
- Scroll down to the WebHooks section
- Copy your unique webhook URL
Webhook URL Structure
Your webhook URL follows this pattern:
https://api.getforge.com/v2/webhook?type=redeploy&url={site_url}&site_token={site_token}
Base URL
https://api.getforge.com/v2/webhook
The consistent base URL for all webhooks
Type Parameter
type=redeploy
Specifies the webhook type and resulting action
Site URL
url={site_url}
The URL of the site you want to redeploy. Use your custom domain if you have one
Site Token
site_token={site_token}
Your unique site token for authentication. Keep this secure!
Using the Redeploy Webhook
Basic Usage
The simplest way to trigger a redeploy is to copy and paste the webhook URL into your browser and hit enter. The webhook works with both GET and POST requests.
Testing with Postman
- Copy your webhook URL from the Forge dashboard
- Paste it into Postman's request field
- Select either GET or POST method
- Click Send
- Check your Forge site's deployment timeline for the new version
Alternative: Account Token Format
For legacy compatibility, you can also use the account token format:
https://api.getforge.com/webhook?type=redeploy&url=your-site.getforge.io&token=YOUR_FORGE_ACCOUNT_TOKEN
Note: The account token has broader permissions and is not recommended for new implementations. Use the site token format for better security.
Slack Integration Example
One of the most popular use cases is integrating with Slack to trigger deployments via slash commands. Here's how to set it up:
1. Create Slack Slash Command
- Go to your Slack app settings
- Create a new slash command (e.g.,
/forge-deploy) - Set the request URL to your webhook URL
- Configure the command description and usage instructions
2. Make it Flexible
To deploy any of your sites, modify the webhook URL to accept the site URL as a parameter:
https://api.getforge.com/v2/webhook?type=redeploy&url={text}&site_token=YOUR_SITE_TOKEN
The {text} parameter will be replaced with whatever you type after the slash command.
3. Use the Command
In Slack, simply type:
/forge-deploy your-site.getforge.io
This will trigger a deployment of the specified site.
Security Considerations
Keep Your Token Secure
Your Forge site token is included in the webhook URL. Never share this URL publicly or commit it to version control.
Use HTTPS
Always use HTTPS when making webhook requests to ensure your token is transmitted securely.
Monitor Usage
Keep an eye on your deployment timeline to ensure webhooks are being triggered as expected.
Common Use Cases
CI/CD Integration
Trigger deployments automatically after successful builds in your CI/CD pipeline.
Slack Commands
Allow team members to trigger deployments via Slack slash commands.
GitHub Actions
Automate deployments when code is pushed to specific branches.
External Monitoring
Trigger deployments based on external events or monitoring alerts.
Response Format
When you successfully trigger a webhook, you'll receive a response indicating success. The exact response format may vary, but you should see a success message or status code 200.
Join the Discussion
Have questions or want to share your experience? Join our community discussion to connect with other developers and get help from the Forge team.
Visit Forum Discussion