Skip to main content
POST
Create a new folder

Overview

Create a new knowledge base folder to organize your documents. Folders help structure your AI assistant’s knowledge, making it easier to manage, update, and maintain your content. Folders can be nested to create hierarchical organizations that match your business structure.

Use Cases

  • Organize by Topic: Create folders for different product lines, services, or topics
  • Department Structure: Organize knowledge by department (Sales, Support, HR)
  • Content Type: Separate FAQs, policies, guides, and procedures
  • Nested Organization: Create parent folders with subfolders for detailed organization
  • Team Collaboration: Structure shared knowledge bases for team access
  • Version Control: Maintain different versions in separate folders

Authentication

This endpoint requires authentication using an API key. Include your API key in the request header:

Request Body

Unique Names: Folder names must be unique within your organization.

Response Structure

Returns the created folder object:

Example Requests

Create Root Folder

Create Nested Folder

Example Response

Common Use Cases

1. Create Folder Structure

2. Create Folder with Sort Order

3. Create and Use Folder Immediately

Sort Order

The sort_order field determines display order:
  • Lower numbers appear first
  • Default is 0 if not specified
  • Can be negative for priority items
  • Used for consistent UI ordering
Example:

Nested Folders

Create folder hierarchies by setting parent_folder_id:
Result: Documentation > User Guides > Getting Started

Error Responses

Important Notes

  • Unique Names: Folder names must be unique within your organization
  • UUID Parent: parent_folder_id must be a valid UUID of an existing folder
  • Icon Format: Icons are typically emoji characters (optional)
  • Sort Order: Use integers for consistent ordering
  • Auto-generated ID: Folder ID is automatically generated (UUID)

Folder Icons

Common folder icon examples:

Workflow Example

Complete workflow for organizing knowledge base:

Headers

x-api-key
string
required

API key needed to authorize the request

Body

application/json

Folder details

name
string
required

Folder name

Example:

"Product Documentation"

icon
string

Optional icon/emoji for the folder

Example:

"📚"

sort_order
number

Optional sort order (default: 0)

Example:

0

parent_folder_id
string

Optional parent folder ID for nested folders

Example:

null

Response

Folder created successfully.

id
string
Example:

"550e8400-e29b-41d4-a716-446655440000"

name
string
Example:

"Product Documentation"

icon
string
Example:

"📚"

sort_order
number
Example:

0

client_id
string
created_at
string
Example:

"2024-01-15T10:00:00.000Z"