Skip to content

Create and Manage Folders

Terminal window
https://mapi.storyblok.com/v1/spaces/:space_id/stories

Use the Story endpoint to create and manage content folders.

You can use a small subset of properties from the Story Object to push new folders into your space or modify their configurations:

  • Use name and slug to identify the folder.
  • Always pass true to the is_folder in the Request Body.
  • Use parent_id to determine where the folder should be created.
  • You can also update existent folders to accept only specific content types.

Check the request examples in this section.

  • :space_id required number

    Numeric ID of a space

Create a new folder within your Space.

curl "https://mapi.storyblok.com/v1/spaces/606/stories" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"story\":{\"is_folder\":true,\"name\":\"A new folder\",\"parent_id\":0,\"slug\":\"a-new-folder\"}}"

Create a folder to accept only a certain content type using the default_root property.

curl "https://mapi.storyblok.com/v1/spaces/606/stories" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "\"{\n story: {\n default_root: \\"article\\",\n is_folder: true,\n name: \\"A new folder\\",\n parent_id: 0,\n slug: \\"a-new-folder\\",\n },\n}\""

Update a folder with strict content types.

curl "https://mapi.storyblok.com/v1/spaces/606/stories" \
-X PUT \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"story\":{\"content\":{\"content_types\":[\"category\"],\"lock_subfolders_content_types\":false},\"is_folder\":true,\"name\":\"Categories\",\"parent_id\":0,\"slug\":\"categories\"}}"