Skip to content

add_to_queue currently passes data (uri and device_id) as request body instead of URL parameters #772

Closed as not planned

Description

@mockxe

Summary

The function add_to_queue currently passes the data, which is a dict constructed of uri and optionally device_id, as request body (data=) instead of query parameters (params=).

According to the API specification those parameters should be passed as query parameters, see https://developer.spotify.com/documentation/web-api/reference/add-to-queue

Suggested Fix

This is simply fixed by using params= instead of data= in spotifyaio/spotify.py:437

    async def add_to_queue(self, uri: str, device_id: str | None = None) -> None:
        """Add to queue."""
        data: dict[str, str] = {"uri": uri}
        if device_id:
            data["device_id"] = device_id
        await self._post("v1/me/player/queue", params=data)

Impact

All calls to add_to_queue silently fail, the Spotify API doesn't receive the params, nothing is added to the queue.

This can for example be observed in Home Assistant when issuing the following Action

action: media_player.play_media
target:
  entity_id: media_player.spotify # or whatever the Spotify Entity Id is
data:
  media_content_id: "spotify:track:0C80GCp0mMuBzLf3EAXqxv"
  media_content_type: track
  enqueue: add # This should add the track to the queue

A simple monkey-patch in such environment already confirms the fix is working.

Activity

  1. github-actions commented on Jun 17, 2026

    @github-actions

    There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
    Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
    This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

  2. added
    stale
    on Jun 17, 2026
  3. mockxe commented on Jun 17, 2026

    @mockxe
    Author

    The issue is still relevant

  4. removed
    stale
    on Jun 18, 2026
  5. github-actions commented on Jul 19, 2026

    @github-actions

    There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
    Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
    This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

  6. added
    stale
    on Jul 19, 2026
  7. locked and limited conversation to collaborators on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions