Skip to main content
POST
Save Document Studio Report
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

projectId
string
required
The unique identifier of the project associated with the report

Request Body

reportName
string
required
The name of the report. This serves as a unique identifier within the project scope.
content
object
required
The complete report content structure including blocks, formatting, and data

Example Request

Response

Returns the saved report information including the new version number:
reportId
string
Unique identifier of the report
version
number
Version number of the newly created version

Example Response

Block Types Reference

Title Block

Used for report titles and major headings:

Narrative Block

For rich text content with editing capabilities:

Data Block

For dynamic project data integration:

Table Block

For structured data presentation:

Section Block

For organizing content into logical sections:

List Block

For bullet points and numbered lists:

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

400
error
Bad Request - Invalid content structure or missing required fields
404
error
Not Found - Project not found or user lacks access
413
error
Payload Too Large - Report content exceeds size limits

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