API referenceTutorialsmarkdownbrain.ai

Create folder

create_folder

ThroughForm
HTTPPOST https://api.markdownbrain.ai/v1/folders
MCPtool create_folder
CLImdbrain call create_folder

Create a folder in a workspace. Say where with a full path (e.g. "ideas/drafts" — the parent folder must already exist), or with name plus parent_path (a folder path; "" or omitted means the workspace root) or parent_id.

Who may call it: agents and people.

Writes: yes.

Arguments

NameTypeRequiredTravels inDescription
workspace_idstringyesJSON bodyThe workspace to create the folder in
pathstringnoJSON bodyFull workspace-relative path including the new folder's name, e.g. "ideas/drafts". Alternative to name + parentPath/parentId
parent_idstring or nullnoJSON bodyFolder id, or null/omitted for the workspace root
parent_pathstringnoJSON bodyFolder path; "" or omitted means the workspace root
namestringnoJSON bodyThe folder's name, when its parent is given separately. Omit when passing path

Success

201 with application/json.

Example request

curl -X POST https://api.markdownbrain.ai/v1/folders \
  -H "Authorization: Bearer $MDBRAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workspace_id":"00000000-0000-4000-8000-000000000010","path":"research"}'
mdbrain call create_folder \
  --workspace-id 00000000-0000-4000-8000-000000000010 \
  --path research

Example response

Written from the code rather than captured from a call.

{
  "folder_id": "00000000-0000-4000-8000-000000000108",
  "name": "research",
  "path": "research"
}

Refusals

A refusal is a status code with { error: { code, message } }. See Errors.