Skip to content

Export Book

POST
/api/writing/outline/export

Export the full outline as a compiled book document.

project_id
required
Project Id
string
>= 1 characters
OutlineExportRequest

Export an outline as a compiled book.

object
format
Format
string
default: docx
Allowed values: pdf docx md markdown html txt text
includeToc
Includetoc
boolean
default: true
includeSummaries
Includesummaries
boolean
author
Any of:
string

Successful Response

DocumentExportResponse

Document export API response model.

Provides confirmation and file information for document export operations including export status, document identification, output format, file path, and export timestamp. Used for multi-format document export with metadata preservation.

Fields:

  • status: Export operation status (“success” or “error”)
  • document_id: Unique identifier of exported document
  • format: Export format identifier (“docx”, “pdf”, “txt”, “md”)
  • export_path: Filesystem path to exported file
  • timestamp: ISO 8601 timestamp of export operation

Supported Formats:

  • "docx": Microsoft Word document format (default)
  • "pdf": Portable Document Format
  • "txt": Plain text format
  • "md": Markdown format

Export Features:

  • Format conversion with metadata preservation
  • Structure and formatting retention
  • Custom export options (future)
  • Batch export support (future)
  • Template-based export (future)

Usage: POST /api/creative/export/document returns this response model.

JSON Example (Success):

{
  "status": "success",
  "documentId": "doc_abc123",
  "format": "docx",
  "exportPath": "/exports/doc_abc123.docx",
  "timestamp": "2025-01-31T10:30:00Z"
}

JSON Example (PDF Export):

{
  "status": "success",
  "documentId": "doc_abc123",
  "format": "pdf",
  "exportPath": "/exports/doc_abc123.pdf",
  "timestamp": "2025-01-31T10:30:00Z"
}

Integration:

  • ImportExportService: Performs document export with format conversion
  • File System: Writes exported file to specified path
  • Frontend UI: Provides download link and export confirmation
  • Publishing Workflows: Enables document publishing and sharing
object
status
required
Status

Export status

string
documentId
required
Documentid

Document ID that was exported

string
format
required
Format

Export format

string
exportPath
required
Exportpath

Filesystem path to exported file

string
timestamp
required
Timestamp

Export timestamp (ISO format)

string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object