Create Folder
POST /api/writing/folders
π Create a new folder.
Creates a new folder in the document organization hierarchy.
Args: request: Folder creation request with name, parent_id, color, icon, description service: Injected DocumentCategoriesService instance
Returns: WritingFolderResponse: Created folder with all metadata
Raises: HTTPException 400: If parent folder not found HTTPException 500: If folder creation fails
Request Body required
Section titled βRequest Body required βResponses
Section titled β Responses βSuccessful Response
Response model for a single document folder in Writing Studio.
Provides complete folder information including metadata, display properties, and document count statistics. Used by document categories/folder endpoints for folder CRUD operations and listing.
Fields:
id: Unique folder identifier (UUID string)name: Folder display name (1-100 characters)parent_id: Parent folder ID (null for root-level folders)color: Folder color in hex format (default: #6366f1 indigo)icon: Folder icon name from icon library (default: folder)description: Folder description for organization (optional)created_at: ISO 8601 timestamp of folder creationupdated_at: ISO 8601 timestamp of last modificationorder: Sort order position within parent folderdocument_count: Number of documents in this folder
Usage:
- GET /api/creative/categories/folders/{folder_id} returns this model
- POST /api/creative/categories/folders returns this model
- PUT /api/creative/categories/folders/{folder_id} returns this model
- Used in folder lists and tree structures
JSON Example:
{
"id": "folder_abc123",
"name": "Drafts",
"parentId": null,
"color": "#f59e0b",
"icon": "file-edit",
"description": "Work in progress documents",
"createdAt": "2025-12-04T10:00:00Z",
"updatedAt": "2025-12-04T10:00:00Z",
"order": 0,
"documentCount": 15
}
Integration:
- DocumentCategoriesService: Provides folder data
- Frontend FolderTree: Displays folder hierarchy
- Drag-and-drop UI: Uses order for positioning
object
Unique folder identifier
Folder display name
Folder color (hex)
Folder icon name
Folder description
Creation timestamp (ISO 8601)
Last update timestamp (ISO 8601)
Sort order position
Documents in folder
Validation Error