Create many folders
POST
/folders/batch
const url = 'https://api.engram.page/folders/batch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"folders":["Projects/Engram","Archive"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Folder paths
Media typeapplication/json
BatchCreateFoldersRequest
object
folders
required
Array<string>
Example
{ "folders": [ "Projects/Engram", "Archive" ]}Responses
Section titled “Responses”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