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

  1. You provide StatHarbour with a URL (your webhook endpoint)
  2. You select which events you want to receive notifications for
  3. When those events happen, StatHarbour will send data to your URL (not built yet: today only the Test button sends a delivery)
  4. 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

1

Navigate to Webhooks Settings

Go to your league dashboard, open Integration & API, then the Webhooks tab.

2

Add Your Webhook URL

Enter the URL where you want to receive notifications. This must be an HTTPS endpoint that can accept POST requests.

Example: https://your-website.com/webhooks/statharbour
3

Select Events

Choose which events should trigger notifications. You can select multiple events for a single webhook.

4

Test the Webhook

Use the "Send Test" button to verify your endpoint receives data correctly before activating.

5

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.

1

Create Discord Webhook

In your Discord server, go to Channel Settings โ†’ Integrations โ†’ Webhooks and create a new webhook. Copy the webhook URL.

2

Add to StatHarbour

Paste the Discord webhook URL into StatHarbour's webhook settings. Discord webhooks accept POST requests directly.

3

Select Events

Choose events like game.completed and standings.updated to post automatic updates.

Note: For Discord, you may need a simple middleware service to transform StatHarbour's webhook format into Discord's expected message format.

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