# New library from API

**URL:** <https://forums.plex.tv/t/new-library-from-api/306750>\
**Category:** Apps & Creations\
**Tags:** server-linux, library-management\
**Created:** [September 10, 2018, 10:36am UTC](https://forums.plex.tv/t/new-library-from-api/306750 "2018-09-10T10:36:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Szajkop](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Szajkop](https://forums.plex.tv/u/Szajkop)\
**Post date:** [September 10, 2018, 10:36am UTC](https://forums.plex.tv/t/new-library-from-api/306750/1 "2018-09-10T10:36:06Z")

</div>

Server Version#: 1.13.5.5332  
I am developing a small PHP app for library management.  
The api reference, i try to implement is found here: [link](https://docs.google.com/document/d/19bTQr99oKn2pOpHcVtqidokbq9zup-K-mFy8JmII6uQ/edit)  
The goal is to add a new libary from my app. So far i managed to build a request that is almost working:  
[http://localhost:32400/library/sections?X-Plex-Token=removed&name=testlib&type=movie&agent=com.plexapp.agents.themoviedb&language=en&scanner=Plex+Movie+Scanner&location=%2Fmedia%2FVolume\_2%2FMovies](http://localhost:32400/library/sections?X-Plex-Token=removed&name=testlib&type=movie&agent=com.plexapp.agents.themoviedb&language=en&scanner=Plex+Movie+Scanner&location=%252Fmedia%252FVolume_2%252FMovies)

The error is the following:  
[0x7f7322ff9700] DEBUG - Request: [127.0.0.1:48552 (Loopback)] POST /library/sections (6 live) GZIP Signed-in Token  
[0x7f7322ff9700] ERROR - Library: Couldn’t create section: ‘location’ is missing or invalid.  
[0x7f7333ffe700] DEBUG - Completed: [127.0.0.1:48552] 400 POST /library/sections (6 live) GZIP 1ms 333 bytes (pipelined: 1)

Note: The path is exists, plex has access to it and properly formatted by php’s urlencoder (i checked other GET based listing requests and they are working OK)

What am i missing?  
Thank you for helping

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 9, 2018, 10:36am UTC](https://forums.plex.tv/t/new-library-from-api/306750/2 "2018-12-09T10:36:07Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
