Create Writing Document
POST /api/writing/documents
POST
/api/writing/documents
📝 Create a new writing document
Creates a new document in the writing module with full metadata support. Automatically generates unique ID, calculates word count, and stores in ChromaDB for semantic search. Supports custom fields and tagging.
Form Parameters:
title: Document title (required)content: Document content (required)document_type: Type of document (default: “general”)tags: Comma-separated tags (optional)custom_fields: JSON string of custom metadata fields (optional)
Dependencies:
writing_service: Injected IshvanaWritingModule instance
Returns:
message: Success confirmation messagedocument_id: Generated document ID for reference
Raises:
HTTPException 500: If document creation fails
Example Response:
{
"message": "Document created successfully",
"document_id": "doc_1703001234.567"
}Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Successful Response
Response Create Writing Document Api Writing Documents Post
object
key
additional properties
string
Validation Error
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context