# Add items to a Collection using Plex API

**URL:** <https://forums.plex.tv/t/add-items-to-a-collection-using-plex-api/939886>\
**Category:** Dev/API Corner\
**Tags:** other-dev, pms-api\
**Created:** [June 21, 2026, 3:11pm UTC](https://forums.plex.tv/t/add-items-to-a-collection-using-plex-api/939886 "2026-06-21T15:11:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wouter\_o](https://avatars.discourse-cdn.com/v4/letter/w/4bbf92/32.png) [@wouter\_o](https://forums.plex.tv/u/wouter_o)\
**Post date:** [June 21, 2026, 3:11pm UTC](https://forums.plex.tv/t/add-items-to-a-collection-using-plex-api/939886/1 "2026-06-21T15:11:14Z")

</div>

I’m writing an c# application to create and manage Collections using the Plex API. I’ve managed to iterate and list my Plex library and Collections, but creating new Collections and adding items to existing collections give me great difficulties.

I managed to create a new Collection in an existing library, but it remains empty. The referenced item is not added to the collection.

url: https://{server url}:32400/library/collections?type=1&title={Title}&uri=server://{serverID}/com.plexapp.plugins.library/library/metadata/{movie ratingKey}&X-Plex-Token={PlexToken}&sectionId={Library ratingKey}

(Via code & directly via PostMan, using the Post command)

When I try to add an item to the newly created collection using the url below, I keep getting a Bad Request response.

url: https://{server ip}:32400/library/collections/{ratingKey of collection}/items?uri=server://{serverID}/com.plexapp.plugins.library/library/metadata/{ratingKey of movie}

Via Postman and code. PostMan, PUT and added the x-plex-token to the header. (If I leave that out I get a Unauthorized response) Also tried via POST and adding the token to the url, but that returns a not found response.

What am I overlooking? 🙂

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [June 21, 2026, 5:33pm UTC](https://forums.plex.tv/t/add-items-to-a-collection-using-plex-api/939886/2 "2026-06-21T17:33:44Z")

</div>

Simply add the medias like this, and it’s a `PUT`

```auto
<PMS_URL_WITH_PORTNUMBER>/library/sections/<LIBRARY_KEY>/all?type=1&id=<COMMA_SEPERATED_MEDIA_KEYS>&includeExternalMedia=1&collection.locked=1&collection[0].tag.tag=<COLLECTION_NAME>&X-Plex-Client-Identifier=<UNIQUE_CLIENTID_FOR_YOUR_APP>&X-Plex-Token=<YOUR_TOKEN>

```

Above url needs to be URL Encoded before you send the request, and yes, the token can be put into the header (preferred)

And in above, `type=1` means movies  
Ref: [https://developer.plex.tv/pms/#section/API-Info/Types](https://developer.plex.tv/pms/#section/API-Info/Types)

* * *

Another way is to add items to an existing collection like see here:  
[https://developer.plex.tv/pms/#tag/Library-Collections/operation/libraryCollectionCollectionPutItems](https://developer.plex.tv/pms/#tag/Library-Collections/operation/libraryCollectionCollectionPutItems)

---

<div class="post-metadata">

**Author:** ![wouter\_o](https://avatars.discourse-cdn.com/v4/letter/w/4bbf92/32.png) [@wouter\_o](https://forums.plex.tv/u/wouter_o)\
**Post date:** [June 21, 2026, 5:37pm UTC](https://forums.plex.tv/t/add-items-to-a-collection-using-plex-api/939886/3 "2026-06-21T17:37:20Z")

</div>

Apologies, this was clearly an issue that existed between keyboard & chair…

If somebody comes across this topic with similar issues, the urls I use are 100% correct. I don’t know how, but I somehow got the serverID wrong. If you go to you Plex web interface: [https://app.plex.tv/desktop/#!/media/](https://app.plex.tv/desktop/#!/media/){this long number is your serverID}/

@dane22 Thanks! Didn’t see an example with the collection[0]tag.tag added to it, will look into that one as well. Adding items indeed only work with PUT, POST returns 404 not found.

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [June 21, 2026, 5:39pm UTC](https://forums.plex.tv/t/add-items-to-a-collection-using-plex-api/939886/4 "2026-06-21T17:39:35Z")

</div>

> [@wouter\_o](#):
>
> Didn’t see an example with the collection[0]tag.tag added to it

I turned on the debugger in the webclient, and added a few movies to a new collection named `testCol`and saw that 🙂
