POST /api/folders
Create a folder in the workspace the request names: {name, parent_id?} (type is ignored). Names are trimmed, 1-80 characters, unique among siblings ignoring case across kinds (409 folder_name_taken); folders nest 3 levels deep (400 folder_too_deep). In a team it needs the Editor role (403 workspace_role_required). Answers 201 with the Folder.
Personal access token scope: agents:write or prompts:write or sources:write or tools:write.
bearerAuthorizationBearer <token>A session token or a personal access token. Leave it empty when the instance runs without authentication (AUTH_TYPE unset).
application/json- body
name*stringFolder name
parent_id?stringParent folder id
type?stringIgnored: a folder holds every kind
The new folder
application/json- response
counts?{agent, source, tool, prompt}: items filed directly in it the caller can see
created_at?stringISO timestamp
created_by?{user_id, label} of the person who made it, or null
folder_count?integerFolders directly in it
id?stringFolder id
item_count?integerItems of the requested type filed directly in it (all kinds without)
name?stringFolder name
parent_id?stringParent folder id; null at the top level
type?stringThe kind the request named (agent when none); folders hold every kind
updated_at?stringISO timestamp
used_by?{agents: [{id, name, agent_type, can_edit, status}], others}: who reads its sources live
curl -X POST 'http://localhost:7091/api/folders' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "counts": {}, "created_at": "string", "created_by": {}, "folder_count": 0, "id": "string", "item_count": 0, "name": "string", "parent_id": "string", "type": "string", "updated_at": "string", "used_by": {}}POST /api/folders/items POST
File items into a folder: {type, folder_id, ids}; folder_id null takes them out of the tree of the workspace the request names. A team's folder holds only the team's own items and needs the Editor role (403 workspace_role_required); a personal folder holds the caller's own items and personal items shared with them. 409 team_item_not_fileable (a team's item into a personal folder) or item_not_in_team (anything else into a team's folder), with ids; nothing is filed then. Answers {success, moved: [ids], skipped: [ids the caller can't see]}. [Personal access token](/API/personal-access-tokens) scope: `agents:write` or `prompts:write` or `sources:write` or `tools:write`.
PUT /api/folders/{folder_id} PUT
Rename or move a folder within its tree: {name?, parent_id?}; parent_id null moves it to the top level. The folder's own tree decides (a team's folder needs the Editor role there). Errors: 404 folder_not_found, 403 workspace_role_required, 400 folder_cycle / folder_too_deep, 409 folder_name_taken. [Personal access token](/API/personal-access-tokens) scope: `agents:write` or `prompts:write` or `sources:write` or `tools:write`.