Webhook Integration
My Media for Alexa can notify an external HTTP endpoint whenever key playback events occur. This lets you integrate My Media with home automation systems, dashboards, logging tools, or any service that can receive an HTTP POST request.
Setting Up a Webhook
- Navigate to Settings → General in the My Media Web Console.
- Scroll to the Webhook section.
- Enter a full
http://orhttps://URL in the field (e.g.https://automation.example.com/hooks/mymedia). - Click Set.
Leave the field empty to disable webhooks entirely.
Tips
My Media fires webhooks asynchronously after other processing is complete, so they never delay audio streaming. If the target URL is unreachable, the request times out after 3 seconds and the failure is noted in the log — playback is unaffected.
Payload Format
Every webhook call is an HTTP POST request with a Content-Type: application/json header.
All payloads share the same top-level envelope:
{
"event": "<event_name>",
"timestamp": "<ISO 8601 UTC datetime>",
"data": { ... }
}
| Field | Type | Description |
|---|---|---|
event | string | The name of the event (see Event Reference below) |
timestamp | string | UTC datetime in ISO 8601 format, e.g. "2026-04-19T10:32:11.457Z" |
data | object | Event-specific payload (see below) |
Event Reference
playlist_start
Fired when a playlist has been created and is about to be handed to Alexa for playback. This is the earliest point at which you know what will play.
data fields:
| Field | Type | Description |
|---|---|---|
playlist | string | Name of the playlist (e.g. "Rock Classics", "Everything") |
track_count | integer | Number of tracks in the playlist |
Example:
{
"event": "playlist_start",
"timestamp": "2026-04-19T10:32:11.457Z",
"data": {
"playlist": "Rock Classics",
"track_count": 43
}
}
track_start
Fired each time Alexa begins streaming a track (i.e. audio playback has actually started on the device).
data fields:
| Field | Type | Description |
|---|---|---|
track | string | Track title |
artist | string | Contributing artist(s) |
album | string | Album name |
genre | string | Genre |
playlist | string | Name of the playlist the track belongs to |
device | string | Friendly name of the Alexa device playing the track |
artwork_url | string | URL of the track's album art, served by My Media (e.g. http://192.168.1.10:52199/thumbnail?mediaitem=1234) |
Example:
{
"event": "track_start",
"timestamp": "2026-04-19T10:32:14.801Z",
"data": {
"track": "Bohemian Rhapsody",
"artist": "Queen",
"album": "A Night at the Opera",
"genre": "Rock",
"playlist": "Rock Classics",
"device": "Living Room Echo",
"artwork_url": "http://192.168.1.10:52199/thumbnail?mediaitem=1234"
}
}
track_paused
Fired when the user pauses playback (e.g. "Alexa, pause").
data fields:
| Field | Type | Description |
|---|---|---|
track | string or null | Title of the track that was paused, or null if unavailable |
artist | string or null | Contributing artist(s), or null if unavailable |
album | string or null | Album name, or null if unavailable |
genre | string or null | Genre, or null if unavailable |
playlist | string or null | Name of the active playlist, or null if unavailable |
artwork_url | string or null | URL of the track's album art, or null if unavailable |
Example:
{
"event": "track_paused",
"timestamp": "2026-04-19T10:34:02.123Z",
"data": {
"track": "Bohemian Rhapsody",
"artist": "Queen",
"album": "A Night at the Opera",
"genre": "Rock",
"playlist": "Rock Classics",
"artwork_url": "http://192.168.1.10:52199/thumbnail?mediaitem=1234"
}
}
track_stopped
Fired when the user explicitly stops playback (e.g. "Alexa, stop").
data fields:
| Field | Type | Description |
|---|---|---|
track | string or null | Title of the last track that was playing, or null if unavailable |
artist | string or null | Contributing artist(s), or null if unavailable |
album | string or null | Album name, or null if unavailable |
genre | string or null | Genre, or null if unavailable |
playlist | string or null | Name of the active playlist, or null if unavailable |
artwork_url | string or null | URL of the track's album art, or null if unavailable |
Example:
{
"event": "track_stopped",
"timestamp": "2026-04-19T10:41:55.900Z",
"data": {
"track": "Bohemian Rhapsody",
"artist": "Queen",
"album": "A Night at the Opera",
"genre": "Rock",
"playlist": "Rock Classics",
"artwork_url": "http://192.168.1.10:52199/thumbnail?mediaitem=1234"
}
}
track_failed
Fired when Alexa reports that it could not stream a track (e.g. a network error, unsupported codec without transcoding enabled, or firewall blocking the connection).
data fields:
| Field | Type | Description |
|---|---|---|
track | string | Title of the track that failed |
artist | string | Contributing artist(s) |
album | string | Album name |
genre | string | Genre |
error_code | string | The error code reported by Alexa |
artwork_url | string | URL of the track's album art |
Example:
{
"event": "track_failed",
"timestamp": "2026-04-19T10:33:01.200Z",
"data": {
"track": "In The Air Tonight",
"artist": "Phil Collins",
"album": "Face Value",
"genre": "Pop",
"error_code": "MEDIA_ERROR_UNKNOWN",
"artwork_url": "http://192.168.1.10:52199/thumbnail?mediaitem=5678"
}
}
Tips
track_failed events are a good indicator of streaming problems. If you see repeated failures, check your firewall settings and whether transcoding is required for the file format (see Settings → Additional Audio File Formats).
track_finished
Fired when Alexa completes playing a track naturally (i.e. it reaches the end and the next track is being requested). This event fires for every track that plays to completion — use it to record play history or update a "last played" indicator.
data fields:
| Field | Type | Description |
|---|---|---|
track | string | Title of the track that finished |
artist | string | Contributing artist(s) |
album | string | Album name |
genre | string | Genre |
artwork_url | string | URL of the track's album art |
Example:
{
"event": "track_finished",
"timestamp": "2026-04-19T10:34:55.312Z",
"data": {
"track": "Bohemian Rhapsody",
"artist": "Queen",
"album": "A Night at the Opera",
"genre": "Rock",
"artwork_url": "http://192.168.1.10:52199/thumbnail?mediaitem=1234"
}
}
playlist_finished
Fired when a playlist reaches its end and looping is off — i.e. there are no more tracks to play. This event does not fire if the user manually stops playback; use track_stopped for that.
data fields:
| Field | Type | Description |
|---|---|---|
playlist | string or null | Name of the playlist that finished, or null if unavailable |
Example:
{
"event": "playlist_finished",
"timestamp": "2026-04-19T11:05:42.000Z",
"data": {
"playlist": "Rock Classics"
}
}
Behaviour and Reliability
| Characteristic | Detail |
|---|---|
| HTTP method | POST |
| Content-Type | application/json |
| Timeout | 3 seconds |
| Retry on failure | No — failed requests are logged and discarded |
| Blocking | No — webhooks fire asynchronously after all other event processing |
| TLS | Both http:// and https:// targets are supported |
Because webhooks are fire-and-forget, a slow or unavailable endpoint will never delay or interrupt audio playback.
Example: Home Assistant
The following is an example Home Assistant REST command trigger that could be used to react to a track_start event (configured on the Home Assistant side to listen for the incoming POST):
# In configuration.yaml
input_text:
now_playing:
name: Now Playing
Your receiving endpoint would parse the JSON body, extract data.track and data.artist, and update the input_text entity via the Home Assistant WebSocket API or REST API accordingly.
Troubleshooting
My webhook URL is being rejected in the Settings page
The URL must start with http:// or https://. Relative URLs, bare hostnames, and localhost without a scheme are not accepted.
I'm not receiving webhook calls
- Check that the URL is reachable from the machine running My Media (not just your browser machine).
- Check the My Media log (available on the Support screen) for
Webhook errorentries. - Ensure your endpoint responds within 3 seconds — requests that take longer are abandoned.
- Verify your endpoint accepts
POSTrequests with aContent-Type: application/jsonbody.
