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

# loadCloudQueue

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

One way to play audio on Sonos is by using a cloud queue, a list of tracks that you host on a server that the player can access. See Play audio for details. Use the loadCloudQueue command in the playbackSession namespace to load, and optionally start playback of, an item in a cloud queue.

 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 track, set the playOnCompletion parameter to true. This bypasses the need to send a play command after the player loads the track. You should also send playback objects with information about the track in the trackMetadata parameter. This optimization improves the user experience by starting playback for the first track before the player fetches tracks from the cloud queue server.

 After receiving the loadCloudQueue command, the player will fetch a window of tracks from the cloud queue server centered around the item with the itemId that your app provided. If the track was deleted, the group will play the next track in the queue. For more details, see the Cloud Queue API /itemWindow endpoint.

 All commands in the playback and playbackMetadata namespace also apply to the cloud queue playback. For example, you can send the play or pause command in the playback namespace to play or pause a cloud queue track on a player.

## Request body

- object
  - `queueBaseUrl` string, required — The base URL for the cloud queue. The player uses this to form the REST URLs used to access the cloud queue. This URL is required to end in a recognized version specification indicating the version of the Cloud Queue API supported by the server. See the Cloud queue base URL and API version section in Play audio for details. You can pass RESTful segments within the base URL to identify the user. See the Communicate user identity in the base URL section in Play audio for details.
  - `httpAuthorization` string, nullable — (Optional) The string value for the HTTP Authorization header, provided to the cloud queue server on all requests. See the Authorization for media and the cloud queue section in Play audio for details. If you don’t include this value and the player matches the session to a SMAPI user account, the Authorization header will contain the SMAPI account OAuth token.
  - `useHttpAuthorizationForMedia` boolean, nullable — (Optional) If true, the player passes the httpAuthorization token to HTTPS media requests associated with the cloud queue. The player never sends the token to insecure (HTTP) requests. This parameter has no bearing when cloud queue items reference SMAPI objects, in which case, the player sends normal SMAPI headers. The default value is false.
  - `itemId` string, nullable — (Optional) The identifier for the track to load. If this is an empty string (“”) or omitted, the player skips to the beginning of the cloud queue by requesting an item window with an empty string as the itemId. If you provide trackMetadata, you must also provide itemId, even if it is “”.
  - `queueVersion` string, nullable — (Optional) An opaque identifier used to indicate the change state of the contents in the cloud queue. For example, if the list of tracks in the cloud queue changes, the cloud queue server would change the queueVersion. The player stores this value and can pass it back in the GET /itemWindow request. This enables your cloud-based client to keep its app and data model in sync across calls to the player.
  - `positionMillis` integer, nullable — (Optional) Position within the track in milliseconds. Default value is 0. If not provided and itemId matches the current item, the player does not interrupt playback or change the current position. The player still respects the playOnCompletion parameter, if provided. This value can be formatted as a JSON string or number.
  - `playOnCompletion` boolean, nullable — (Optional) If true, start playback after loading the cloud queue. If you provided the trackMetadata, the player begins playback immediately. If you provided the itemId, the player starts playing once the cloud queue window returns the metadata. If not provided, the default value is false. If false, the player loads the cloud queue, but requires the play command to begin.
  - `trackMetadata` Track — No description available
    - `type` string, nullable — No description available
    - `name` string, nullable — This parameter will be ignored for local library tracks on load commands (e.g., loadTrackList).
    - `mediaUrl` string, nullable — No description available
    - `imageUrl` string, nullable — Replaced by the `images` parameter.
    - `contentType` string, nullable — No description available
    - `album` Album — No description available
      - `name` string, required — No description available
      - `artist` 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]
      - `tags` TagsData[], nullable — Deprecated in favor of the `explicit` parameter.
    - `artist` 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.
    - `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.
    - `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]
    - `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.
    - `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]
    - `releaseDate` string, nullable — The date that this content was released.
    - `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.
    - `episodeNumber` integer, nullable — The incremental number that this episode is in a podcast or show.
    - `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.
    - `durationMillis` integer, nullable — This parameter will be ignored for local library tracks on load commands (e.g., loadTrackList).
    - `trackNumber` integer, nullable — No description available
    - `chapterNumber` integer, nullable — No description available
    - `tags` TagsData[], nullable — Deprecated in favor of the `explicit` parameter. This parameter will be ignored for local library tracks on load commands (e.g., loadTrackList).
    - `quality` TrackQuality — No description available
      - `bitDepth` integer, nullable — The number of bits per sample of audio.
      - `sampleRate` integer, nullable — The sample rate (Hz) of the audio.
      - `codec` string, nullable — The name of the codec used to encode the track (e.g. "mp3").
      - `lossless` boolean, nullable — Whether the codec is lossless. Useful for determining whether the track is "HD" or "HiRes".
      - `immersive` boolean, nullable — "Immersive" is an alias for "3D" audio. Determines whether the track is a 3D audio.
    - `replayGain` number, float, nullable — (Optional) The track gain. This field allows for floating value points. The player applies this normalization to track audio, overriding any value found in the actual media. Your service should pass the best dB value that you have. Players will interpret this as needed and clamp any values outside of this range. Currently, this range is from -13 dB to +13 dB. For example, the player treats a value of 14 as if it were 13. This range is subject to change at our discretion. The replay gain embedded in the media is not overridden when this parameter is omitted.

## 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)
