# How to create a new playlist using API

**URL:** <https://community.info-beamer.com/t/how-to-create-a-new-playlist-using-api/1215>\
**Category:** Help\
**Created:** [May 29, 2023, 9:57am UTC](https://community.info-beamer.com/t/how-to-create-a-new-playlist-using-api/1215 "2023-05-29T09:57:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharma.arpit956](https://community.info-beamer.com/user_avatar/community.info-beamer.com/sharma.arpit956/32/701_2.png) [@sharma.arpit956](https://community.info-beamer.com/u/sharma.arpit956)\
**Post date:** [May 29, 2023, 9:57am UTC](https://community.info-beamer.com/t/how-to-create-a-new-playlist-using-api/1215/1 "2023-05-29T09:57:03Z")

</div>

I am able to get all playlist assets, but when creating or renaming a playlist,

I get the error response,

{“error”:“Name missing or empty”},

though I am using the request as mentioned in the API documentation, [info-beamer.com hosted API - info-beamer](https://info-beamer.com/doc/api), and have given all the permissions.

I am using the code

headers = {  
“Authorization”: “Bearer xxx3b6f68fbbf83dcfc2cbde8fxxxxxx”,  
“Content-Type”: “application/json”  
}

response = requests.request(  
method=‘POST’,  
url=‘[https://info-beamer.com/api/v1/playlist/create](https://info-beamer.com/api/v1/playlist/create)’,  
json={‘name’: “my\_playlist”},  
headers=headers  
)

Kindly help as my whole project depends on it.

Regards  
Arpit

---

<div class="post-metadata">

**Author:** ![infobeamer-fw](https://community.info-beamer.com/user_avatar/community.info-beamer.com/infobeamer-fw/32/3_2.png) [@infobeamer-fw](https://community.info-beamer.com/u/infobeamer-fw)\
**Post date:** [May 29, 2023, 10:06am UTC](https://community.info-beamer.com/t/how-to-create-a-new-playlist-using-api/1215/2 "2023-05-29T10:06:24Z")

</div>

info-beamer API expects the values as `application/x-www-form-urlencoded`, not `application/json`. So you need to send the value as `name=my_playlist`. Or in case of python the following should work:

```auto
r = requests.post(
    'https://info-beamer.com/api/v1/playlist/create',
    headers=headers,
    data={'name': 'foo'}
)
```

---

<div class="post-metadata">

**Author:** ![sharma.arpit956](https://community.info-beamer.com/user_avatar/community.info-beamer.com/sharma.arpit956/32/701_2.png) [@sharma.arpit956](https://community.info-beamer.com/u/sharma.arpit956)\
**Post date:** [May 29, 2023, 10:18am UTC](https://community.info-beamer.com/t/how-to-create-a-new-playlist-using-api/1215/3 "2023-05-29T10:18:46Z")

</div>

I worked, thank you so much. 👌 👍
