# Trying to create subfolders in a project via Python

**URL:** <https://forum.frame.io/t/trying-to-create-subfolders-in-a-project-via-python/2460>\
**Category:** Help\
**Tags:** python, api\
**Created:** [May 1, 2025, 6:50am UTC](https://forum.frame.io/t/trying-to-create-subfolders-in-a-project-via-python/2460 "2025-05-01T06:50:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peek](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Peek](https://forum.frame.io/u/Peek)\
**Post date:** [May 1, 2025, 6:50am UTC](https://forum.frame.io/t/trying-to-create-subfolders-in-a-project-via-python/2460/1 "2025-05-01T06:50:27Z")

</div>

Hi there,

I created a new developer token with all permissions and when I try to create a subfolder via Python I get the following error:  
Details: {“code”:403,“message”:“Forbidden”,“errors”:[{“code”:403,“status”:403,“title”:“Forbidden”,“detail”:“You do not have permission to access that resource”}]}

Even though my token has all permissions, can you tell me why?

Python code extract:

```auto
def createFolder(name, parent_id):

        folderInfo = {
            "name": name,
            "type": "folder",
            "parent_id": parent_id
        }

        response = requests.post(
            "https://api.frame.io/v2/assets",
            headers=headers,
            json = folderInfo
        )

        if response.status_code in [200,201]:
            return response.json()["id"]
        else:
            print(f"Failed to create folder '{name}':", response.status_code)
            print("Details:", response.text)
            return None
    
    subFolder1_id = createFolder(
        "Subfolder", 
        root_asset_id
        )

```

I suspect maybe the post url is incorrect but I can’t get any further at the moment.

Cheers,  
Peek

---

<div class="post-metadata">

**Author:** ![Peek](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Peek](https://forum.frame.io/u/Peek)\
**Post date:** [May 2, 2025, 9:06am UTC](https://forum.frame.io/t/trying-to-create-subfolders-in-a-project-via-python/2460/2 "2025-05-02T09:06:04Z")

</div>

I figured it out after some experimenting, it turns out my submission URL needed some tweaking:  
“f"[https://api.frame.io/v2/assets/{parent\_id}/children](https://api.frame.io/v2/assets/%7Bparent_id%7D/children)”"

That one properly creates subfolders and nested folders.

---

<div class="post-metadata">

**Author:** ![jhodges](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.frame.io/jhodges/32/3_2.png) [@jhodges](https://forum.frame.io/u/jhodges)\
**Post date:** [May 2, 2025, 10:26pm UTC](https://forum.frame.io/t/trying-to-create-subfolders-in-a-project-via-python/2460/3 "2025-05-02T22:26:46Z")

</div>

Glad you were able to figure it out!

Let us know if you have more questions.
