Skip to Content
Docs

POST /api/folders

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.

Authorization

bearer
headerAuthorizationBearer <token>

A session token or a personal access token. Leave it empty when the instance runs without authentication (AUTH_TYPE unset).

Request Body

application/json
  1. body
name*string

Folder name

parent_id?string

Parent folder id

type?string

Ignored: a folder holds every kind

Response Body

The new folder

application/json
  1. response
counts?

{agent, source, tool, prompt}: items filed directly in it the caller can see

created_at?string

ISO timestamp

created_by?

{user_id, label} of the person who made it, or null

folder_count?integer

Folders directly in it

id?string

Folder id

item_count?integer

Items of the requested type filed directly in it (all kinds without)

name?string

Folder name

parent_id?string

Parent folder id; null at the top level

type?string

The kind the request named (agent when none); folders hold every kind

updated_at?string

ISO timestamp

used_by?

{agents: [{id, name, agent_type, can_edit, status}], others}: who reads its sources live

Example Request
curl -X POST 'http://localhost:7091/api/folders' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response201
{  "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": {}}