write_folder

Create, rename, move and delete Library folders, and file documents, registers and projects into them with an API key.

Reference

At a glance

ActionNeedsSend
createfolders:writename, and parent or teamId
updatefolders:writefolder and what changes
filefolders:writefile, and folder
deletefolders:deletefolder and "status": "Deleted"

Name a folder by its id or its path, such as Policies/HR. Every answer is 200 with a message; folder answers carry no link.

Create a folder

bash
curl -X POST https://app.alchex.com/api/v1/tools/write_folder/create \  -H "Authorization: Bearer EXAMPLE_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "name": "Suppliers", "parent": "Policies" }'

name is up to 120 characters. Send parent to put it inside another folder. For a top-level folder, send teamId instead: the id of the team that owns it.

Change a folder

json
{ "folder": "Policies/HR", "name": "People", "parent": "", "owner": "alex@example.com" }
FieldChanges
nameIts name
parentWhere it sits. "" moves it to the top level.
teamIdMoves it, and everything in it, to another team
ownerIts owner, by name or email. "" clears it.

Send at least one change, or it is refused with 400 nothing_to_change.

File records

json
{ "folder": "Suppliers", "file": [ { "kind": "document", "id": "DOCUMENT_ID" }, { "kind": "register", "id": "REGISTER_ID" } ] }

kind is document, register or project, up to 200 records a request. Leave out folder to move them to the top level.

Delete a folder

json
{ "folder": "Old suppliers", "status": "Deleted" }

Nothing inside is deleted: its folders and records move up one level.

Refusals

AnswerWhen
400 folder_ambiguousTwo folders match the name; send the id
400 one_change_per_callThe request mixes filing, changing or deleting
404 not_foundNo folder has that id or path