POST /api/folders/items
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 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
folder_id?stringTarget folder id, or null to unfile
ids*array<string>Ids of items of that kind
type*stringagent, source, tool or prompt
Success
curl -X POST 'http://localhost:7091/api/folders/items' \ -H 'Content-Type: application/json' \ -d '{ "ids": [ "string" ], "type": "string"}'GET /api/folders GET
The folder tree of the workspace the request names (header X-DocsGPT-Workspace, default Personal), oldest first: {folders: [Folder], workspace}. In a team it is the team's one tree, the same for every member. counts, item_count and folder_count count direct children; used_by names the agents reading a folder's sources live. 404 workspace_not_found for a team the caller isn't in. [Personal access token](/API/personal-access-tokens) scope: `agents:read` or `prompts:read` or `sources:read` or `tools:read`.
POST /api/folders POST
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](/API/personal-access-tokens) scope: `agents:write` or `prompts:write` or `sources:write` or `tools:write`.