Skip to content

Webhooks

Send automatic notifications to external services when events occur in your station.

What Is a Webhook

A webhook sends an HTTP POST request to a URL when a specific event occurs. External services can receive these notifications and take action.

Event occurs → xtra sends POST request → External service receives data

Available Triggers

TriggerEventDescription
station.studio.newtrackNew track playsFires when a new track starts playing in the studio. Payload includes current and next track metadata.
station.encoder.statuschangeEncoder status changeFires when an encoder connects or disconnects.

Plan Limits

The number of webhooks per station depends on the plan.

PlanWebhooks per station
Plus1
Pro2
Ultimate3
EnterpriseCustom

See Billing for plan details.

Adding a Webhook

  1. Open Webhooks in the station sidebar
  2. Click Add Webhook
  3. Enter a name and destination URL
  4. Select one or more trigger events
  5. Click Save

Configuration Fields

FieldDescription
NameDisplay name for the webhook
URLThe endpoint that receives POST requests
TriggersArray of events that activate the webhook

A webhook can listen to multiple triggers simultaneously.

Payload Format

Webhooks send JSON data in the POST request body. The payload structure depends on the trigger event.

The station.studio.newtrack payload includes artist, title, album, and cover URL for both the now-playing track and the next track.

json
{
  "trigger": "station.studio.newtrack",
  "nowPlaying": {
    "artist": "Artist Name",
    "title": "Track Title",
    "album": "Album Name",
    "cover": "https://static.xtra.audio/covers/example.jpg"
  },
  "next": {
    "artist": "Next Artist",
    "title": "Next Title",
    "album": "Next Album",
    "cover": "https://static.xtra.audio/covers/next.jpg"
  }
}

TIP

Use webhook.site to inspect the exact payload format during testing.

Testing Webhooks

Each webhook has a test button that sends a sample payload to the configured URL. Use it to confirm the endpoint receives requests without waiting for a live event.

  1. Open Webhooks in the station sidebar
  2. Locate the webhook to test
  3. Click the test button
  4. Confirm the sample payload arrives at the destination

To inspect the payload format with an external tool:

  1. Visit webhook.site and copy your unique URL
  2. Add the URL as a webhook in xtra audio
  3. Trigger the event (play a track or toggle an encoder)
  4. View the received payload on webhook.site

Use Cases

IntegrationTriggerAction
Discordstation.studio.newtrackPost now-playing to channel
Website widgetstation.studio.newtrackUpdate live track display
Monitoringstation.encoder.statuschangeAlert on encoder disconnect
Analyticsstation.studio.newtrackLog plays to database

Alternatives

For pull-based access to now-playing data, the Public API exposes the same metadata without configuring an endpoint. Use webhooks for push notifications and the API for on-demand requests.