---
title: "Create many folders"
method: POST
path: "/api/folders/batch"
tags: ["Folders"]
---

# Create many folders

`POST /api/folders/batch`

## Request

- Base URL: `https://api.engram.page`
- URL: `https://api.engram.page/api/folders/batch`
- Auth: HTTP bearer

Creates explicit folder markers for up to 500 folders in one transaction and returns 201 with one entry per distinct input: the `input` as sent and the `name` it was stored under. Idempotent per folder like `POST /folders`. Paths are sanitized (traversal segments and illegal characters stripped); inputs that sanitize to the root are listed in `rejected` and create nothing. More than 500 entries is rejected with 422.

## Request body

- BatchCreateFoldersRequest
  - `folders` string[], required

## Response `201`

Created

- BatchCreateFoldersResponse
  - `folders` object[], required
    - `count` integer
    - `input` string, required: The folder as sent
    - `name` string, required: The folder as stored (sanitized)
  - `rejected` string[], required: Inputs that sanitize to the vault root; nothing was created for them

## Other responses

- `422`: Invalid input or too many folders

---

[API](https://skmtc.dev/engram/apis/engram-api.md) · [All operations](https://skmtc.dev/engram/apis/engram-api/llms.txt) · [OpenAPI document](https://skmtc.dev/engram/apis/engram-api/revisions/8c4c2eec29dc?raw)
