---
title: "loadStreamUrl"
method: POST
path: "/playbackSessions/{sessionId}/playbackSession/loadStreamUrl"
tags: ["playbackSession"]
---

# loadStreamUrl

`POST /playbackSessions/{sessionId}/playbackSession/loadStreamUrl`

The loadStreamUrl command in the playbackSession namespace loads a streaming (live) radio station URL and optionally starts playback. Upon successful completion, the player sends a playbackStatus event to your app or hardware integration. Your app should subscribe to the playback namespace before sending the loadStreamUrl command to avoid race conditions in receiving playbackStatus or playbackError events.

 This command requires that your app has an open playback session with a cloud queue, created or joined using the createSession, joinSession, or joinOrCreateSession command.

 If you want to immediately start playing the stream, set the playOnCompletion parameter to true. This bypasses the need to send a play command after the player loads the stream.

## Request body

- object
  - `streamUrl` string, required — HTTP URL for the radio station stream. See the supported content types below. Note that you cannot use this command to send an on-demand track for playback.
  - `playOnCompletion` boolean, nullable — (Optional) If true, the player will start playback after loading the stream URL. If false or not provided, the player remains in the PLAYBACK_IDLE state.
  - `stationMetadata` Container — No description available
    - `name` string, nullable — No description available
    - `type` string, nullable — No description available
    - `id` UniversalMusicObjectId — Universal Music Object Id JSON representation: { "serviceId": "3", "objectId": "tr12345", "accountId": "acct1234" } Local Library: { "objectId": "S://ENTERPRISE/media/Music/Radiohead/OK%20Computer", "serviceId": "local-library", "accountId": "mhhid_[household id]", } The serviceId is equivalent to the "sid()" function in RMusicServiceDescriptor. RMusicServiceDescriptor::sid() returns an unsigned integer. This is assumed to be 32 bits in our system. Therefore, rgchServiceId must be large enough to store 4294967295. The objectId is the object Id from the service. For SMAPI services, it is the SMAPI Id. We also have custom code to support Pandora and Rhapsody. These size came from inspecting the following constants: * SMAPI Ids are based on R_SONOS_MAX_ID_LEN = 256 * Rhapsody Ids are RRD_ID_LEN = 64 * Pandora Ids are RPANDORA_MAX_ID_LEN = (128+16) = 144 The accountId is used to identify the account used for listening. We have not finalized the format, but we are working with: sn_123123, where the numeric part is the account serial number and mhhid_[household id].
      - `serviceId` string, nullable — The serviceId is necessary for resolving content. While this is not a required field, it is recommended to provide this information or the content may not be playable.
      - `objectId` string, required — No description available
      - `accountId` string, nullable — The account id linked to this object in one of the following formats: sn_[household id] or mhhid_[household id]
    - `service` Service — No description available
      - `name` string, nullable — No description available
      - `id` string, nullable — No description available
      - `imageUrl` string, nullable — Replaced by the `images` parameter.
    - `book` Book — No description available
      - `name` string, required — No description available
      - `chapterCount` integer, nullable — No description available
      - `author` Artist — No description available
        - `name` string, required — No description available
        - `id` UniversalMusicObjectId — Universal Music Object Id JSON representation: { "serviceId": "3", "objectId": "tr12345", "accountId": "acct1234" } Local Library: { "objectId": "S://ENTERPRISE/media/Music/Radiohead/OK%20Computer", "serviceId": "local-library", "accountId": "mhhid_[household id]", } The serviceId is equivalent to the "sid()" function in RMusicServiceDescriptor. RMusicServiceDescriptor::sid() returns an unsigned integer. This is assumed to be 32 bits in our system. Therefore, rgchServiceId must be large enough to store 4294967295. The objectId is the object Id from the service. For SMAPI services, it is the SMAPI Id. We also have custom code to support Pandora and Rhapsody. These size came from inspecting the following constants: * SMAPI Ids are based on R_SONOS_MAX_ID_LEN = 256 * Rhapsody Ids are RRD_ID_LEN = 64 * Pandora Ids are RPANDORA_MAX_ID_LEN = (128+16) = 144 The accountId is used to identify the account used for listening. We have not finalized the format, but we are working with: sn_123123, where the numeric part is the account serial number and mhhid_[household id].
          - `serviceId` string, nullable — The serviceId is necessary for resolving content. While this is not a required field, it is recommended to provide this information or the content may not be playable.
          - `objectId` string, required — No description available
          - `accountId` string, nullable — The account id linked to this object in one of the following formats: sn_[household id] or mhhid_[household id]
        - `tags` TagsData[], nullable — Deprecated in favor of the `explicit` parameter.
      - `narrator` Artist — No description available
        - `name` string, required — No description available
        - `id` UniversalMusicObjectId — Universal Music Object Id JSON representation: { "serviceId": "3", "objectId": "tr12345", "accountId": "acct1234" } Local Library: { "objectId": "S://ENTERPRISE/media/Music/Radiohead/OK%20Computer", "serviceId": "local-library", "accountId": "mhhid_[household id]", } The serviceId is equivalent to the "sid()" function in RMusicServiceDescriptor. RMusicServiceDescriptor::sid() returns an unsigned integer. This is assumed to be 32 bits in our system. Therefore, rgchServiceId must be large enough to store 4294967295. The objectId is the object Id from the service. For SMAPI services, it is the SMAPI Id. We also have custom code to support Pandora and Rhapsody. These size came from inspecting the following constants: * SMAPI Ids are based on R_SONOS_MAX_ID_LEN = 256 * Rhapsody Ids are RRD_ID_LEN = 64 * Pandora Ids are RPANDORA_MAX_ID_LEN = (128+16) = 144 The accountId is used to identify the account used for listening. We have not finalized the format, but we are working with: sn_123123, where the numeric part is the account serial number and mhhid_[household id].
          - `serviceId` string, nullable — The serviceId is necessary for resolving content. While this is not a required field, it is recommended to provide this information or the content may not be playable.
          - `objectId` string, required — No description available
          - `accountId` string, nullable — The account id linked to this object in one of the following formats: sn_[household id] or mhhid_[household id]
        - `tags` TagsData[], nullable — Deprecated in favor of the `explicit` parameter.
      - `id` UniversalMusicObjectId — Universal Music Object Id JSON representation: { "serviceId": "3", "objectId": "tr12345", "accountId": "acct1234" } Local Library: { "objectId": "S://ENTERPRISE/media/Music/Radiohead/OK%20Computer", "serviceId": "local-library", "accountId": "mhhid_[household id]", } The serviceId is equivalent to the "sid()" function in RMusicServiceDescriptor. RMusicServiceDescriptor::sid() returns an unsigned integer. This is assumed to be 32 bits in our system. Therefore, rgchServiceId must be large enough to store 4294967295. The objectId is the object Id from the service. For SMAPI services, it is the SMAPI Id. We also have custom code to support Pandora and Rhapsody. These size came from inspecting the following constants: * SMAPI Ids are based on R_SONOS_MAX_ID_LEN = 256 * Rhapsody Ids are RRD_ID_LEN = 64 * Pandora Ids are RPANDORA_MAX_ID_LEN = (128+16) = 144 The accountId is used to identify the account used for listening. We have not finalized the format, but we are working with: sn_123123, where the numeric part is the account serial number and mhhid_[household id].
        - `serviceId` string, nullable — The serviceId is necessary for resolving content. While this is not a required field, it is recommended to provide this information or the content may not be playable.
        - `objectId` string, required — No description available
        - `accountId` string, nullable — The account id linked to this object in one of the following formats: sn_[household id] or mhhid_[household id]
    - `podcast` Podcast — No description available
      - `name` string, required — The title of the podcast or show
      - `producer` Artist — No description available
        - `name` string, required — No description available
        - `id` UniversalMusicObjectId — Universal Music Object Id JSON representation: { "serviceId": "3", "objectId": "tr12345", "accountId": "acct1234" } Local Library: { "objectId": "S://ENTERPRISE/media/Music/Radiohead/OK%20Computer", "serviceId": "local-library", "accountId": "mhhid_[household id]", } The serviceId is equivalent to the "sid()" function in RMusicServiceDescriptor. RMusicServiceDescriptor::sid() returns an unsigned integer. This is assumed to be 32 bits in our system. Therefore, rgchServiceId must be large enough to store 4294967295. The objectId is the object Id from the service. For SMAPI services, it is the SMAPI Id. We also have custom code to support Pandora and Rhapsody. These size came from inspecting the following constants: * SMAPI Ids are based on R_SONOS_MAX_ID_LEN = 256 * Rhapsody Ids are RRD_ID_LEN = 64 * Pandora Ids are RPANDORA_MAX_ID_LEN = (128+16) = 144 The accountId is used to identify the account used for listening. We have not finalized the format, but we are working with: sn_123123, where the numeric part is the account serial number and mhhid_[household id].
          - `serviceId` string, nullable — The serviceId is necessary for resolving content. While this is not a required field, it is recommended to provide this information or the content may not be playable.
          - `objectId` string, required — No description available
          - `accountId` string, nullable — The account id linked to this object in one of the following formats: sn_[household id] or mhhid_[household id]
        - `tags` TagsData[], nullable — Deprecated in favor of the `explicit` parameter.
      - `id` UniversalMusicObjectId — Universal Music Object Id JSON representation: { "serviceId": "3", "objectId": "tr12345", "accountId": "acct1234" } Local Library: { "objectId": "S://ENTERPRISE/media/Music/Radiohead/OK%20Computer", "serviceId": "local-library", "accountId": "mhhid_[household id]", } The serviceId is equivalent to the "sid()" function in RMusicServiceDescriptor. RMusicServiceDescriptor::sid() returns an unsigned integer. This is assumed to be 32 bits in our system. Therefore, rgchServiceId must be large enough to store 4294967295. The objectId is the object Id from the service. For SMAPI services, it is the SMAPI Id. We also have custom code to support Pandora and Rhapsody. These size came from inspecting the following constants: * SMAPI Ids are based on R_SONOS_MAX_ID_LEN = 256 * Rhapsody Ids are RRD_ID_LEN = 64 * Pandora Ids are RPANDORA_MAX_ID_LEN = (128+16) = 144 The accountId is used to identify the account used for listening. We have not finalized the format, but we are working with: sn_123123, where the numeric part is the account serial number and mhhid_[household id].
        - `serviceId` string, nullable — The serviceId is necessary for resolving content. While this is not a required field, it is recommended to provide this information or the content may not be playable.
        - `objectId` string, required — No description available
        - `accountId` string, nullable — The account id linked to this object in one of the following formats: sn_[household id] or mhhid_[household id]
    - `imageUrl` string, nullable — Replaced by the `images` parameter.
    - `tags` TagsData[], nullable — Deprecated in favor of the `explicit` parameter.
  - `itemId` string, nullable — (Optional) If provided, the player includes this itemId in subsequent playbackStatus and playbackError events corresponding to this stream.

## Response `200`

See the x-muse-error-codes extension for a list of muse errors that generate this response

- Ok — This object represents an empty (default) success. The platform returns an empty object ({}).

## Other responses

- `400` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `401` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `403` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `404` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `499` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `500` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `503` — See the x-muse-error-codes extension for a list of muse errors that generate this response

---

[API](https://skmtc.net/sonos/apis/authorization-api.md) · [All operations](https://skmtc.net/sonos/apis/authorization-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sonos/authorization-api/revisions/243132628620/schema)
