Skip to content

Create many folders

POST
/folders/batch
curl --request POST \
--url https://api.engram.page/folders/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "folders": [ "Projects/Engram", "Archive" ] }'

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.

Folder paths

Media typeapplication/json
BatchCreateFoldersRequest
object
folders
required
Array<string>
<= 500 items

Example

{
"folders": [
"Projects/Engram",
"Archive"
]
}

Created

Media typeapplication/json
BatchCreateFoldersResponse
object
folders
required
Array<object>
object
count
integer
input
required

The folder as sent

string
name
required

The folder as stored (sanitized)

string
rejected
required

Inputs that sanitize to the vault root; nothing was created for them

Array<string>

Example generated

{
"folders": [
{
"count": 1,
"input": "example",
"name": "example"
}
],
"rejected": [
"example"
]
}

Invalid input or too many folders

Media typeapplication/json
Error
object
errors
One of:
string

Example generated

{
"errors": {}
}