Skip to content

Add CreatePlaylist endpoint (POST /v1/me/playlists)#454

Merged
dargmuesli merged 3 commits intobetafrom
copilot/add-create-playlist-endpoint
Mar 9, 2026
Merged

Add CreatePlaylist endpoint (POST /v1/me/playlists)#454
dargmuesli merged 3 commits intobetafrom
copilot/add-create-playlist-endpoint

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

CreatePlaylistRequest was entirely absent from the codebase — the endpoint was lost during the v10 migration. Spotify's current API uses POST /v1/me/playlists (not the legacy /v1/users/{user_id}/playlists).

Changes

  • CreatePlaylistRequest — new request class targeting POST /v1/me/playlists with builder params: name (required), public_, collaborative, description
  • SpotifyApi — exposes createPlaylist(String name) builder method
  • CreatePlaylistRequestTest + fixture — unit test covering URI, headers, body params, and response deserialization
  • AGENTS.md — foundational repo map and conventions for AI agents

Usage

Playlist playlist = spotifyApi.createPlaylist("My Playlist")
    .public_(false)
    .description("Created via API")
    .collaborative(false)
    .build()
    .execute();
Original prompt

This section details on the original issue you should resolve

<issue_title>CreatePlaylist endpoint missing</issue_title>
<issue_description>It looks like the recent transition to Spotify's new API hasn't worked smoothly for the CreatePlaylist endpoint, which is now completely missing from the 10.0.0-RC1 version.

Spotify said to use POST /me/playlist instead, but that endpoint is nowhere to be found either. I got a feeling that Copilot butchered that part in particular during the migration.</issue_description>

<agent_instructions>You're one of the first AI runs on the repo, therefore your initial analysis is foundational: In addition to the endpoint creation you may also create an initial AGENTS.md in the root of the project based on your initial foundational analysis.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@dargmuesli Here is the api docs for Copilot:
Title: Web API Reference | Spotify for Developers

URL Source: https://developer.spotify.com/documentation/web-api/reference/create-playlist

Markdown Content:
Skip to content
Documentation
Community
Log in

Web API

Overview
Getting started
Concepts
Tutorials
How-Tos
Changelog
REFERENCE
Albums
Artists
Audiobooks
Categories
Chapters
Episodes
Genres
Library
Markets
Player
Playlists
Get Playlist
Change Playlist Details
Get Playlist Items [DEPRECATED]
Update Playlist Items [DEPRECATED]
Add Items to Playlist [DEPRECATED]
Remove Playlist Items [DEPRECATED]
Get Playlist Items
Update Playlist Items
Add Items to Playlist
Remove Playlist Items
Get Current User's Playlists
Create Playlist
Get User's Playlists
Create Playlist for user
Get Featured Playlists
Get Category's Playlists
Get Playlist Cover Image
Add Custom Playlist Cover Image
Search
Shows
Tracks
Users
Web API •
References / Playlists / Create Playlist
Create Playlist
OAuth 2.0

Create a playlist for the current Spotify user. (The playlist will be empty until you add tracks.) Each user is generally limited to a maximum of 11000 playlists.

Authorization scopes
playlist-modify-public
playlist-modify-private
Request
POST/me/playlists
Body application/json
supports free form additional properties
namestring
Required

The name for the new playlist, for example "Your Coolest Playlist". This name does not need to be unique; a user may have several playlists with the same name.

publicboolean

Defaults to true. The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private. To be able to create private playlists, the user must have granted the playlist-modify-private scope. For more about public/private status, see Working with Playlists

collaborativeboolean

Defaults to false. If true the playlist will be collaborative. Note: to create a collaborative playlist you must also set public to false. To create collaborative playlists you must have granted playlist-modify-private and playlist-modify-public scopes.

descriptionstring

value for playlist description as displayed in Spotify Clients and in the Web API.

Response
201
401
403
429

A playlist

collaborativeboolean

true if the owner allows other users to modify the playlist.

descriptionstring
Nullable

The playlist description. Only returned for modified, verified playlists, otherwise null.

external_urlsobject

Known external URLs for this playlist.

spotifystring

The Spotify URL for the object.

hrefstring

A link to the Web API endpoint providing full details of the playlist.

idstring

The Spotify ID for the playlist.

imagesarray of ImageObject

Images for the playlist. The array may be empty or contain up to three images. The images are returned by size in descending order. See Working with Playlists. Note: If returned, the source URL for the image (url) is temporary and will expire in less than a day.

urlstring
Required

The source URL of the image.

Example: "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228"
heightinteger
Required
Nullable

The image height in pixels.

Example: 300
widthinteger
Required
Nullable

The image width in pixels.

Example: 300
namestring

The name of the playlist.

ownerobject

The user who owns the playlist

external_urlsobject

Known public external URLs for this user.

hrefstring

A link to the Web API endpoint for this user.

idstring

The Spotify user ID for this user.

typestring

The object type.

Allowed values: "user"
uristring

The Spotify URI for this user.

display_namestring
Nullable

The name displayed on the user's profile. null if not available.

publicboolean

The playlist's public/private status (if it is added to the user's profile): true the playlist is public, false the playlist is private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

sna...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes spotify-web-api-java/spotify-web-api-java#453

<!-- START COPILOT CODING AGENT TIPS -->
---

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security)

Copilot AI changed the title [WIP] Add CreatePlaylist endpoint to support new API Add CreatePlaylist endpoint (POST /v1/me/playlists) Mar 9, 2026
@dargmuesli dargmuesli requested a review from Selbi182 March 9, 2026 17:28
@dargmuesli dargmuesli marked this pull request as ready for review March 9, 2026 17:28
Copy link
Member

@dargmuesli dargmuesli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, but haven't tested yet. As this targets beta I'll wait for your check @Selbi182, then merge and release it then if you agree.

Edit: ah, we were at it at the same time! ;)

@dargmuesli dargmuesli force-pushed the copilot/add-create-playlist-endpoint branch from 91e3abe to 8f77f1d Compare March 9, 2026 18:11
@dargmuesli dargmuesli merged commit 91bf5aa into beta Mar 9, 2026
9 of 10 checks passed
@dargmuesli dargmuesli deleted the copilot/add-create-playlist-endpoint branch March 9, 2026 18:15
@dargmuesli dargmuesli mentioned this pull request Mar 9, 2026
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.84%. Comparing base (d0dcfaf) to head (8f77f1d).
⚠️ Report is 4 commits behind head on beta.

Files with missing lines Patch % Lines
...requests/data/playlists/CreatePlaylistRequest.java 77.77% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               beta     #454      +/-   ##
============================================
+ Coverage     49.72%   49.84%   +0.12%     
- Complexity      579      582       +3     
============================================
  Files           242      243       +1     
  Lines          8605     8626      +21     
  Branches       1050     1054       +4     
============================================
+ Hits           4279     4300      +21     
+ Misses         3528     3526       -2     
- Partials        798      800       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants