Save a document studio report with rich formatting, dynamic content, and automatic version management. This endpoint creates a new version of the report each time it’s called, maintaining a complete version history.
Path Parameters
The unique identifier of the project associated with the report
Request Body
The name of the report. This serves as a unique identifier within the project scope.
The complete report content structure including blocks, formatting, and data Array of content blocks that make up the report Type of content block: “title”, “narrative”, “data”, “table”, “section”, “list”
The actual content of the block (for text-based blocks)
Block-specific properties and configuration Unique identifier for the section (used for narrative blocks)
Display title for the block
Whether this block requires content (for templates)
Font size (e.g., “16px”, “1.2em”)
Text alignment: “left”, “center”, “right”, “justify”
Text color (hex code or CSS color name)
Child blocks (for section-type blocks)
Report metadata and configuration ID of the template this report is based on
Type of report: “GENERAL”, “INITIAL”, “INTERIM”, “FINAL”
ISO timestamp of last modification
Example Request
{
"reportName" : "Q2 Progress Report" ,
"content" : {
"blocks" : [
{
"type" : "title" ,
"content" : "Quarterly Progress Report" ,
"properties" : {
"fontSize" : "24px" ,
"textAlign" : "center" ,
"color" : "#2c3e50"
}
},
{
"type" : "section" ,
"properties" : {
"title" : "Executive Summary"
},
"children" : [
{
"type" : "narrative" ,
"properties" : {
"sectionId" : "executive-summary" ,
"title" : "Project Overview" ,
"required" : true
},
"content" : "<p>The project has made significant progress during Q2 2024, with major milestones achieved in foundation work and structural development.</p>"
}
]
},
{
"type" : "data" ,
"properties" : {
"title" : "Financial Summary" ,
"dataSource" : "project.financials" ,
"format" : "currency"
}
},
{
"type" : "table" ,
"properties" : {
"title" : "Risk Assessment Summary" ,
"dataSource" : "project.riskAssessments" ,
"columns" : [
{ "key" : "category" , "title" : "Risk Category" },
{ "key" : "status" , "title" : "Current Status" },
{ "key" : "notes" , "title" : "Notes" }
]
}
},
{
"type" : "list" ,
"properties" : {
"sectionId" : "key-achievements" ,
"title" : "Key Achievements" ,
"listType" : "bullet"
},
"content" : "Foundation work completed ahead of schedule \n Steel frame installation commenced \n All safety milestones met"
}
],
"metadata" : {
"templateId" : "template-001" ,
"reportType" : "INTERIM" ,
"author" : "Project Surveyor" ,
"lastModified" : "2024-06-20T14:30:00.000Z"
}
}
}
Response
Returns the saved report information including the new version number:
Unique identifier of the report
Version number of the newly created version
Example Response
{
"reportId" : "report-12345" ,
"version" : 3
}
Block Types Reference
Title Block
Used for report titles and major headings:
{
"type" : "title" ,
"content" : "Report Title" ,
"properties" : {
"fontSize" : "24px" ,
"textAlign" : "center" ,
"color" : "#333333"
}
}
Narrative Block
For rich text content with editing capabilities:
{
"type" : "narrative" ,
"properties" : {
"sectionId" : "unique-section-id" ,
"title" : "Section Title" ,
"required" : true
},
"content" : "<p>Rich HTML content with <strong>formatting</strong></p>"
}
Data Block
For dynamic project data integration:
{
"type" : "data" ,
"properties" : {
"title" : "Project Costs" ,
"dataSource" : "project.costs.total" ,
"format" : "currency" ,
"calculation" : "sum"
}
}
Table Block
For structured data presentation:
{
"type" : "table" ,
"properties" : {
"title" : "Cost Breakdown" ,
"dataSource" : "project.facilities" ,
"columns" : [
{ "key" : "name" , "title" : "Facility" },
{ "key" : "budget" , "title" : "Budget" , "format" : "currency" },
{ "key" : "actual" , "title" : "Actual" , "format" : "currency" }
]
}
}
Section Block
For organizing content into logical sections:
{
"type" : "section" ,
"properties" : {
"title" : "Financial Analysis"
},
"children" : [
// Child blocks go here
]
}
List Block
For bullet points and numbered lists:
{
"type" : "list" ,
"properties" : {
"sectionId" : "achievements" ,
"title" : "Key Achievements" ,
"listType" : "bullet"
},
"content" : "Item 1 \n Item 2 \n Item 3"
}
Version Management
Document Studio automatically manages versions:
Auto-Increment : Each save creates a new version with incremented number
Version History : Complete history is maintained for all versions
No Overwrites : Previous versions are never lost or modified
Timestamp Tracking : Each version includes creation timestamp
User Attribution : Version changes are tracked by user
Content Validation
The system validates report content:
Block Structure : Ensures all blocks have required properties
Data References : Validates that data sources exist and are accessible
HTML Safety : Sanitizes HTML content in narrative blocks
Required Fields : Checks that required narrative sections have content
JSON Schema : Validates overall content structure against schema
Integration with Templates
Reports can be based on templates:
Template Inheritance : Reports inherit structure from templates
Custom Modifications : Template-based reports can be customized
Required Sections : Template requirements are enforced
Dynamic Content : Template placeholders are populated with project data
Error Responses
Bad Request - Invalid content structure or missing required fields{
"statusCode" : 400 ,
"message" : "Invalid block structure" ,
"error" : "Bad Request"
}
Not Found - Project not found or user lacks access{
"statusCode" : 404 ,
"message" : "Project not found" ,
"error" : "Not Found"
}
Payload Too Large - Report content exceeds size limits{
"statusCode" : 413 ,
"message" : "Report content too large" ,
"error" : "Payload Too Large"
}
Best Practices
Unique Section IDs : Use consistent, unique section IDs for narrative blocks
Structured Content : Organize content logically using section blocks
Data Integration : Leverage data blocks for dynamic project information
Regular Saves : Save frequently to maintain version history
Content Validation : Validate required sections before final save
Template Consistency : Follow template structures when applicable