Announcements

Help Wizard

Step 1

NEXT STEP

403 Forbidden on Add Tracks to Playlist API despite valid scopes

Solved!

403 Forbidden on Add Tracks to Playlist API despite valid scopes

I have a Next.js app hosted on Vercel.

 

The app successfully:
- Authenticates user
- Returns playlist-modify-private
- Returns playlist-modify-public
- Returns user-read-private
- Creates playlists successfully
- Searches tracks successfully

 

However:

POST /v1/playlists/{playlist_id}/tracks

always returns:

403 Forbidden

 

The playlist is owned by the authenticated user.
The same token successfully creates the playlist.

Track URIs are valid Spotify track URIs.

 

Example failing endpoint:
POST https://api.spotify.com/v1/playlists/{playlist_id}/tracks

Request body:
{
"uris": [
"spotify:track:320lwWuMpZ6b0aN2RZ0eMS"
]
}

Any ideas why Spotify allows playlist creation but blocks adding tracks?

Reply

Accepted Solutions
Marked as solution

Hi @soundsdj 

You should use items instead of tracks. This also applies to episodesshowsalbums, and audiobooks.

Look for all the changes to the API in this page.

Cheers!

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

View solution in original post

1 Reply
Marked as solution

Hi @soundsdj 

You should use items instead of tracks. This also applies to episodesshowsalbums, and audiobooks.

Look for all the changes to the API in this page.

Cheers!

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 5 years ago  in Social & Random