Reference / @open-music-sdk/client-user / createLibraryPlaylistFolder
Function: createLibraryPlaylistFolder()
function createLibraryPlaylistFolder(
client,
folder,
options?
): Promise<tLibraryPlaylistFoldersResponse>;Defined in: clients/client-user/src/resources.ts:431
Makes a playlist folder in the listener's library: { attributes: { name } }, with the folder to put it in under relationships. Resolves to the answer that holds the new folder. Bound, it gives the folder, or undefined if Apple's answer holds none: the folder was made either way. The folder has to be a plain object, and still one once made into JSON. It is copied as the call is made and sent as it is: what it holds is Apple's to judge, and nothing here limits its size, so limit it yourself if it comes from outside your app. Against the live API on 18 October 2026, a folder made with no parent was in the root: it could be read by its id at once, and was among the children of p.playlistsroot, its parent, a second later.
Parameters
client
The listener's client to ask with.
folder
tLibraryPlaylistFolderCreationRequest
The folder to make: its name under attributes, and the folder to put it in under relationships.
options?
tCreateLibraryPlaylistFolderOptions
The language to answer in, and what else to send with the request.
Returns
Promise<tLibraryPlaylistFoldersResponse>
What Apple answered: the new folder under data.
Throws
TypeError if client is no client or an argument is not what it should be, before Apple is asked.
Throws
AppleMusicError if Apple, the network, or a token provider fails, or a schema finds issues; _tag says which.
Throws
The reason options.signal aborted with, when it does.
Throws
Whatever a token provider, store, schema, hook or rate limiter throws, as client.request passes it on.