Skip to main content
BlueAI
Home/Documents/Folders

Folders

Create, update, list, and delete folders for organizing documents. Folders can be nested by specifying a parent_id to create hierarchical structures.

|

Endpoints

GET/api/v1/docs/foldersList folders
POST/api/v1/docs/foldersCreate a folder
GET/api/v1/docs/folders/{id}Get a folder
PATCH/api/v1/docs/folders/{id}Update a folder
DELETE/api/v1/docs/folders/{id}Delete a folder
GET/api/v1/docs/folders

List folders

Retrieve a list of folders in the organization.

Authentication requiredInclude session cookie or Bearer token

Query Parameters

NameTypeRequiredDescription
parent_id
stringOptionalFilter by parent folder ID
limit
integerOptionalNumber of items to return (default: 50, max: 200)
offset
integerOptionalNumber of items to skip

Response Fields

NameTypeRequiredDescription
Folder[]OptionalList of folders
total
integerOptionalTotal count
limit
integerOptionalNumber of items returned
offset
integerOptionalNumber of items skipped

Code Examples

curl "https://api.blueai.jp/api/v1/docs/folders" \
  -H "Cookie: better-auth.session_token=<token>"

Response Example

{
  "items": [
    {
      "id": "folder_01JQ3KABC",
      "organization_id": "org_01HZXYZ",
      "name": "Product Requirements",
      "parent_id": null,
      "created_by": "usr_01HZABC",
      "created_at": "2026-02-10T09:00:00Z",
      "updated_at": "2026-02-20T15:30:00Z"
    }
  ],
  "total": 5,
  "limit": 50,
  "offset": 0
}
POST/api/v1/docs/folders

Create a folder

Create a new folder. Specify parent_id to create a subfolder.

Authentication requiredInclude session cookie or Bearer token

Request Body

NameTypeRequiredDescription
name
stringRequiredFolder name
parentId
stringOptionalParent folder ID (omit to create at root)

Response Fields

NameTypeRequiredDescription
FolderOptionalCreated folder

Code Examples

curl -X POST "https://api.blueai.jp/api/v1/docs/folders" \
  -H "Cookie: better-auth.session_token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Design Specs",
  "parentId": "folder_01JQ3KABC"
}'

Response Example

{
  "folder": {
    "id": "folder_02JQ3KDEF",
    "organization_id": "org_01HZXYZ",
    "name": "Design Specs",
    "parent_id": "folder_01JQ3KABC",
    "created_by": "usr_01HZABC",
    "created_at": "2026-02-10T09:00:00Z",
    "updated_at": "2026-02-20T15:30:00Z"
  }
}
GET/api/v1/docs/folders/{id}

Get a folder

Retrieve details of the specified folder.

Authentication requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringOptionalFolder ID

Response Fields

NameTypeRequiredDescription
FolderOptionalFolder

Code Examples

curl "https://api.blueai.jp/api/v1/docs/folders/folder_123e4567e89b12d3a456426614174000" \
  -H "Cookie: better-auth.session_token=<token>"

Response Example

{
  "folder": {
    "id": "folder_01JQ3KABC",
    "organization_id": "org_01HZXYZ",
    "name": "Product Requirements",
    "parent_id": null,
    "created_by": "usr_01HZABC",
    "created_at": "2026-02-10T09:00:00Z",
    "updated_at": "2026-02-20T15:30:00Z"
  }
}
PATCH/api/v1/docs/folders/{id}

Update a folder

Update the folder name or parent folder.

Authentication requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringOptionalFolder ID

Request Body

NameTypeRequiredDescription
name
stringOptionalFolder name
parentId
string | nullOptionalParent folder ID (null to move to root)

Response Fields

NameTypeRequiredDescription
FolderOptionalUpdated folder

Code Examples

curl -X PATCH "https://api.blueai.jp/api/v1/docs/folders/folder_123e4567e89b12d3a456426614174000" \
  -H "Cookie: better-auth.session_token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Product Requirements (Updated)"
}'

Response Example

{
  "folder": {
    "id": "folder_01JQ3KABC",
    "organization_id": "org_01HZXYZ",
    "name": "Product Requirements (Updated)",
    "parent_id": null,
    "created_by": "usr_01HZABC",
    "created_at": "2026-02-10T09:00:00Z",
    "updated_at": "2026-02-20T15:30:00Z"
  }
}
DELETE/api/v1/docs/folders/{id}

Delete a folder

Delete the specified folder. Documents inside the folder are moved to root.

Authentication requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringOptionalFolder ID

Response Fields

NameTypeRequiredDescription
success
booleanOptionalDeletion success flag

Code Examples

curl -X DELETE "https://api.blueai.jp/api/v1/docs/folders/folder_123e4567e89b12d3a456426614174000" \
  -H "Cookie: better-auth.session_token=<token>"

Response Example

{
  "success": true
}