Webhook Integration
Register the endpoint your own systems will listen on and choose the events it should receive.
Automatic delivery is not available yet
Today StatHarbour stores your webhook endpoints and sends a delivery only when you press Test on the Webhooks tab. Nothing is sent when a game is completed, a score changes, or a club or player is edited. The rest of this page describes the payloads and setup the feature is designed around, so you can prepare your endpoint, but do not rely on webhooks for live updates yet. For live data today, use the read API (Pro and Elite), the embeddable widgets, or the calendar feed.
What Are Webhooks?
Webhooks are designed to be automatic notifications that StatHarbour sends to your specified URL whenever important events happen in your league (automatic delivery is not built yet, see above). Think of them as instant alerts that keep your external systems in sync with your league data.
How It Works
- You provide StatHarbour with a URL (your webhook endpoint)
- You select which events you want to receive notifications for
- When those events happen, StatHarbour will send data to your URL (not built yet: today only the Test button sends a delivery)
- Your system receives the data and can take action automatically
Common Use Cases
๐ฑ Social Media
Automatically post game results to Twitter, Facebook, or Instagram when games finish.
๐ฌ Discord & Slack
Send score updates and standings changes to your team's Discord server or Slack workspace.
๐ Website Updates
Keep your league website in sync with live scores and standings without manual updates.
๐ Data Analytics
Send game data to your analytics platform for custom reporting and visualization.
๐ง Email Notifications
Trigger custom email notifications to team managers when games are scheduled or results are posted.
๐ Data Sync
Synchronize league data with your own database or content management system.
Available Events
Choose which events trigger webhook notifications:
game.completed
Triggered when a game finishes and final score is entered. Includes complete game details, final scores, and team information.
game.score_updated
Triggered whenever score changes during a live game. Perfect for real-time score displays.
standings.updated
Triggered when league standings change after game results are entered.
team.added
Triggered when a new team joins the league. Useful for onboarding workflows.
player.added
Triggered when a player is added to a team roster.
game.scheduled
Triggered when new games are added to the schedule.
Setting Up Webhooks
Navigate to Webhooks Settings
Go to your league dashboard, open Integration & API, then the Webhooks tab.
Add Your Webhook URL
Enter the URL where you want to receive notifications. This must be an HTTPS endpoint that can accept POST requests.
Select Events
Choose which events should trigger notifications. You can select multiple events for a single webhook.
Test the Webhook
Use the "Send Test" button to verify your endpoint receives data correctly before activating.
Activate
Toggle the webhook to "Active" to start receiving real notifications for your selected events.
Webhook Payload Format
All webhooks send data as JSON via HTTP POST requests. Here's the standard structure:
{
"event": "game.completed",
"timestamp": "2025-01-15T20:30:00Z",
"league_id": "abc123",
"league_name": "Premier Soccer League",
"data": {
"game_id": "game789",
"home_team": {
"id": "team1",
"name": "Red Dragons",
"score": 3
},
"away_team": {
"id": "team2",
"name": "Blue Tigers",
"score": 2
},
"status": "completed",
"played_at": "2025-01-15T19:00:00Z"
}
}
Common Fields
- event: The type of event that triggered the webhook
- timestamp: When the webhook was sent (ISO 8601 format)
- league_id: Unique identifier for your league
- league_name: Display name of your league
- data: Event-specific data (varies by event type)
Example Event Payloads
Game Completed Event
{
"event": "game.completed",
"data": {
"game_id": "abc123",
"home_team": { "name": "Red Dragons", "score": 3 },
"away_team": { "name": "Blue Tigers", "score": 2 },
"final": true
}
}
Standings Updated Event
{
"event": "standings.updated",
"data": {
"standings": [
{ "rank": 1, "team": "Red Dragons", "wins": 10, "losses": 2 },
{ "rank": 2, "team": "Blue Tigers", "wins": 9, "losses": 3 }
]
}
}
Testing Your Webhooks
๐งช Test Before Going Live
Always test your webhook endpoint before activating it for real events.
Use Testing Tools
Services like webhook.site or requestbin.com let you inspect incoming webhook data without building your own endpoint first.
Check Your Logs
StatHarbour logs all webhook attempts. View delivery status and response codes in the webhook management panel.
Send Test Payloads
Use the "Send Test" button to trigger a sample webhook and verify your endpoint responds correctly.
Discord Integration Example
One of the most popular uses for webhooks is posting updates to Discord channels.
Create Discord Webhook
In your Discord server, go to Channel Settings โ Integrations โ Webhooks and create a new webhook. Copy the webhook URL.
Add to StatHarbour
Paste the Discord webhook URL into StatHarbour's webhook settings. Discord webhooks accept POST requests directly.
Select Events
Choose events like game.completed and standings.updated to post automatic updates.
Security Best Practices
Use HTTPS Only
Always use HTTPS endpoints to ensure webhook data is encrypted in transit.
Validate Data
Always validate incoming webhook data before processing it in your application.
Verify Source
Check that webhook requests come from StatHarbour's IP addresses (contact support for the current IP list).
Handle Failures Gracefully
Your endpoint should return proper HTTP status codes. StatHarbour will retry failed deliveries automatically.
Troubleshooting
โ Webhooks Not Receiving Data
- Verify your endpoint is publicly accessible (not localhost)
- Check that your server accepts POST requests
- Ensure your SSL certificate is valid
- Review webhook logs in StatHarbour for error messages
โฑ๏ธ Delayed Notifications
- Check your server response time (should be under 5 seconds)
- Verify no firewall is blocking StatHarbour's requests
- Review your endpoint's rate limits
๐ง Testing Issues
- Use webhook.site to verify StatHarbour is sending data correctly
- Check that your selected events are actually occurring in your league
- Ensure webhooks are toggled to "Active" status
Pricing & Limits
๐ฐ No Additional Cost
Webhooks are included free in all subscription plans. StatHarbour bills one yearly subscription, capped by active teams:
- Starter: Webhooks included โ
- Pro: Webhooks included โ
- Elite: Webhooks included โ
Reasonable Usage Limits
There are no hard limits on webhook volume for normal league operations. If you experience unusually high traffic or need enterprise-grade delivery guarantees, contact support to discuss your needs.
Need Help?
If you need assistance setting up webhooks:
- Check the webhook logs in your league settings for delivery status and errors
- Use webhook.site to test if StatHarbour is sending data correctly
- Contact support through the app for technical assistance
- Visit the Dashboard to configure your webhooks