Download OpenAPI specification:Download
Public API for PlanOps construction project management
File Uploads
Upload files to the system with presigned URLs.
Upload Flow:
Documentation Export
Export app-wide agents and tasks for documentation generation.
This API provides structured data about all agents and their app-wide tasks in formats suitable for documentation systems. The export excludes organization and project-specific tasks.
Features:
Use Cases:
Export all agents and their app-wide tasks in a documentation-friendly format.
This endpoint returns structured data about all agents and their tasks that are defined at the app level (not organization or project specific). The data is suitable for generating user documentation, API references, or integration with documentation systems.
Scope:
organization_id and project_id are both nullUse Cases:
Response Format: The response includes:
metadata: Export timestamp, counts, and version infoagents: List of agents with their tasks, input/output schemas, and workflowsCaching: The response includes cache headers. Documentation typically doesn't change frequently, so clients can cache this response for several minutes.
X-Api-Key (string) or X-Api-Key (null) (X-Api-Key) |
{- "metadata": {
- "exported_at": "2024-01-15T10:30:00Z",
- "api_version": "1.0.0",
- "total_agents": 5,
- "total_tasks": 25,
- "scope": "app-wide"
}, - "agents": [
- {
- "id": "507f1f77bcf86cd799439011",
- "title": "Document Analyst",
- "description": "Analyzes construction documents",
- "type": "STRUCTURED",
- "tasks": [
- {
- "task_id": "analyze_document",
- "name": "Analyze Document",
- "description": "Extracts key information"
}
]
}
]
}Export all agents and their app-wide tasks in a documentation-friendly format.
This endpoint returns structured data about all agents and their tasks that are defined at the app level (not organization or project specific). The data is suitable for generating user documentation, API references, or integration with documentation systems.
Scope:
organization_id and project_id are both nullUse Cases:
Response Format: The response includes:
metadata: Export timestamp, counts, and version infoagents: List of agents with their tasks, input/output schemas, and workflowsCaching: The response includes cache headers. Documentation typically doesn't change frequently, so clients can cache this response for several minutes.
X-Api-Key (string) or X-Api-Key (null) (X-Api-Key) |
{- "metadata": {
- "exported_at": "2024-01-15T10:30:00Z",
- "api_version": "1.0.0",
- "total_agents": 5,
- "total_tasks": 25,
- "scope": "app-wide"
}, - "agents": [
- {
- "id": "507f1f77bcf86cd799439011",
- "title": "Document Analyst",
- "description": "Analyzes construction documents",
- "type": "STRUCTURED",
- "tasks": [
- {
- "task_id": "analyze_document",
- "name": "Analyze Document",
- "description": "Extracts key information"
}
]
}
]
}Export all agents and their app-wide tasks in YAML format.
This is the same data as the JSON endpoint but formatted as YAML for direct use in documentation repositories or configuration files.
The YAML output is human-readable and can be directly committed to documentation repositories like planops-docs.
| indent | integer (Indent) [ 1 .. 8 ] Default: 2 YAML indentation level |
X-Api-Key (string) or X-Api-Key (null) (X-Api-Key) |
nullExport all agents and their app-wide tasks in YAML format.
This is the same data as the JSON endpoint but formatted as YAML for direct use in documentation repositories or configuration files.
The YAML output is human-readable and can be directly committed to documentation repositories like planops-docs.
| indent | integer (Indent) [ 1 .. 8 ] Default: 2 YAML indentation level |
X-Api-Key (string) or X-Api-Key (null) (X-Api-Key) |
nullExport a specific agent and its app-wide tasks for documentation.
Use this endpoint when you only need documentation for a single agent, such as when generating agent-specific help pages.
| agent_id required | string (Agent Id) |
X-Api-Key (string) or X-Api-Key (null) (X-Api-Key) |
{ }Export a specific agent and its app-wide tasks for documentation.
Use this endpoint when you only need documentation for a single agent, such as when generating agent-specific help pages.
| agent_id required | string (Agent Id) |
X-Api-Key (string) or X-Api-Key (null) (X-Api-Key) |
{ }Document Management
Manage construction documents including drawings, specifications, contracts, and other project files.
Features:
Create a new document.
document: Document data to create
db: MongoDB client instance
current_user: Current authenticated user
Created document
HTTPException: If project or organization not found, or user not authorized
| document_id required | string (Document Id) Document ID |
Title (string) or Title (null) (Title) Document title | |
Document Reference (string) or Document Reference (null) (Document Reference) Document reference or drawing number | |
Description (string) or Description (null) (Description) Document description | |
DocumentStatus (string) or null Document status | |
Revision (string) or Revision (null) (Revision) Document revision | |
Category (string) or Category (null) (Category) Document category | |
DocumentType (string) or null Type of document | |
Content (string) or Content (null) (Content) Extracted text content from document | |
Summary (string) or Summary (null) (Summary) Summary of document | |
Purpose (string) or Purpose (null) (Purpose) Purpose of document | |
Array of Keywords (strings) or Keywords (null) (Keywords) Default: [] Keywords associated with document | |
File Path (string) or File Path (null) (File Path) Path to stored document | |
File Size (integer) or File Size (null) (File Size) Size of document in bytes | |
Mime Type (string) or Mime Type (null) (Mime Type) MIME type of document | |
| created_at | string <date-time> (Created At) Creation timestamp |
| updated_at | string <date-time> (Updated At) Last update timestamp |
Array of objects (Version History) Version history of document | |
Thumbnail Image Path (string) or Thumbnail Image Path (null) (Thumbnail Image Path) Path to thumbnail image | |
Full Image Path (string) or Full Image Path (null) (Full Image Path) Path to full image | |
Error (string) or Error (null) (Error) Error message if document processing failed | |
Error Detail (object) or Error Detail (null) (Error Detail) Error details | |
| filename required | string (Filename) Filename of document |
| r2_path required | string (R2 Path) Path to stored document in R2 |
File Extension (string) or File Extension (null) (File Extension) File extension without dot (e.g., 'pdf') | |
FileHandlingTier (string) or null Processing tier for this file type | |
Drawing Comparison Id (string) or Drawing Comparison Id (null) (Drawing Comparison Id) ID of the drawing comparison record, if this document was compared to a previous version | |
Virtual Document Id (string) or Virtual Document Id (null) (Virtual Document Id) Reference to the source virtual document if auto-generated from export | |
Virtual Document Version (integer) or Virtual Document Version (null) (Virtual Document Version) Version number of the virtual document if auto-generated from export | |
| auto_generated | boolean (Auto Generated) Default: false Flag indicating this document was auto-created from a virtual document export |
| project_id required | string (Project Id) ID of project this document belongs to |
Organization Id (string) or Organization Id (null) (Organization Id) ID of organization that generated the document | |
| processing_status required | string (DocumentProcessingStatus) Enum: "PENDING" "QUEUED" "PROCESSING" "PROCESSED" "FAILED" "DUPLICATE" "PENDING_PROCESSING" "UPLOADED" "ACCEPTED" Status of document processing |
required | object (AssigneeUser) User who uploaded the document |
{- "document_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ],
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "version_history": [
- {
- "version_id": "string",
- "version_number": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "content": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "drawing_comparison_id": "string",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "project_id": "string",
- "organization_id": "string",
- "processing_status": "PENDING",
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "filename": "string",
- "processing_status": "PENDING",
- "status": "draft",
- "r2_path": "string",
- "chunks_count": 0,
- "full_image_path": "string",
- "thumbnail_image_path": "string",
- "error": "string",
- "error_detail": { },
- "metadata": {
- "document_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ]
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "title": "string",
- "project_id": "string",
- "organization_id": "string",
- "document_reference": "string",
- "description": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "drawing_comparison_id": "string"
}Get all documents with optional filtering and pagination.
project_id: Project ID filter
organization_id: Optional organization ID filter
document_type: Filter by document type (comma-separated for multiple)
page: Page number (1-based)
size: Number of items per page
created_at_start: Optional inclusive lower bound for created_at
created_at_end: Optional inclusive upper bound for created_at
sort_by: Field to sort by
sort_order: Sort order (asc/desc)
processing_status: Optional processing status filter
exclude_processing_status: Exclude processing statuses (comma-separated for multiple)
is_deleted: Filter by deletion status (default False)
include_images: Include images in the response
image_expiration: Image expiration time in seconds
db: MongoDB client instance
Paginated response containing documents and pagination metadata
HTTPException: If database operation fails
| project_id required | string (Project Id) Project ID |
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID | |
Document Type (string) or Document Type (null) (Document Type) Filter by document type (comma-separated for multiple, e.g., 'DRAWING,SCHEDULE'). | |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
Created At Start (string) or Created At Start (null) (Created At Start) Return documents created on or after this datetime | |
Created At End (string) or Created At End (null) (Created At End) Return documents created on or before this datetime | |
Sort By (string) or Sort By (null) (Sort By) | |
Sort Order (string) or Sort Order (null) (Sort Order) | |
Processing Status (string) or Processing Status (null) (Processing Status) Processing status filter (comma-separated for multiple, e.g., 'completed,failed') | |
Exclude Processing Status (string) or Exclude Processing Status (null) (Exclude Processing Status) Exclude processing statuses (comma-separated for multiple, e.g., 'queued,processing') | |
| is_deleted | boolean (Is Deleted) Default: false Filter by deletion status |
| include_images | boolean (Include Images) Default: true Include images in the response |
| image_expiration | integer (Image Expiration) Default: 3600 Image expiration time in seconds |
{- "items": [
- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "filename": "string",
- "processing_status": "PENDING",
- "status": "draft",
- "r2_path": "string",
- "chunks_count": 0,
- "full_image_path": "string",
- "thumbnail_image_path": "string",
- "error": "string",
- "error_detail": { },
- "metadata": {
- "document_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ]
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "title": "string",
- "project_id": "string",
- "organization_id": "string",
- "document_reference": "string",
- "description": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "drawing_comparison_id": "string"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Search documents with comprehensive filtering and text search.
query: Text search query (searches in title, description, and document_reference)
project_id: Filter by project ID
organization_id: Filter by organization ID
document_type: Filter by document type
status: Filter by document status
category: Filter by document category
uploaded_by: Filter by user who uploaded the document
start_date: Filter by upload date range start
end_date: Filter by upload date range end
sort_by: Field to sort by (default: uploaded_at)
sort_order: Sort order (asc or desc, default: desc)
include_content: Whether to include document content in search (when available)
skip: Number of records to skip
limit: Maximum number of records to return
db: MongoDB client instance
List of documents matching the search criteria
HTTPException: If database operation fails
Query (string) or Query (null) (Query) | |
Project Id (string) or Project Id (null) (Project Id) | |
Organization Id (string) or Organization Id (null) (Organization Id) | |
Document Type (string) or Document Type (null) (Document Type) | |
Status (string) or Status (null) (Status) | |
Category (string) or Category (null) (Category) | |
Uploaded By (string) or Uploaded By (null) (Uploaded By) | |
Start Date (string) or Start Date (null) (Start Date) | |
End Date (string) or End Date (null) (End Date) | |
Sort By (string) or Sort By (null) (Sort By) Default: "uploaded_at" | |
Sort Order (string) or Sort Order (null) (Sort Order) Default: "desc" | |
| include_content | boolean (Include Content) Default: false |
| skip | integer (Skip) >= 0 Default: 0 |
| limit | integer (Limit) [ 1 .. 100 ] Default: 10 |
[- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "filename": "string",
- "processing_status": "PENDING",
- "status": "draft",
- "r2_path": "string",
- "chunks_count": 0,
- "full_image_path": "string",
- "thumbnail_image_path": "string",
- "error": "string",
- "error_detail": { },
- "metadata": {
- "document_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ]
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "title": "string",
- "project_id": "string",
- "organization_id": "string",
- "document_reference": "string",
- "description": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "drawing_comparison_id": "string"
}
]Get multiple documents by their IDs in a single request.
ids: Comma-separated list of document IDs to fetch
db: MongoDB client instance
List of documents matching the provided IDs
| ids required | string (Ids) Comma-separated document IDs |
[- {
- "document_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ],
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "version_history": [
- {
- "version_id": "string",
- "version_number": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "content": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "drawing_comparison_id": "string",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "last_modified": "2019-08-24T14:15:22Z",
- "task_ids": [
- "string"
], - "related_queries": [
- "string"
]
}
]Get a specific document.
document_id: ID of document to retrieve
db: MongoDB client instance
current_user: Current authenticated user
Document
HTTPException: If document not found
| document_id required | string (Document Id) |
{- "document_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ],
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "version_history": [
- {
- "version_id": "string",
- "version_number": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "content": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "drawing_comparison_id": "string",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "last_modified": "2019-08-24T14:15:22Z",
- "task_ids": [
- "string"
], - "related_queries": [
- "string"
]
}Update a document.
document_id: ID of document to update
document_update: Document update data
db: MongoDB client instance
current_user: Current authenticated user
Updated document
HTTPException: If document not found or update fails
| document_id required | string (Document Id) |
Title (string) or Title (null) (Title) | |
Document Reference (string) or Document Reference (null) (Document Reference) | |
Description (string) or Description (null) (Description) | |
Status (string) or Status (null) (Status) | |
Revision (string) or Revision (null) (Revision) | |
Category (string) or Category (null) (Category) | |
DocumentType (string) or null | |
Content (string) or Content (null) (Content) | |
Summary (string) or Summary (null) (Summary) | |
Purpose (string) or Purpose (null) (Purpose) | |
Array of Keywords (strings) or Keywords (null) (Keywords) | |
DocumentProcessingStatus (string) or null |
{- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "string",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [
- "string"
], - "processing_status": "PENDING"
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "filename": "string",
- "processing_status": "PENDING",
- "status": "draft",
- "r2_path": "string",
- "chunks_count": 0,
- "full_image_path": "string",
- "thumbnail_image_path": "string",
- "error": "string",
- "error_detail": { },
- "metadata": {
- "document_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ]
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}
}Delete a document.
document_id: ID of document to delete
db: MongoDB client instance
current_user: Current authenticated user
Success message
HTTPException: If document not found or delete fails
| document_id required | string (Document Id) |
{- "property1": "string",
- "property2": "string"
}Generate a temporary download link for a document.
document_id: ID of document to generate link for
db: MongoDB client instance
Dictionary containing download link and expiration time
HTTPException: If document not found or link generation fails
| document_id required | string (Document Id) |
{- "property1": "string",
- "property2": "string"
}Generate temporary download links for multiple documents.
request: Batch download request containing document IDs and expiration time
db: MongoDB client instance
BatchDownloadResponse containing download URLs and expiration time
HTTPException: If any document is not found or link generation fails
| document_ids required | Array of strings (Document Ids) List of document IDs to download |
| expiration | integer (Expiration) [ 300 .. 86400 ] Default: 3600 URL expiration time in seconds (5 minutes to 24 hours) |
{- "document_ids": [
- "string"
], - "expiration": 3600
}{- "downloads": [
- {
- "property1": "string",
- "property2": "string"
}
], - "expires_at": "2019-08-24T14:15:22Z"
}Update document content.
document_id: ID of document to update
content: New document content
db: MongoDB client instance
current_user: Current authenticated user
Updated document
HTTPException: If document not found or update fails
| document_id required | string (Document Id) |
| content required | string (Content) |
{- "document_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ],
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "version_history": [
- {
- "version_id": "string",
- "version_number": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "content": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "drawing_comparison_id": "string",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "last_modified": "2019-08-24T14:15:22Z",
- "task_ids": [
- "string"
], - "related_queries": [
- "string"
]
}Get drawing comparison information by ID.
drawing_comparison_id: ID of the drawing comparison to retrieve
db: MongoDB client instance
DrawingComparisonResponse containing the comparison information
HTTPException: If comparison not found or database operation fails
| drawing_comparison_id required | string (Drawing Comparison Id) |
{- "drawing_comparison": {
- "id": "string",
- "original_drawing_id": "string",
- "comparison_drawing_id": "string",
- "original_drawing_number": "string",
- "comparison_drawing_number": "string",
- "original_drawing_revision": "string",
- "comparison_drawing_revision": "string",
- "description": "string",
- "summary": "string",
- "items": [
- {
- "description": "string",
- "difference_rating": 1,
- "cost_effect": 1,
- "bounding_box": {
- "height": 0.4,
- "width": 0.3,
- "x": 0.1,
- "y": 0.2
}
}
]
}
}Manually trigger document processing/reprocessing for a document.
This endpoint is useful for documents that were never processed or failed processing. It will queue the document for chunking and embedding generation.
Uses atomic find_one_and_update to prevent race conditions - only documents that are not already being processed can be queued.
document_id: ID of the document to reprocess
db: MongoDB client instance
current_user: Current authenticated user
Status message indicating the document was queued for processing
HTTPException: If document not found, already processing, or queue fails
| document_id required | string (Document Id) |
{ }Manually trigger a drawing comparison between two existing documents.
This endpoint allows creating a comparison for documents that were not automatically compared during upload (e.g., due to processing order or status issues).
The comparison will:
original_document_id: ID of the original (older) document
comparison_document_id: ID of the comparison (newer) document
db: MongoDB client instance
current_user: Current authenticated user
Comparison result with the comparison ID
HTTPException: If documents not found, missing images, or comparison fails
| original_document_id required | string (Original Document Id) ID of the original (older) document |
| comparison_document_id required | string (Comparison Document Id) ID of the comparison (newer) document |
{ }Delete a drawing comparison and unlink the associated documents.
This endpoint allows removing an incorrect comparison between documents. It will:
comparison_id: ID of the comparison to delete
db: MongoDB client instance
current_user: Current authenticated user
Status message confirming deletion
HTTPException: If comparison not found or deletion fails
| comparison_id required | string (Comparison Id) |
{ }List email templates with optional filtering.
template_type: Optional template type to filter by
organization_id: Optional organization ID to filter by
active_only: Whether to only return active templates
current_user: Current authenticated user
List of email templates
EmailTemplateType (string) or Template Type (null) (Template Type) | |
Organization Id (string) or Organization Id (null) (Organization Id) | |
| active_only | boolean (Active Only) Default: true |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "body": "Hello {{user_name}},\n\nYou have been assigned a new task: {{task_name}}\n\nProject: {{project_name}}\nDue Date: {{due_date}}\nPriority: {{priority}}\n\nClick here to view the task: {{task_url}}",
- "created_at": "2024-01-01T00:00:00Z",
- "created_by": "507f1f77bcf86cd799439012",
- "description": "Email sent when a task is assigned to a user",
- "html_body": "<h2>New Task Assigned</h2><p>Hello {{user_name}},</p><p>You have been assigned a new task: <strong>{{task_name}}</strong></p><p><strong>Project:</strong> {{project_name}}<br><strong>Due Date:</strong> {{due_date}}<br><strong>Priority:</strong> {{priority}}</p><p><a href='{{task_url}}'>Click here to view the task</a></p>",
- "is_active": true,
- "name": "Task Assigned Email",
- "notification_type": "task_assigned",
- "subject": "New Task Assigned: {{task_name}}",
- "template_type": "notification",
- "updated_at": "2024-01-01T00:00:00Z",
- "variables": [
- "user_name",
- "task_name",
- "project_name",
- "due_date",
- "priority",
- "task_url"
]
}
]Create a new email template.
template: Template to create
current_user: Current authenticated user
Created template
| _id | string (Id) |
| created_at | string <date-time> (Created At) |
| updated_at | string <date-time> (Updated At) |
| name required | string (Name) Name of the template |
| description required | string (Description) Description of the template |
| template_type required | string (EmailTemplateType) Enum: "notification" "digest" "system" "custom" Type of template |
NotificationType (string) or null Associated notification type if applicable | |
| subject required | string (Subject) Email subject template |
| body required | string (Body) Plain text email body template |
| html_body required | string (Html Body) HTML email body template |
| variables | Array of strings (Variables) List of variables used in the template |
| is_active | boolean (Is Active) Default: true Whether the template is active |
| created_by required | string (Created By) ID of the user who created the template |
Organization Id (string) or Organization Id (null) (Organization Id) ID of the organization this template belongs to (if organization-specific) |
{- "_id": "507f1f77bcf86cd799439011",
- "body": "Hello {{user_name}},\n\nYou have been assigned a new task: {{task_name}}\n\nProject: {{project_name}}\nDue Date: {{due_date}}\nPriority: {{priority}}\n\nClick here to view the task: {{task_url}}",
- "created_at": "2024-01-01T00:00:00Z",
- "created_by": "507f1f77bcf86cd799439012",
- "description": "Email sent when a task is assigned to a user",
- "html_body": "<h2>New Task Assigned</h2><p>Hello {{user_name}},</p><p>You have been assigned a new task: <strong>{{task_name}}</strong></p><p><strong>Project:</strong> {{project_name}}<br><strong>Due Date:</strong> {{due_date}}<br><strong>Priority:</strong> {{priority}}</p><p><a href='{{task_url}}'>Click here to view the task</a></p>",
- "is_active": true,
- "name": "Task Assigned Email",
- "notification_type": "task_assigned",
- "subject": "New Task Assigned: {{task_name}}",
- "template_type": "notification",
- "updated_at": "2024-01-01T00:00:00Z",
- "variables": [
- "user_name",
- "task_name",
- "project_name",
- "due_date",
- "priority",
- "task_url"
]
}{- "_id": "507f1f77bcf86cd799439011",
- "body": "Hello {{user_name}},\n\nYou have been assigned a new task: {{task_name}}\n\nProject: {{project_name}}\nDue Date: {{due_date}}\nPriority: {{priority}}\n\nClick here to view the task: {{task_url}}",
- "created_at": "2024-01-01T00:00:00Z",
- "created_by": "507f1f77bcf86cd799439012",
- "description": "Email sent when a task is assigned to a user",
- "html_body": "<h2>New Task Assigned</h2><p>Hello {{user_name}},</p><p>You have been assigned a new task: <strong>{{task_name}}</strong></p><p><strong>Project:</strong> {{project_name}}<br><strong>Due Date:</strong> {{due_date}}<br><strong>Priority:</strong> {{priority}}</p><p><a href='{{task_url}}'>Click here to view the task</a></p>",
- "is_active": true,
- "name": "Task Assigned Email",
- "notification_type": "task_assigned",
- "subject": "New Task Assigned: {{task_name}}",
- "template_type": "notification",
- "updated_at": "2024-01-01T00:00:00Z",
- "variables": [
- "user_name",
- "task_name",
- "project_name",
- "due_date",
- "priority",
- "task_url"
]
}Get an email template by ID.
template_id: ID of the template to retrieve
current_user: Current authenticated user
Email template
HTTPException: If template not found
| template_id required | string (Template Id) |
{- "_id": "507f1f77bcf86cd799439011",
- "body": "Hello {{user_name}},\n\nYou have been assigned a new task: {{task_name}}\n\nProject: {{project_name}}\nDue Date: {{due_date}}\nPriority: {{priority}}\n\nClick here to view the task: {{task_url}}",
- "created_at": "2024-01-01T00:00:00Z",
- "created_by": "507f1f77bcf86cd799439012",
- "description": "Email sent when a task is assigned to a user",
- "html_body": "<h2>New Task Assigned</h2><p>Hello {{user_name}},</p><p>You have been assigned a new task: <strong>{{task_name}}</strong></p><p><strong>Project:</strong> {{project_name}}<br><strong>Due Date:</strong> {{due_date}}<br><strong>Priority:</strong> {{priority}}</p><p><a href='{{task_url}}'>Click here to view the task</a></p>",
- "is_active": true,
- "name": "Task Assigned Email",
- "notification_type": "task_assigned",
- "subject": "New Task Assigned: {{task_name}}",
- "template_type": "notification",
- "updated_at": "2024-01-01T00:00:00Z",
- "variables": [
- "user_name",
- "task_name",
- "project_name",
- "due_date",
- "priority",
- "task_url"
]
}Update an email template.
template_id: ID of the template to update
template: Updated template data
current_user: Current authenticated user
Updated template
HTTPException: If template not found
| template_id required | string (Template Id) |
| _id | string (Id) |
| created_at | string <date-time> (Created At) |
| updated_at | string <date-time> (Updated At) |
| name required | string (Name) Name of the template |
| description required | string (Description) Description of the template |
| template_type required | string (EmailTemplateType) Enum: "notification" "digest" "system" "custom" Type of template |
NotificationType (string) or null Associated notification type if applicable | |
| subject required | string (Subject) Email subject template |
| body required | string (Body) Plain text email body template |
| html_body required | string (Html Body) HTML email body template |
| variables | Array of strings (Variables) List of variables used in the template |
| is_active | boolean (Is Active) Default: true Whether the template is active |
| created_by required | string (Created By) ID of the user who created the template |
Organization Id (string) or Organization Id (null) (Organization Id) ID of the organization this template belongs to (if organization-specific) |
{- "_id": "507f1f77bcf86cd799439011",
- "body": "Hello {{user_name}},\n\nYou have been assigned a new task: {{task_name}}\n\nProject: {{project_name}}\nDue Date: {{due_date}}\nPriority: {{priority}}\n\nClick here to view the task: {{task_url}}",
- "created_at": "2024-01-01T00:00:00Z",
- "created_by": "507f1f77bcf86cd799439012",
- "description": "Email sent when a task is assigned to a user",
- "html_body": "<h2>New Task Assigned</h2><p>Hello {{user_name}},</p><p>You have been assigned a new task: <strong>{{task_name}}</strong></p><p><strong>Project:</strong> {{project_name}}<br><strong>Due Date:</strong> {{due_date}}<br><strong>Priority:</strong> {{priority}}</p><p><a href='{{task_url}}'>Click here to view the task</a></p>",
- "is_active": true,
- "name": "Task Assigned Email",
- "notification_type": "task_assigned",
- "subject": "New Task Assigned: {{task_name}}",
- "template_type": "notification",
- "updated_at": "2024-01-01T00:00:00Z",
- "variables": [
- "user_name",
- "task_name",
- "project_name",
- "due_date",
- "priority",
- "task_url"
]
}{- "_id": "507f1f77bcf86cd799439011",
- "body": "Hello {{user_name}},\n\nYou have been assigned a new task: {{task_name}}\n\nProject: {{project_name}}\nDue Date: {{due_date}}\nPriority: {{priority}}\n\nClick here to view the task: {{task_url}}",
- "created_at": "2024-01-01T00:00:00Z",
- "created_by": "507f1f77bcf86cd799439012",
- "description": "Email sent when a task is assigned to a user",
- "html_body": "<h2>New Task Assigned</h2><p>Hello {{user_name}},</p><p>You have been assigned a new task: <strong>{{task_name}}</strong></p><p><strong>Project:</strong> {{project_name}}<br><strong>Due Date:</strong> {{due_date}}<br><strong>Priority:</strong> {{priority}}</p><p><a href='{{task_url}}'>Click here to view the task</a></p>",
- "is_active": true,
- "name": "Task Assigned Email",
- "notification_type": "task_assigned",
- "subject": "New Task Assigned: {{task_name}}",
- "template_type": "notification",
- "updated_at": "2024-01-01T00:00:00Z",
- "variables": [
- "user_name",
- "task_name",
- "project_name",
- "due_date",
- "priority",
- "task_url"
]
}Delete an email template.
template_id: ID of the template to delete
current_user: Current authenticated user
HTTPException: If template not found
| template_id required | string (Template Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}List email activities with optional filtering.
recipient_id: Optional recipient ID to filter by
template_id: Optional template ID to filter by
notification_id: Optional notification ID to filter by
project_id: Optional project ID to filter by
limit: Maximum number of activities to return
skip: Number of activities to skip (for pagination)
current_user: Current authenticated user
List of email activities
Recipient Id (string) or Recipient Id (null) (Recipient Id) | |
Template Id (string) or Template Id (null) (Template Id) | |
Notification Id (string) or Notification Id (null) (Notification Id) | |
Project Id (string) or Project Id (null) (Project Id) | |
| limit | integer (Limit) [ 1 .. 100 ] Default: 50 |
| skip | integer (Skip) >= 0 Default: 0 |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "entity_id": "507f1f77bcf86cd799439016",
- "entity_type": "task",
- "metadata": {
- "due_date": "2024-06-30",
- "priority": "high",
- "project_name": "Building A Construction",
- "task_name": "Complete foundation work"
}, - "notification_id": "507f1f77bcf86cd799439014",
- "notification_type": "task_assigned",
- "project_id": "507f1f77bcf86cd799439015",
- "recipient_email": "user@example.com",
- "recipient_id": "507f1f77bcf86cd799439013",
- "sent_at": "2024-01-01T00:00:00Z",
- "status": "sent",
- "subject": "New Task Assigned: Complete foundation work",
- "template_id": "507f1f77bcf86cd799439012"
}
]Create a new external system integration with encrypted credentials.
The credentials provided in the request will be encrypted before storage. They are stored in a separate collection for security.
| system_id required | string (System Id) Unique identifier for the system |
| system_name required | string (System Name) Human-readable name |
| system_type required | string (ExternalSystemType) Enum: "rest_api" "soap_api" "graphql" "webhook" "database" "custom" Types of external systems that can be integrated. |
Description (string) or Description (null) (Description) | |
| base_url required | string (Base Url) Base URL for API calls |
| authentication_type | string (AuthenticationType) Default: "none" Enum: "none" "api_key" "bearer_token" "basic_auth" "oauth2" "custom_header" Authentication methods for external systems. |
| timeout | integer (Timeout) Default: 30 Request timeout in seconds |
| retry_attempts | integer (Retry Attempts) Default: 3 Number of retry attempts on failure |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) Maximum requests per minute (None = unlimited) | |
object (Custom Headers) Static headers to include in all requests (non-sensitive only) | |
| organization_id required | string (Organization Id) Organization that owns this system configuration |
| created_by_user_id required | string (Created By User Id) |
| is_active | boolean (Is Active) Default: true |
| is_shared | boolean (Is Shared) Default: false If true, can be used across all templates in organization |
| allowed_template_ids | Array of strings (Allowed Template Ids) Template IDs allowed to use this system (empty = all if shared) |
object (Metadata) Additional system-specific metadata | |
Last Tested At (string) or Last Tested At (null) (Last Tested At) | |
Last Test Status (string) or Last Test Status (null) (Last Test Status) | |
| status | string (ExternalSystemStatus) Default: "testing" Enum: "active" "inactive" "error" "testing" Status of external system integration. |
Credentials (object) or Credentials (null) (Credentials) Plain text credentials to be encrypted |
{- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "credentials": {
- "property1": "string",
- "property2": "string"
}
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}Create a new external system integration with encrypted credentials.
The credentials provided in the request will be encrypted before storage. They are stored in a separate collection for security.
| system_id required | string (System Id) Unique identifier for the system |
| system_name required | string (System Name) Human-readable name |
| system_type required | string (ExternalSystemType) Enum: "rest_api" "soap_api" "graphql" "webhook" "database" "custom" Types of external systems that can be integrated. |
Description (string) or Description (null) (Description) | |
| base_url required | string (Base Url) Base URL for API calls |
| authentication_type | string (AuthenticationType) Default: "none" Enum: "none" "api_key" "bearer_token" "basic_auth" "oauth2" "custom_header" Authentication methods for external systems. |
| timeout | integer (Timeout) Default: 30 Request timeout in seconds |
| retry_attempts | integer (Retry Attempts) Default: 3 Number of retry attempts on failure |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) Maximum requests per minute (None = unlimited) | |
object (Custom Headers) Static headers to include in all requests (non-sensitive only) | |
| organization_id required | string (Organization Id) Organization that owns this system configuration |
| created_by_user_id required | string (Created By User Id) |
| is_active | boolean (Is Active) Default: true |
| is_shared | boolean (Is Shared) Default: false If true, can be used across all templates in organization |
| allowed_template_ids | Array of strings (Allowed Template Ids) Template IDs allowed to use this system (empty = all if shared) |
object (Metadata) Additional system-specific metadata | |
Last Tested At (string) or Last Tested At (null) (Last Tested At) | |
Last Test Status (string) or Last Test Status (null) (Last Test Status) | |
| status | string (ExternalSystemStatus) Default: "testing" Enum: "active" "inactive" "error" "testing" Status of external system integration. |
Credentials (object) or Credentials (null) (Credentials) Plain text credentials to be encrypted |
{- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "credentials": {
- "property1": "string",
- "property2": "string"
}
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}List all external systems for an organization.
Credentials are not included in the response for security.
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID to filter systems (defaults to current user's org) | |
| include_inactive | boolean (Include Inactive) Default: false |
[- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}
]List all external systems for an organization.
Credentials are not included in the response for security.
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID to filter systems (defaults to current user's org) | |
| include_inactive | boolean (Include Inactive) Default: false |
[- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}
]Get details of a specific external system.
Credentials are not included in the response for security.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}Get details of a specific external system.
Credentials are not included in the response for security.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}Update an external system configuration.
If credentials are provided, they will be encrypted and stored securely.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
System Name (string) or System Name (null) (System Name) | |
Description (string) or Description (null) (Description) | |
Base Url (string) or Base Url (null) (Base Url) | |
AuthenticationType (string) or null | |
Timeout (integer) or Timeout (null) (Timeout) | |
Retry Attempts (integer) or Retry Attempts (null) (Retry Attempts) | |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) | |
Custom Headers (object) or Custom Headers (null) (Custom Headers) | |
Is Active (boolean) or Is Active (null) (Is Active) | |
Is Shared (boolean) or Is Shared (null) (Is Shared) | |
Array of Allowed Template Ids (strings) or Allowed Template Ids (null) (Allowed Template Ids) | |
Metadata (object) or Metadata (null) (Metadata) | |
ExternalSystemStatus (string) or null | |
Credentials (object) or Credentials (null) (Credentials) Updated credentials (plain text, will be encrypted) |
{- "system_name": "string",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 0,
- "retry_attempts": 0,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "is_active": true,
- "is_shared": true,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "status": "active",
- "credentials": {
- "property1": "string",
- "property2": "string"
}
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}Update an external system configuration.
If credentials are provided, they will be encrypted and stored securely.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
System Name (string) or System Name (null) (System Name) | |
Description (string) or Description (null) (Description) | |
Base Url (string) or Base Url (null) (Base Url) | |
AuthenticationType (string) or null | |
Timeout (integer) or Timeout (null) (Timeout) | |
Retry Attempts (integer) or Retry Attempts (null) (Retry Attempts) | |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) | |
Custom Headers (object) or Custom Headers (null) (Custom Headers) | |
Is Active (boolean) or Is Active (null) (Is Active) | |
Is Shared (boolean) or Is Shared (null) (Is Shared) | |
Array of Allowed Template Ids (strings) or Allowed Template Ids (null) (Allowed Template Ids) | |
Metadata (object) or Metadata (null) (Metadata) | |
ExternalSystemStatus (string) or null | |
Credentials (object) or Credentials (null) (Credentials) Updated credentials (plain text, will be encrypted) |
{- "system_name": "string",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 0,
- "retry_attempts": 0,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "is_active": true,
- "is_shared": true,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "status": "active",
- "credentials": {
- "property1": "string",
- "property2": "string"
}
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_id": "string",
- "system_name": "string",
- "system_type": "rest_api",
- "description": "string",
- "base_url": "string",
- "authentication_type": "none",
- "timeout": 30,
- "retry_attempts": 3,
- "rate_limit_per_minute": 0,
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}, - "organization_id": "string",
- "created_by_user_id": "string",
- "is_active": true,
- "is_shared": false,
- "allowed_template_ids": [
- "string"
], - "metadata": { },
- "last_tested_at": "2019-08-24T14:15:22Z",
- "last_test_status": "string",
- "status": "active",
- "has_credentials": false,
- "credential_fields": [
- "string"
]
}Delete an external system and its credentials.
This is a hard delete that removes both the system configuration and its encrypted credentials.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Delete an external system and its credentials.
This is a hard delete that removes both the system configuration and its encrypted credentials.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Test connection to an external system.
This makes a real API call to verify the configuration and credentials work.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
Test Endpoint (string) or Test Endpoint (null) (Test Endpoint) Optional endpoint to test (default: /health or base URL) | |
object (Test Params) Optional parameters for test request |
{- "test_endpoint": "string",
- "test_params": { }
}{- "success": true,
- "status_code": 0,
- "response_time_ms": 0,
- "error_message": "string",
- "tested_at": "2019-08-24T14:15:22Z"
}Test connection to an external system.
This makes a real API call to verify the configuration and credentials work.
| system_id required | string (System Id) |
| organization_id required | string (Organization Id) |
Test Endpoint (string) or Test Endpoint (null) (Test Endpoint) Optional endpoint to test (default: /health or base URL) | |
object (Test Params) Optional parameters for test request |
{- "test_endpoint": "string",
- "test_params": { }
}{- "success": true,
- "status_code": 0,
- "response_time_ms": 0,
- "error_message": "string",
- "tested_at": "2019-08-24T14:15:22Z"
}Proxy Geoapify geocoding via stored credentials (api_key auth).
Accepts JSON body with text/limit and optional organization_id.
| system_id required | string (System Id) |
| text required | string (Text) |
| limit | integer (Limit) Default: 1 |
Organization Id (string) or Organization Id (null) (Organization Id) |
{- "text": "string",
- "limit": 1,
- "organization_id": "string"
}{ }Proxy Geoapify geocoding via stored credentials (api_key auth).
Accepts JSON body with text/limit and optional organization_id.
| system_id required | string (System Id) |
| text required | string (Text) |
| limit | integer (Limit) Default: 1 |
Organization Id (string) or Organization Id (null) (Organization Id) |
{- "text": "string",
- "limit": 1,
- "organization_id": "string"
}{ }Forms & Data Collection
Create, issue, and manage structured forms for data collection.
Features:
Form Types:
assigned: One recipient, one submission (default)open: Multiple submissions allowed from anyone with linkanonymous: Anonymous submissions without authenticationWorkflow Modes:
sequential: Sections must be completed in orderflexible: Sections can be completed in any orderCreate a new form template for structured data collection.
Templates define the metadata for a form (name, description, category, tags) and can be scoped to the app, organization, or a specific project:
scope: "app"): Template is available app-wide across all
organizations. These are system templates managed by platform administrators.scope: "org"): Template is available across all
projects within the organization.scope: "project"): Template is only available within
the specified project. Requires project_id to be set.After creating a template, you must create at least one version with a schema before the form can be issued to recipients.
Example request:
{
"scope": "org",
"name": "Safety Inspection Checklist",
"description": "Daily safety inspection form for construction sites",
"category": "Safety",
"tags": ["safety", "daily", "inspection"]
}
| scope required | string (FormTemplateScope) Enum: "app" "org" "project" Template visibility scope: 'app' for app-wide system templates, 'org' for organization-wide, 'project' for project-specific. |
Project Id (string) or Project Id (null) (Project Id) Project ID. Required when scope is 'project', must be null for 'org' or 'app'. | |
| name required | string (Name) <= 200 characters Display name for the template. Should be descriptive and unique within the scope. |
Description (string) or Description (null) (Description) Detailed description of the form's purpose and usage. | |
(Category (ReportCategory (string) or Category (string))) or Category (null) (Category) Category for organizing templates. Use standard report categories when possible. | |
| tags | Array of strings (Tags) Tags for filtering and searching templates. Example: ['safety', 'daily']. |
FormSequenceConfig (object) or null Configuration for auto-generated form reference numbers. When enabled, each issued form gets a unique reference like 'TQ-00001'. |
{- "scope": "app",
- "project_id": "string",
- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "sequence_config": {
- "enabled": false,
- "prefix": "FORM",
- "format_pattern": "{prefix}-{sequence:05d}",
- "per_project": false,
- "include_project_ref": false
}
}{- "id": "string",
- "scope": "app",
- "organization_id": "string",
- "project_id": "string",
- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "is_system": true,
- "created_by_user_id": "string",
- "is_deleted": true,
- "latest_version_number": 0,
- "latest_version_id": "string",
- "sequence_config": {
- "enabled": false,
- "prefix": "FORM",
- "format_pattern": "{prefix}-{sequence:05d}",
- "per_project": false,
- "include_project_ref": false
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}List form templates with optional filtering and pagination.
Returns templates that the current user has access to based on their organization membership and project permissions. App-wide templates are always included in the results.
Filtering options:
project_id: Filter to templates for a specific project (includes org and app-scoped)scope: Filter by scope ("app", "org", or "project")category: Filter by category name (exact match)tags: Filter by tags (comma-separated, matches any)include_app_templates: Include app-wide templates (default: true)Templates are returned in order of most recently updated first.
Project Id (string) or Project Id (null) (Project Id) Filter by project ID. Returns project-scoped templates plus org and app-scoped templates. | |
FormTemplateScope (string) or Scope (null) (Scope) Filter by template scope: 'app' for app-wide, 'org' for organization-wide, 'project' for project-specific. | |
| include_app_templates | boolean (Include App Templates) Default: true Include app-wide system templates in results (default: true). |
Category (string) or Category (null) (Category) Filter by category name (exact match, case-sensitive). | |
Tags (string) or Tags (null) (Tags) Comma-separated list of tags. Returns templates matching any of the specified tags. | |
| page | integer (Page) >= 1 Default: 1 Page number (1-based). |
| size | integer (Size) [ 1 .. 100 ] Default: 20 Number of items per page (max 100). |
{- "items": [
- {
- "id": "string",
- "scope": "app",
- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "latest_version_number": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Retrieve a specific form template by its ID.
Returns the complete template including metadata, latest version information, and audit fields (created_at, updated_at, created_by).
Use latest_version_id to fetch the current active version's schema.
Error responses:
404: Template not found or user doesn't have access| template_id required | string (Template Id) |
{- "id": "string",
- "scope": "app",
- "organization_id": "string",
- "project_id": "string",
- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "is_system": true,
- "created_by_user_id": "string",
- "is_deleted": true,
- "latest_version_number": 0,
- "latest_version_id": "string",
- "sequence_config": {
- "enabled": false,
- "prefix": "FORM",
- "format_pattern": "{prefix}-{sequence:05d}",
- "per_project": false,
- "include_project_ref": false
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Update a form template's metadata.
Only the following fields can be updated (non-versioned):
name: Template display namedescription: Template descriptioncategory: Category for organizationtags: Tags for filteringarchived: Archive/unarchive the templateNote: To change the form schema (fields, validation), create a new version
using the POST /templates/{template_id}/versions endpoint.
Example request:
{
"name": "Updated Safety Checklist",
"tags": ["safety", "updated", "v2"]
}
| template_id required | string (Template Id) |
Name (string) or Name (null) (Name) New display name for the template. | |
Description (string) or Description (null) (Description) New description for the template. | |
(Category (ReportCategory (string) or Category (string))) or Category (null) (Category) New category for the template. | |
Array of Tags (strings) or Tags (null) (Tags) New tags list. Replaces existing tags entirely. | |
FormSequenceConfig (object) or null Updated sequence configuration for form references. |
{- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "sequence_config": {
- "enabled": false,
- "prefix": "FORM",
- "format_pattern": "{prefix}-{sequence:05d}",
- "per_project": false,
- "include_project_ref": false
}
}{- "id": "string",
- "scope": "app",
- "organization_id": "string",
- "project_id": "string",
- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "is_system": true,
- "created_by_user_id": "string",
- "is_deleted": true,
- "latest_version_number": 0,
- "latest_version_id": "string",
- "sequence_config": {
- "enabled": false,
- "prefix": "FORM",
- "format_pattern": "{prefix}-{sequence:05d}",
- "per_project": false,
- "include_project_ref": false
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Get the list of available template variables that can be used in form field default values.
Template variables use Jinja2 syntax (e.g., {{ user.name }}) and are rendered when
a form instance is created (issued). This enables dynamic default values such as:
Example usage in field default_value_template:
{{ user.name }} → "John Smith"
{{ form.reference }} → "TQ-00042"
{{ today }} → "2026-01-10"
{{ today_formatted }} → "10 January 2026"
Query parameters can filter variables based on available context:
has_project=true: Include project-specific variableshas_sequence=true: Include form reference/sequence variables| has_project | boolean (Has Project) Default: true Include project-related variables (requires project context when rendering) |
| has_sequence | boolean (Has Sequence) Default: true Include form reference variables (requires sequence config on template) |
{- "variables": [
- {
- "key": "string",
- "label": "string",
- "category": "user",
- "type": "string",
- "description": "string",
- "example": "string",
- "requires_project": false,
- "requires_sequence": false
}
]
}Preview what the next auto-generated form reference will look like for a template.
Returns the current sequence value and a preview of the next reference that will be generated when a new form instance is issued.
Note: This endpoint requires the template to have sequence_config.enabled=true.
| template_id required | string (Template Id) |
Project Id (string) or Project Id (null) (Project Id) Project ID for project-scoped sequences |
{ }Create a new immutable version of a form template's schema.
Form versions define the actual form structure including:
Version numbering: Versions are automatically numbered sequentially (1, 2, 3...). Once created, versions cannot be modified - create a new version for changes.
Supported field types:
text, textarea, email, phone, urlnumber, currencydate, datetime, timeselect, multi_select, radio, checkboxfile, signaturesection (for grouping fields)Example request:
{
"schema": {
"fields": [
{
"id": "inspector_name",
"type": "text",
"label": "Inspector Name",
"constraints": {"required": true, "maxLength": 100}
},
{
"id": "inspection_date",
"type": "date",
"label": "Inspection Date",
"constraints": {"required": true}
}
]
},
"ui_schema": {
"layout": "vertical",
"columns": 1
}
}
| template_id required | string (Template Id) |
required | object (FormSchema-Input) Complete form schema definition. |
FormUISchema (object) or null | |
Array of Summary Config (strings) or Summary Config (null) (Summary Config) | |
object (Default Prefill Values) | |
| default_locked_field_ids | Array of strings (Default Locked Field Ids) |
| default_hidden_field_ids | Array of strings (Default Hidden Field Ids) |
FormWorkflowConfig (object) or null | |
Array of objects (On Submit Tasks) |
{- "schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
], - "default_prefill_values": { },
- "default_locked_field_ids": [
- "string"
], - "default_hidden_field_ids": [
- "string"
], - "workflow_config": {
- "enabled": false,
- "mode": "sequential",
- "sections": [
- {
- "section_id": "string",
- "order": 1,
- "title": "string",
- "description": "string",
- "assignment": {
- "type": "named_user",
- "user_ids": [
- "string"
], - "role_names": [
- "string"
]
}, - "requires_signature": false,
- "allow_amendments": true,
- "field_ids": [
- "string"
]
}
]
}, - "on_submit_tasks": [
- {
- "type": "task",
- "task_template_id": "string",
- "agent_id": "string",
- "agent_task_id": "string",
- "agent_task_inputs": { },
- "auto_execute": true,
- "name": "string",
- "description": "string"
}
]
}{- "id": "string",
- "template_id": "string",
- "version_number": 0,
- "schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
], - "default_prefill_values": { },
- "default_locked_field_ids": [
- "string"
], - "default_hidden_field_ids": [
- "string"
], - "workflow_config": {
- "enabled": false,
- "mode": "sequential",
- "sections": [
- {
- "section_id": "string",
- "order": 1,
- "title": "string",
- "description": "string",
- "assignment": {
- "type": "named_user",
- "user_ids": [
- "string"
], - "role_names": [
- "string"
]
}, - "requires_signature": false,
- "allow_amendments": true,
- "field_ids": [
- "string"
]
}
]
}, - "on_submit_tasks": [
- {
- "type": "task",
- "task_template_id": "string",
- "agent_id": "string",
- "agent_task_id": "string",
- "agent_task_inputs": { },
- "auto_execute": true,
- "name": "string",
- "description": "string"
}
], - "created_by_user_id": "string",
- "created_at": "2019-08-24T14:15:22Z"
}List all versions of a form template with pagination.
Versions are returned in descending order by version number (newest first). Each version contains the complete schema and configuration at that point in time.
| template_id required | string (Template Id) |
| page | integer (Page) >= 1 Default: 1 Page number (1-based). |
| size | integer (Size) [ 1 .. 100 ] Default: 20 Number of items per page (max 100). |
{- "items": [
- {
- "id": "string",
- "template_id": "string",
- "version_number": 0,
- "schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
], - "default_prefill_values": { },
- "default_locked_field_ids": [
- "string"
], - "default_hidden_field_ids": [
- "string"
], - "workflow_config": {
- "enabled": false,
- "mode": "sequential",
- "sections": [
- {
- "section_id": "string",
- "order": 1,
- "title": "string",
- "description": "string",
- "assignment": {
- "type": "named_user",
- "user_ids": [
- "string"
], - "role_names": [
- "string"
]
}, - "requires_signature": false,
- "allow_amendments": true,
- "field_ids": [
- "string"
]
}
]
}, - "on_submit_tasks": [
- {
- "type": "task",
- "task_template_id": "string",
- "agent_id": "string",
- "agent_task_id": "string",
- "agent_task_inputs": { },
- "auto_execute": true,
- "name": "string",
- "description": "string"
}
], - "created_by_user_id": "string",
- "created_at": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Retrieve the latest (most recent) version of a form template.
Returns the complete version including schema, UI configuration, workflow settings, and any on-submit task triggers.
This is a convenience endpoint that combines:
latest_version_idUse this when you need the current active schema for a template.
Error responses:
404: Template not found, user doesn't have access, or no versions exist| template_id required | string (Template Id) |
{- "id": "string",
- "template_id": "string",
- "version_number": 0,
- "schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
], - "default_prefill_values": { },
- "default_locked_field_ids": [
- "string"
], - "default_hidden_field_ids": [
- "string"
], - "workflow_config": {
- "enabled": false,
- "mode": "sequential",
- "sections": [
- {
- "section_id": "string",
- "order": 1,
- "title": "string",
- "description": "string",
- "assignment": {
- "type": "named_user",
- "user_ids": [
- "string"
], - "role_names": [
- "string"
]
}, - "requires_signature": false,
- "allow_amendments": true,
- "field_ids": [
- "string"
]
}
]
}, - "on_submit_tasks": [
- {
- "type": "task",
- "task_template_id": "string",
- "agent_id": "string",
- "agent_task_id": "string",
- "agent_task_inputs": { },
- "auto_execute": true,
- "name": "string",
- "description": "string"
}
], - "created_by_user_id": "string",
- "created_at": "2019-08-24T14:15:22Z"
}Retrieve a specific form version by its ID.
Returns the complete version including schema, UI configuration, workflow settings, and any on-submit task triggers.
Use this endpoint to get the form structure for rendering a form instance.
| version_id required | string (Version Id) |
{- "id": "string",
- "template_id": "string",
- "version_number": 0,
- "schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
], - "default_prefill_values": { },
- "default_locked_field_ids": [
- "string"
], - "default_hidden_field_ids": [
- "string"
], - "workflow_config": {
- "enabled": false,
- "mode": "sequential",
- "sections": [
- {
- "section_id": "string",
- "order": 1,
- "title": "string",
- "description": "string",
- "assignment": {
- "type": "named_user",
- "user_ids": [
- "string"
], - "role_names": [
- "string"
]
}, - "requires_signature": false,
- "allow_amendments": true,
- "field_ids": [
- "string"
]
}
]
}, - "on_submit_tasks": [
- {
- "type": "task",
- "task_template_id": "string",
- "agent_id": "string",
- "agent_task_id": "string",
- "agent_task_inputs": { },
- "auto_execute": true,
- "name": "string",
- "description": "string"
}
], - "created_by_user_id": "string",
- "created_at": "2019-08-24T14:15:22Z"
}Issue a new form instance to a recipient.
Form instances are issued copies of a form that can be filled out and submitted. The instance uses the template's latest version at the time of issuance.
Instance types:
assigned (default): One recipient, one submission. The form is complete after submission.open: Multiple submissions allowed. Anyone with the link can submit.anonymous: Anonymous submissions without authentication tracking.Recipients:
issued_to_user_id to a user's IDissued_to_external with name and emailPublic links:
Set create_public_link: true to generate a shareable URL that doesn't
require authentication. Required for external recipients.
Example request for internal user:
{
"template_id": "507f1f77bcf86cd799439011",
"issued_to_user_id": "507f1f77bcf86cd799439012",
"title": "Safety Inspection - Building A",
"instructions": "Please complete by end of day",
"due_date": "2024-12-31T23:59:59Z"
}
Example request for external user:
{
"template_id": "507f1f77bcf86cd799439011",
"issued_to_external": {
"name": "John Contractor",
"email": "john@contractor.com",
"company": "ABC Construction"
},
"create_public_link": true,
"instance_type": "assigned"
}
| template_id required | string (Template Id) ID of the form template to issue. The latest version will be used unless version_id is specified. |
Version Id (string) or Version Id (null) (Version Id) Specific version ID to use. If not provided, the template's latest version is used. | |
Project Id (string) or Project Id (null) (Project Id) Project to associate this instance with. Optional for org-scoped templates. | |
Issued To User Id (string) or Issued To User Id (null) (Issued To User Id) Internal user ID to issue the form to. Mutually exclusive with issued_to_external. | |
IssuedToExternal (object) or null External recipient info. Requires create_public_link=true for access. | |
| instance_type | string (FormInstanceType) Default: "assigned" Enum: "assigned" "open" "anonymous" Instance type determining submission behavior. Default: 'assigned' (one submission). |
Expires In Days (integer) or Expires In Days (null) (Expires In Days) Number of days until the form expires. 0 or null means no expiration. | |
| create_public_link | boolean (Create Public Link) Default: false Generate a public shareable URL. Required for external recipients. |
| generate_qr_code | boolean (Generate Qr Code) Default: false Generate a QR code for this form instance |
Title (string) or Title (null) (Title) Custom title for this instance. Overrides the template name in the recipient's view. | |
Instructions (string) or Instructions (null) (Instructions) Instructions to display to the recipient when they open the form. | |
Array of Section Assignments (objects) or Section Assignments (null) (Section Assignments) Initial section assignments for workflow forms. Each section can have different assignees. | |
Prefill Values (object) or Prefill Values (null) (Prefill Values) Values to prefill in the form. Keys are field IDs from the schema. | |
Array of Locked Field Ids (strings) or Locked Field Ids (null) (Locked Field Ids) Field IDs that are visible but read-only. Useful with prefill_values for context fields. | |
Array of Hidden Field Ids (strings) or Hidden Field Ids (null) (Hidden Field Ids) Field IDs to hide from the recipient. Hidden fields can still have prefilled values. |
{- "template_id": "string",
- "version_id": "string",
- "project_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "expires_in_days": 365,
- "create_public_link": false,
- "generate_qr_code": false,
- "title": "string",
- "instructions": "string",
- "section_assignments": [
- {
- "section_id": "string",
- "user_ids": [
- "string"
], - "external_assignees": [
- {
- "name": "string",
- "email": "string"
}
]
}
], - "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
]
}{- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "status": "issued",
- "expires_at": "2019-08-24T14:15:22Z",
- "public_share_id": "string",
- "public_share_url": "string",
- "qr_code_url": "string",
- "title": "string",
- "instructions": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "section_assignments": [
- {
- "section_id": "string",
- "order": 0,
- "assignees": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "role_name": "string"
}
], - "status": "pending",
- "assigned_at": "2019-08-24T14:15:22Z",
- "assigned_by_user_id": "string"
}
], - "current_section_order": 0,
- "workflow_status": "pending",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}List form instances with filtering and pagination.
Returns instances that the current user has access to. Results are ordered by creation date (newest first).
Status values:
issued: Form has been issued but not yet submittedin_progress: Form is partially complete (workflow forms)completed: Form has been submitted/completedexpired: Form passed its due date without completioncancelled: Form was cancelled by the issuerProject Id (string) or Project Id (null) (Project Id) Filter by project ID. | |
Template Id (string) or Template Id (null) (Template Id) Filter by template ID. | |
FormInstanceStatus (string) or Status (null) (Status) Filter by instance status: issued, in_progress, completed, expired, cancelled. | |
Issued By User Id (string) or Issued By User Id (null) (Issued By User Id) Filter by the user who issued the form. | |
Issued To User Id (string) or Issued To User Id (null) (Issued To User Id) Filter by the user the form was issued to (internal users only). | |
Expires Before (string) or Expires Before (null) (Expires Before) Filter instances expiring before this date (ISO 8601 format). | |
Expires After (string) or Expires After (null) (Expires After) Filter instances expiring after this date (ISO 8601 format). | |
| page | integer (Page) >= 1 Default: 1 Page number (1-based). |
| size | integer (Size) [ 1 .. 100 ] Default: 20 Number of items per page (max 100). |
{- "items": [
- {
- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "status": "issued",
- "expires_at": "2019-08-24T14:15:22Z",
- "public_share_id": "string",
- "public_share_url": "string",
- "qr_code_url": "string",
- "title": "string",
- "instructions": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "section_assignments": [
- {
- "section_id": "string",
- "order": 0,
- "assignees": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "role_name": "string"
}
], - "status": "pending",
- "assigned_at": "2019-08-24T14:15:22Z",
- "assigned_by_user_id": "string"
}
], - "current_section_order": 0,
- "workflow_status": "pending",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Issue multiple form instances at once to a list of recipients.
This endpoint is optimized for issuing forms to many recipients in a single request. Maximum 500 recipients per request.
Use cases:
Each recipient receives their own independent form instance. The response includes lists of successfully created instances and any failures.
Example request:
{
"template_id": "507f1f77bcf86cd799439011",
"recipients": [
{"user_id": "507f1f77bcf86cd799439012"},
{"external": {"name": "Jane Doe", "email": "jane@example.com"}},
{"external": {"name": "Bob Smith", "email": "bob@example.com"}}
],
"instance_type": "assigned",
"create_public_links": true,
"title": "Weekly Safety Report",
"due_date": "2024-12-31T23:59:59Z"
}
Response includes:
created: List of successfully created instances with public share URLsfailed: List of recipients that failed with error detailstotal_requested, total_created, total_failed: Summary counts| template_id required | string (Template Id) |
Version Id (string) or Version Id (null) (Version Id) | |
Project Id (string) or Project Id (null) (Project Id) | |
Array of objects (Recipients) <= 500 items | |
| instance_type | string (FormInstanceType) Default: "assigned" Enum: "assigned" "open" "anonymous" Type of form instance determining submission behavior. Values: ASSIGNED: Default type. One recipient, one submission allowed. The form is complete after a single submission. OPEN: Multiple submissions allowed. Anyone with the link can submit multiple times. Useful for surveys or feedback forms. ANONYMOUS: Like OPEN, but submissions are not linked to any user identity. Useful for truly anonymous feedback. |
Expires In Days (integer) or Expires In Days (null) (Expires In Days) Days until expiry (0 or null = no expiry) | |
| create_public_links | boolean (Create Public Links) Default: false |
Title (string) or Title (null) (Title) | |
Instructions (string) or Instructions (null) (Instructions) | |
Prefill Values (object) or Prefill Values (null) (Prefill Values) Instance-specific values to prefill into each issued form. | |
Array of Locked Field Ids (strings) or Locked Field Ids (null) (Locked Field Ids) Field IDs that are visible but not editable by the completer. | |
Array of Hidden Field Ids (strings) or Hidden Field Ids (null) (Hidden Field Ids) Field IDs that should be hidden from the completer. |
{- "template_id": "string",
- "version_id": "string",
- "project_id": "string",
- "recipients": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "name": "string",
- "email": "string",
- "prefill_values": { },
- "title": "string",
- "instructions": "string"
}
], - "instance_type": "assigned",
- "expires_in_days": 365,
- "create_public_links": false,
- "title": "string",
- "instructions": "string",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
]
}{- "created": [
- {
- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "status": "issued",
- "expires_at": "2019-08-24T14:15:22Z",
- "public_share_id": "string",
- "public_share_url": "string",
- "qr_code_url": "string",
- "title": "string",
- "instructions": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "section_assignments": [
- {
- "section_id": "string",
- "order": 0,
- "assignees": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "role_name": "string"
}
], - "status": "pending",
- "assigned_at": "2019-08-24T14:15:22Z",
- "assigned_by_user_id": "string"
}
], - "current_section_order": 0,
- "workflow_status": "pending",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "failed": [
- {
- "property1": "string",
- "property2": "string"
}
], - "total_requested": 0,
- "total_created": 0,
- "total_failed": 0
}Get a form instance by ID.
| instance_id required | string (Instance Id) |
{- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "status": "issued",
- "expires_at": "2019-08-24T14:15:22Z",
- "public_share_id": "string",
- "public_share_url": "string",
- "qr_code_url": "string",
- "title": "string",
- "instructions": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "section_assignments": [
- {
- "section_id": "string",
- "order": 0,
- "assignees": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "role_name": "string"
}
], - "status": "pending",
- "assigned_at": "2019-08-24T14:15:22Z",
- "assigned_by_user_id": "string"
}
], - "current_section_order": 0,
- "workflow_status": "pending",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Cancel a form instance.
Only instances with status 'issued' or 'in_progress' can be cancelled.
| instance_id required | string (Instance Id) |
{- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "status": "issued",
- "expires_at": "2019-08-24T14:15:22Z",
- "public_share_id": "string",
- "public_share_url": "string",
- "qr_code_url": "string",
- "title": "string",
- "instructions": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "section_assignments": [
- {
- "section_id": "string",
- "order": 0,
- "assignees": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "role_name": "string"
}
], - "status": "pending",
- "assigned_at": "2019-08-24T14:15:22Z",
- "assigned_by_user_id": "string"
}
], - "current_section_order": 0,
- "workflow_status": "pending",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Presign an upload URL for a form attachment.
| instance_id required | string (Instance Id) |
| instance_id required | string (Instance Id) |
| field_id required | string (Field Id) |
| filename required | string (Filename) |
| content_type required | string (Content Type) |
| size_bytes required | integer (Size Bytes) >= 1 |
{- "instance_id": "string",
- "field_id": "string",
- "filename": "string",
- "content_type": "string",
- "size_bytes": 1
}{- "attachment_id": "string",
- "upload_url": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "r2_key": "string",
- "required_headers": {
- "property1": "string",
- "property2": "string"
}
}Presign an upload URL for a form attachment.
| instance_id required | string (Instance Id) |
| field_id required | string (Field Id) |
| filename required | string (Filename) |
| content_type required | string (Content Type) |
| size_bytes required | integer (Size Bytes) >= 1 |
{- "instance_id": "string",
- "field_id": "string",
- "filename": "string",
- "content_type": "string",
- "size_bytes": 1
}{- "attachment_id": "string",
- "upload_url": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "r2_key": "string",
- "required_headers": {
- "property1": "string",
- "property2": "string"
}
}Confirm an attachment upload and (optionally) generate a thumbnail.
| attachment_id required | string (Attachment Id) |
Checksum (string) or Checksum (null) (Checksum) | |
Any of string (Checksum) | |
{- "checksum": "string"
}{- "attachment_id": "string",
- "r2_key": "string",
- "thumbnail_url": "string",
- "status": "ready"
}Get presigned download URLs for an attachment.
| attachment_id required | string (Attachment Id) |
{- "download_url": "string",
- "thumbnail_url": "string",
- "expires_at": "2019-08-24T14:15:22Z"
}Submit a form instance for the first time.
Creates a new submission record with the provided field values. For assigned
instance types, this completes the form. For open instances, additional
submissions can be made.
Validation:
For workflow forms: Use the section completion endpoints instead of this endpoint. This endpoint is for simple (non-workflow) forms.
Example request:
{
"values": {
"inspector_name": "John Smith",
"inspection_date": "2024-01-15",
"items_checked": ["safety_equipment", "fire_exits"],
"notes": "All items passed inspection"
},
"description": "Weekly safety inspection completed"
}
Error responses:
400: Validation errors in field values404: Instance not found409: Instance already has a submission (for assigned type)| instance_id required | string (Instance Id) |
required | object (Values) Form field values as a dictionary mapping field IDs to their values. Each key should match a field ID from the form schema. Values should match the expected type for each field (string, number, array for multi-select, etc.). |
Description (string) or Description (null) (Description) Optional description or notes about this submission. |
{- "values": { },
- "description": "string"
}{- "id": "string",
- "instance_id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "completed_by_user_id": "string",
- "completed_by_external": {
- "name": "string",
- "email": "string"
}, - "description": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "latest_revision_number": 0,
- "latest_revision_id": "string",
- "values": { },
- "values_url": "string",
- "flat_values": { }
}Amend an existing form submission by creating a new revision.
The original submission and all previous revisions are preserved for audit purposes. Each amendment increments the revision number.
Audit trail:
Example request:
{
"values": {
"inspector_name": "John Smith",
"inspection_date": "2024-01-16",
"notes": "Updated inspection date to correct day"
},
"note": "Corrected inspection date from 15th to 16th"
}
| submission_id required | string (Submission Id) |
required | object (Values) Updated form field values. Must include all fields, not just changed ones. |
Note (string) or Note (null) (Note) Optional note explaining the reason for the amendment. |
{- "values": { },
- "note": "string"
}{- "id": "string",
- "instance_id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "completed_by_user_id": "string",
- "completed_by_external": {
- "name": "string",
- "email": "string"
}, - "description": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "latest_revision_number": 0,
- "latest_revision_id": "string",
- "values": { },
- "values_url": "string",
- "flat_values": { }
}List form submissions with filtering.
Project Id (string) or Project Id (null) (Project Id) | |
Issued By User Id (string) or Issued By User Id (null) (Issued By User Id) | |
Completed By User Id (string) or Completed By User Id (null) (Completed By User Id) | |
Submitted From (string) or Submitted From (null) (Submitted From) | |
Submitted To (string) or Submitted To (null) (Submitted To) | |
| page | integer (Page) >= 1 Default: 1 |
| size | integer (Size) [ 1 .. 100 ] Default: 20 |
{- "items": [
- {
- "id": "string",
- "instance_id": "string",
- "template_id": "string",
- "description": "string",
- "completed_by_user_id": "string",
- "completed_by_name": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "latest_revision_number": 0,
- "flat_values": { }
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}List submissions in table format optimized for grid/spreadsheet views.
This endpoint is optimized for viewing 50+ submissions at once.
| template_id required | string (Template Id) |
Project Id (string) or Project Id (null) (Project Id) | |
| page | integer (Page) >= 1 Default: 1 |
| size | integer (Size) [ 1 .. 100 ] Default: 50 |
{- "template_id": "string",
- "template_name": "string",
- "columns": [
- {
- "id": "string",
- "label": "string",
- "type": "string"
}
], - "rows": [
- {
- "id": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "completed_by_name": "string",
- "flat_values": { }
}
], - "total": 0,
- "page": 0,
- "size": 0,
- "has_more": true
}Get a specific submission with optional presigned URL to latest blob.
| submission_id required | string (Submission Id) |
| include_blob_url | boolean (Include Blob Url) Default: true |
{- "id": "string",
- "instance_id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "completed_by_user_id": "string",
- "completed_by_external": {
- "name": "string",
- "email": "string"
}, - "description": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "latest_revision_number": 0,
- "latest_revision_id": "string",
- "values": { },
- "values_url": "string",
- "flat_values": { }
}List all revisions of a submission (audit timeline).
| submission_id required | string (Submission Id) |
| page | integer (Page) >= 1 Default: 1 |
| size | integer (Size) [ 1 .. 100 ] Default: 20 |
{- "items": [
- {
- "id": "string",
- "submission_id": "string",
- "revision_number": 0,
- "version_id": "string",
- "changed_by_user_id": "string",
- "changed_by_external": {
- "name": "string",
- "email": "string"
}, - "change_summary": {
- "fields_changed": [
- "string"
], - "note": "string"
}, - "created_at": "2019-08-24T14:15:22Z",
- "blob_url": "string"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Fetch full values for multiple submissions at once.
Use this when you need the complete form data for selected submissions (e.g., for export, detailed comparison, or editing).
Max 100 submissions per request.
| submission_ids required | Array of strings (Submission Ids) <= 100 items |
{- "submission_ids": [
- "string"
]
}{- "submissions": {
- "property1": { },
- "property2": { }
}, - "not_found": [
- "string"
]
}Get the progress summary for all sections in a workflow form instance.
Returns an ordered list of sections with their current status, assignees, and completion information. Use this to display a progress overview or determine which sections the current user can complete.
Section statuses:
pending: Section has not been startedin_progress: Section is available for completioncompleted: Section has been submittedamended: Section was completed and later amendedResponse includes for each section:
| instance_id required | string (Instance Id) |
[- {
- "section_id": "string",
- "section_order": 0,
- "title": "string",
- "description": "string",
- "status": "string",
- "requires_signature": true,
- "allow_amendments": true,
- "assignees": [
- { }
], - "completed_by": { },
- "completed_at": "2019-08-24T14:15:22Z",
- "revision_count": 0,
- "is_current_user_assigned": false,
- "can_complete": false
}
]Complete a section within a workflow form instance.
| instance_id required | string (Instance Id) |
| section_id required | string (Section Id) |
| section_id required | string (Section Id) Section to complete |
required | object (Values) Field values for this section |
Signature Data (string) or Signature Data (null) (Signature Data) Base64/SVG signature data if section requires signature |
{- "section_id": "string",
- "values": { },
- "signature_data": "string"
}{- "id": "string",
- "instance_id": "string",
- "submission_id": "string",
- "section_id": "string",
- "section_order": 0,
- "revision_number": 0,
- "completed_by_user_id": "string",
- "completed_by_external": {
- "name": "string",
- "email": "string"
}, - "signature": {
- "signature_image_r2_key": "string",
- "signature_data": "string",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string"
}, - "status": "completed",
- "completed_at": "2019-08-24T14:15:22Z",
- "previous_completion_id": "string",
- "amendment_note": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Amend a previously completed section.
| instance_id required | string (Instance Id) |
| section_id required | string (Section Id) |
required | object (Values) Updated field values |
Signature Data (string) or Signature Data (null) (Signature Data) New signature if section requires signature | |
Amendment Note (string) or Amendment Note (null) (Amendment Note) Reason for amendment |
{- "values": { },
- "signature_data": "string",
- "amendment_note": "string"
}{- "id": "string",
- "instance_id": "string",
- "submission_id": "string",
- "section_id": "string",
- "section_order": 0,
- "revision_number": 0,
- "completed_by_user_id": "string",
- "completed_by_external": {
- "name": "string",
- "email": "string"
}, - "signature": {
- "signature_image_r2_key": "string",
- "signature_data": "string",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string"
}, - "status": "completed",
- "completed_at": "2019-08-24T14:15:22Z",
- "previous_completion_id": "string",
- "amendment_note": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Assign a section to specific users (for issuer_assigns_next workflow).
| instance_id required | string (Instance Id) |
| section_id required | string (Section Id) |
Array of User Ids (strings) or User Ids (null) (User Ids) List of internal user IDs to assign this section to. | |
Array of External Assignees (objects) or External Assignees (null) (External Assignees) List of external assignees with name and email. |
{- "user_ids": [
- "string"
], - "external_assignees": [
- {
- "property1": "string",
- "property2": "string"
}
]
}{- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "issued_by_user_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "instance_type": "assigned",
- "status": "issued",
- "expires_at": "2019-08-24T14:15:22Z",
- "public_share_id": "string",
- "public_share_url": "string",
- "qr_code_url": "string",
- "title": "string",
- "instructions": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "section_assignments": [
- {
- "section_id": "string",
- "order": 0,
- "assignees": [
- {
- "user_id": "string",
- "external": {
- "name": "string",
- "email": "string"
}, - "role_name": "string"
}
], - "status": "pending",
- "assigned_at": "2019-08-24T14:15:22Z",
- "assigned_by_user_id": "string"
}
], - "current_section_order": 0,
- "workflow_status": "pending",
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Get all completions (audit trail) for a section.
| instance_id required | string (Instance Id) |
| section_id required | string (Section Id) |
[- {
- "id": "string",
- "instance_id": "string",
- "submission_id": "string",
- "section_id": "string",
- "section_order": 0,
- "revision_number": 0,
- "completed_by_user_id": "string",
- "completed_by_external": {
- "name": "string",
- "email": "string"
}, - "signature": {
- "signature_image_r2_key": "string",
- "signature_data": "string",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string"
}, - "status": "completed",
- "completed_at": "2019-08-24T14:15:22Z",
- "previous_completion_id": "string",
- "amendment_note": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]Meeting Management
Manage construction project meetings and minutes.
Features:
List meetings for a project with optional filtering.
project_id: Project ID
status: Filter by meeting status
skip: Number of records to skip
limit: Maximum number of records to return
current_user: Current authenticated user
List of meetings matching the criteria
HTTPException: If project not found or user not authorized
| project_id required | string (Project Id) |
Status (string) or Status (null) (Status) | |
| skip | integer (Skip) >= 0 Default: 0 |
| limit | integer (Limit) [ 1 .. 100 ] Default: 50 |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "Weekly review of project progress",
- "end_time": "2024-01-01T11:00:00",
- "location": "Conference Room A",
- "meeting_type": "regular",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_document_ids": [
- "507f1f77bcf86cd799439014"
], - "start_time": "2024-01-01T10:00:00",
- "status": "scheduled",
- "title": "Weekly Project Review",
- "updated_at": "2024-01-01T00:00:00"
}
]Create a new meeting for a project.
project_id: Project ID
meeting_data: Meeting data
current_user: Current authenticated user
Created meeting data
HTTPException: If project not found or user not authorized
| project_id required | string (Project Id) |
| title required | string (Title) Title of the meeting |
Description (string) or Description (null) (Description) Meeting description | |
| project_id required | string (Project Id) ID of the project this meeting belongs to |
| status | string (Status) Default: "scheduled" Meeting status (scheduled, in_progress, completed, cancelled) |
| priority | string (Priority) Default: "medium" Meeting priority (low, medium, high, urgent) |
| start_time required | string <date-time> (Start Time) Meeting start time |
| end_time required | string <date-time> (End Time) Meeting end time |
Location (string) or Location (null) (Location) Meeting location (physical or virtual) | |
| meeting_type | string (Meeting Type) Default: "regular" Type of meeting (regular, kickoff, review, etc.) |
| tags | Array of strings (Tags) Meeting tags |
| attendees | Array of strings (Attendees) IDs of users attending the meeting |
| related_document_ids | Array of strings (Related Document Ids) IDs of documents related to this meeting |
| related_task_ids | Array of strings (Related Task Ids) IDs of tasks related to this meeting |
| related_milestone_ids | Array of strings (Related Milestone Ids) IDs of milestones related to this meeting |
Notes (string) or Notes (null) (Notes) Meeting notes or agenda | |
| created_by required | string (Created By) ID of the user creating the meeting |
{- "title": "string",
- "description": "string",
- "project_id": "string",
- "status": "scheduled",
- "priority": "medium",
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z",
- "location": "string",
- "meeting_type": "regular",
- "tags": [
- "string"
], - "attendees": [
- "string"
], - "related_document_ids": [
- "string"
], - "related_task_ids": [
- "string"
], - "related_milestone_ids": [
- "string"
], - "notes": "string",
- "created_by": "string"
}{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "Weekly review of project progress",
- "end_time": "2024-01-01T11:00:00",
- "location": "Conference Room A",
- "meeting_type": "regular",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_document_ids": [
- "507f1f77bcf86cd799439014"
], - "start_time": "2024-01-01T10:00:00",
- "status": "scheduled",
- "title": "Weekly Project Review",
- "updated_at": "2024-01-01T00:00:00"
}Get meeting by ID.
meeting_id: Meeting ID
current_user: Current authenticated user
Meeting data
HTTPException: If meeting not found or user not authorized
| meeting_id required | string (Meeting Id) |
{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "Weekly review of project progress",
- "end_time": "2024-01-01T11:00:00",
- "location": "Conference Room A",
- "meeting_type": "regular",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_document_ids": [
- "507f1f77bcf86cd799439014"
], - "start_time": "2024-01-01T10:00:00",
- "status": "scheduled",
- "title": "Weekly Project Review",
- "updated_at": "2024-01-01T00:00:00"
}Update a meeting.
meeting_id: Meeting ID
updates: Meeting updates
current_user: Current authenticated user
Updated meeting data
HTTPException: If user not authorized or meeting not found
| meeting_id required | string (Meeting Id) |
Title (string) or Title (null) (Title) | |
Description (string) or Description (null) (Description) | |
Status (string) or Status (null) (Status) | |
Priority (string) or Priority (null) (Priority) | |
Start Time (string) or Start Time (null) (Start Time) | |
End Time (string) or End Time (null) (End Time) | |
Location (string) or Location (null) (Location) | |
Meeting Type (string) or Meeting Type (null) (Meeting Type) | |
Array of Tags (strings) or Tags (null) (Tags) | |
Array of Attendees (strings) or Attendees (null) (Attendees) | |
Array of Related Document Ids (strings) or Related Document Ids (null) (Related Document Ids) | |
Array of Related Task Ids (strings) or Related Task Ids (null) (Related Task Ids) | |
Array of Related Milestone Ids (strings) or Related Milestone Ids (null) (Related Milestone Ids) | |
Notes (string) or Notes (null) (Notes) | |
Updated By (string) or Updated By (null) (Updated By) |
{- "title": "string",
- "description": "string",
- "status": "string",
- "priority": "string",
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z",
- "location": "string",
- "meeting_type": "string",
- "tags": [
- "string"
], - "attendees": [
- "string"
], - "related_document_ids": [
- "string"
], - "related_task_ids": [
- "string"
], - "related_milestone_ids": [
- "string"
], - "notes": "string",
- "updated_by": "string"
}{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "Weekly review of project progress",
- "end_time": "2024-01-01T11:00:00",
- "location": "Conference Room A",
- "meeting_type": "regular",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_document_ids": [
- "507f1f77bcf86cd799439014"
], - "start_time": "2024-01-01T10:00:00",
- "status": "scheduled",
- "title": "Weekly Project Review",
- "updated_at": "2024-01-01T00:00:00"
}Delete a meeting.
meeting_id: Meeting ID
current_user: Current authenticated user
Success message
HTTPException: If user not authorized or meeting not found
| meeting_id required | string (Meeting Id) |
nullOrganization Management
Manage organization settings and team members.
Features:
List all organizations with optional fuzzy search.
current_user: Current authenticated user
search: Optional search query for fuzzy matching
threshold: Minimum fuzzy match score (0-100, default: 60)
List of organizations with presigned logo URLs, filtered by search if provided
Search (string) or Search (null) (Search) Search query for fuzzy matching organization names | |
| threshold | integer (Threshold) [ 0 .. 100 ] Default: 60 Minimum fuzzy match score (0-100) |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "description": "An example organization",
- "name": "Example Org",
- "normalised_name": "example org",
- "owner_id": "507f1f77bcf86cd799439012",
- "project_roles": [
- "project_manager",
- "site_manager",
- "health_safety_officer"
], - "updated_at": "2024-01-01T00:00:00"
}
]Get organization by ID.
organization_id: Organization ID
current_user: Current authenticated user
Organization data with presigned logo URL
HTTPException: If organization not found or user not authorized
| organization_id required | string (Organization Id) |
{- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "description": "An example organization",
- "name": "Example Org",
- "normalised_name": "example org",
- "owner_id": "507f1f77bcf86cd799439012",
- "project_roles": [
- "project_manager",
- "site_manager",
- "health_safety_officer"
], - "updated_at": "2024-01-01T00:00:00"
}Update an existing organization with the provided data
| organization_id required | string (Organization Id) |
Name (string) or Name (null) (Name) | |
Normalised Name (string) or Normalised Name (null) (Normalised Name) | |
Description (string) or Description (null) (Description) | |
Logo Url (string) or Logo Url (null) (Logo Url) | |
Website (string) or Website (null) (Website) | |
Address (string) or Address (null) (Address) | |
Phone (string) or Phone (null) (Phone) | |
Email (string) or Email (null) (Email) | |
Array of Aliases (strings) or Aliases (null) (Aliases) | |
Branding (object) or Branding (null) (Branding) | |
Status (string) or Status (null) (Status) | |
Array of Project Roles (strings) or Project Roles (null) (Project Roles) | |
Role (string) or Role (null) (Role) | |
Archived (boolean) or Archived (null) (Archived) | |
Archived At (string) or Archived At (null) (Archived At) | |
Custom Fields (object) or Custom Fields (null) (Custom Fields) | |
Custom Field Definitions (object) or Custom Field Definitions (null) (Custom Field Definitions) |
{- "name": "string",
- "normalised_name": "string",
- "description": "string",
- "logo_url": "string",
- "website": "string",
- "address": "string",
- "phone": "string",
- "email": "string",
- "aliases": [
- "string"
], - "branding": { },
- "status": "string",
- "project_roles": [
- "string"
], - "role": "string",
- "archived": true,
- "archived_at": "2019-08-24T14:15:22Z",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}
}{- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "description": "An example organization",
- "name": "Example Org",
- "normalised_name": "example org",
- "owner_id": "507f1f77bcf86cd799439012",
- "project_roles": [
- "project_manager",
- "site_manager",
- "health_safety_officer"
], - "updated_at": "2024-01-01T00:00:00"
}Get members of an organization.
org_id: Organization ID
current_user: Current authenticated user
List of organization members with membership details
HTTPException: If organization not found or user not authorized
| org_id required | string (Org Id) |
[- {
- "_id": "string",
- "user_id": "string",
- "user_name": "string",
- "user_email": "string",
- "user_avatar": "string",
- "roles": [
- "billing_admin"
], - "joined_at": "2019-08-24T14:15:22Z",
- "status": "active",
- "invited_by": "string"
}
]Add a member to an organization.
| org_id required | string (Org Id) |
| send_invite | boolean (Send Invite) Default: true If true, send an invitation email to the member |
| _id | string (Id) |
| created_at | string <date-time> (Created At) |
| updated_at | string <date-time> (Updated At) |
Clerk User Id (string) or Clerk User Id (null) (Clerk User Id) Clerk user ID | |
| name required | string (Name) Full name of the user |
| email required | string <email> (Email) Email address of the user |
| role | string (Role) Default: "user" Role of the user |
Company (string) or Company (null) (Company) Company name | |
Avatar (string) or Avatar (null) (Avatar) | |
Phone (string) or Phone (null) (Phone) | |
Department (string) or Department (null) (Department) | |
Location (string) or Location (null) (Location) | |
Bio (string) or Bio (null) (Bio) | |
SocialLinks (object) or null | |
ProfileSettings (object) or null | |
| archived | boolean (Archived) Default: false Whether the user is archived |
Archived At (string) or Archived At (null) (Archived At) Date and time the user was archived | |
| is_signed_up | boolean (Is Signed Up) Default: true |
| is_organization_member | boolean (Is Organization Member) Default: true |
| organization_id required | string (Organization Id) Currently active organization ID (last used becomes default on login) |
| organization_ids | Array of strings (Organization Ids) All organizations the user belongs to (denormalized from memberships) |
| project_ids | Array of strings (Project Ids) Default: [] |
| status | string (Status) Default: "pending" |
| joined_at | string <date-time> (Joined At) |
| organization_roles | Array of strings (Organization Roles) Items Enum: "billing_admin" "org_admin" "standard" Roles within the CURRENT organization (cached from membership) |
{- "_id": "507f1f77bcf86cd799439011",
- "company": "Example Corp",
- "created_at": "2024-01-01T00:00:00",
- "email": "john@example.com",
- "joined_at": "2024-01-01T00:00:00",
- "name": "John Doe",
- "organization_id": "507f1f77bcf86cd799439012",
- "organization_ids": [
- "507f1f77bcf86cd799439012"
], - "organization_roles": [
- "standard"
], - "role": "user",
- "updated_at": "2024-01-01T00:00:00"
}{- "_id": "507f1f77bcf86cd799439011",
- "company": "Example Corp",
- "created_at": "2024-01-01T00:00:00",
- "email": "john@example.com",
- "joined_at": "2024-01-01T00:00:00",
- "name": "John Doe",
- "organization_id": "507f1f77bcf86cd799439012",
- "organization_ids": [
- "507f1f77bcf86cd799439012"
], - "organization_roles": [
- "standard"
], - "role": "user",
- "updated_at": "2024-01-01T00:00:00"
}Update roles of an organization member.
org_id: Organization ID
user_id: User ID
roles: New roles for the user
current_user: Current authenticated user
Updated membership data
HTTPException: If user not authorized or member not found
| org_id required | string (Org Id) |
| user_id required | string (User Id) |
[- "billing_admin"
]{- "_id": "string",
- "user_id": "string",
- "user_name": "string",
- "user_email": "string",
- "user_avatar": "string",
- "roles": [
- "billing_admin"
], - "joined_at": "2019-08-24T14:15:22Z",
- "status": "active",
- "invited_by": "string"
}Remove a member from an organization.
org_id: Organization ID
user_id: User ID
current_user: Current authenticated user
Success message
HTTPException: If user not authorized or member not found
| org_id required | string (Org Id) |
| user_id required | string (User Id) |
{- "property1": "string",
- "property2": "string"
}Upload an organization logo.
organization_id: Organization ID
file: The image file to upload
current_user: Current authenticated user
Dict containing the logo key and presigned URL
HTTPException: If upload fails or user not authorized
| organization_id required | string (Organization Id) |
| file required | string <binary> (File) |
{- "property1": "string",
- "property2": "string"
}Delete an organization's logo.
organization_id: Organization ID
current_user: Current authenticated user
Success message
HTTPException: If deletion fails or user not authorized
| organization_id required | string (Organization Id) |
{- "property1": "string",
- "property2": "string"
}Upload an organization logo from a URL.
Downloads the image from the given URL, processes it, and uploads to R2.
organization_id: Organization ID
body: Request body containing {"url": "https://..."}
current_user: Current authenticated user
Dict containing the logo key and presigned URL
HTTPException: If download/upload fails or user not authorized
| organization_id required | string (Organization Id) |
| property name* additional property | string |
{- "property1": "string",
- "property2": "string"
}{- "property1": "string",
- "property2": "string"
}Retrieve all projects where organization_id matches the given organization
| organization_id required | string (Organization Id) |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
Sort By (string) or Sort By (null) (Sort By) | |
Sort Order (string) or Sort Order (null) (Sort Order) | |
| archived | boolean (Archived) Default: false Filter by archived status |
{- "items": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example project",
- "name": "Example Project",
- "organization_id": "507f1f77bcf86cd799439012",
- "status": "active",
- "tags": [
- "example",
- "demo"
], - "updated_at": "2024-01-01T00:00:00"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}List all organizations the current user belongs to.
List of organizations with membership details
[- {
- "_id": "string",
- "organization_id": "string",
- "organization_name": "string",
- "organization_description": "string",
- "roles": [
- "billing_admin"
], - "joined_at": "2019-08-24T14:15:22Z",
- "status": "active",
- "is_current": false
}
]Switch the user's active organization.
Updates the user's current organization context to the specified organization. The user must have an active membership in the target organization.
organization_id: ID of the organization to switch to
current_user: Current authenticated user
The membership details for the new active organization
HTTPException: If organization not found or user not a member
| organization_id required | string (Organization Id) |
{- "_id": "string",
- "organization_id": "string",
- "organization_name": "string",
- "organization_description": "string",
- "roles": [
- "billing_admin"
], - "joined_at": "2019-08-24T14:15:22Z",
- "status": "active",
- "is_current": false
}Get the current organization context.
Returns the user's currently active organization with membership details.
Current organization with membership details
HTTPException: If user has no current organization
{- "_id": "string",
- "organization_id": "string",
- "organization_name": "string",
- "organization_description": "string",
- "roles": [
- "billing_admin"
], - "joined_at": "2019-08-24T14:15:22Z",
- "status": "active",
- "is_current": false
}Upload a document at the organization level (not tied to a specific project)
| organization_id required | string (Organization Id) |
| document_id required | string (Document Id) Document ID |
Title (string) or Title (null) (Title) Document title | |
Document Reference (string) or Document Reference (null) (Document Reference) Document reference or drawing number | |
Description (string) or Description (null) (Description) Document description | |
DocumentStatus (string) or null Document status | |
Revision (string) or Revision (null) (Revision) Document revision | |
Category (string) or Category (null) (Category) Document category | |
DocumentType (string) or null Type of document | |
Content (string) or Content (null) (Content) Extracted text content from document | |
Summary (string) or Summary (null) (Summary) Summary of document | |
Purpose (string) or Purpose (null) (Purpose) Purpose of document | |
Array of Keywords (strings) or Keywords (null) (Keywords) Default: [] Keywords associated with document | |
File Path (string) or File Path (null) (File Path) Path to stored document | |
File Size (integer) or File Size (null) (File Size) Size of document in bytes | |
Mime Type (string) or Mime Type (null) (Mime Type) MIME type of document | |
| created_at | string <date-time> (Created At) Creation timestamp |
| updated_at | string <date-time> (Updated At) Last update timestamp |
Array of objects (Version History) Version history of document | |
Thumbnail Image Path (string) or Thumbnail Image Path (null) (Thumbnail Image Path) Path to thumbnail image | |
Full Image Path (string) or Full Image Path (null) (Full Image Path) Path to full image | |
Error (string) or Error (null) (Error) Error message if document processing failed | |
Error Detail (object) or Error Detail (null) (Error Detail) Error details | |
| filename required | string (Filename) Filename of document |
| r2_path required | string (R2 Path) Path to stored document in R2 |
File Extension (string) or File Extension (null) (File Extension) File extension without dot (e.g., 'pdf') | |
FileHandlingTier (string) or null Processing tier for this file type | |
Drawing Comparison Id (string) or Drawing Comparison Id (null) (Drawing Comparison Id) ID of the drawing comparison record, if this document was compared to a previous version | |
Virtual Document Id (string) or Virtual Document Id (null) (Virtual Document Id) Reference to the source virtual document if auto-generated from export | |
Virtual Document Version (integer) or Virtual Document Version (null) (Virtual Document Version) Version number of the virtual document if auto-generated from export | |
| auto_generated | boolean (Auto Generated) Default: false Flag indicating this document was auto-created from a virtual document export |
| organization_id required | string (Organization Id) ID of organization this document belongs to |
Project Id (string) or Project Id (null) (Project Id) Optional project ID if document is also linked to a project | |
| processing_status required | string (DocumentProcessingStatus) Enum: "PENDING" "QUEUED" "PROCESSING" "PROCESSED" "FAILED" "DUPLICATE" "PENDING_PROCESSING" "UPLOADED" "ACCEPTED" Status of document processing |
required | object (AssigneeUser) User who uploaded the document |
{- "document_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ],
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "version_history": [
- {
- "version_id": "string",
- "version_number": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "content": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "drawing_comparison_id": "string",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "organization_id": "string",
- "project_id": "string",
- "processing_status": "PENDING",
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "filename": "string",
- "processing_status": "PENDING",
- "status": "draft",
- "r2_path": "string",
- "chunks_count": 0,
- "full_image_path": "string",
- "thumbnail_image_path": "string",
- "error": "string",
- "error_detail": { },
- "metadata": {
- "document_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "title": "string",
- "document_reference": "string",
- "description": "string",
- "status": "draft",
- "revision": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "purpose": "string",
- "keywords": [ ]
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "title": "string",
- "project_id": "string",
- "organization_id": "string",
- "document_reference": "string",
- "description": "string",
- "category": "string",
- "document_type": "brochure",
- "content": "string",
- "summary": "string",
- "file_path": "string",
- "file_size": 0,
- "mime_type": "string",
- "drawing_comparison_id": "string"
}Programme Management
Manage construction programmes and schedules.
Features:
Return milestones, programme tasks, and executions for a project.
| project_id required | string (Project Id) |
{- "milestones": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "completion_percentage": 0,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "Foundation work completed and inspected",
- "due_date": "2024-02-01T00:00:00",
- "name": "Foundation Complete",
- "priority": "high",
- "project_id": "507f1f77bcf86cd799439012",
- "related_document_ids": [
- "507f1f77bcf86cd799439014"
], - "status": "pending",
- "updated_at": "2024-01-01T00:00:00"
}
], - "programme_tasks": [
- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "project_id": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { },
- "created_by": "string",
- "updated_by": "string"
}
], - "task_executions": [
- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "task_id": "string",
- "agent_id": "string",
- "inputs": { },
- "status": "pending",
- "outputs": { },
- "error": "string",
- "step_results": [
- {
- "step_id": "string",
- "step_name": "string",
- "status": "pending",
- "output": { },
- "error": "string",
- "started_at": "2019-08-24T14:15:22Z",
- "completed_at": "2019-08-24T14:15:22Z",
- "duration_ms": 0
}
], - "total_steps": 0,
- "completed_steps": 0,
- "progress_percentage": 0,
- "started_at": "2019-08-24T14:15:22Z",
- "completed_at": "2019-08-24T14:15:22Z",
- "duration_ms": 0,
- "executed_by": "string",
- "project_id": "string",
- "organization_id": "string"
}
], - "relations": {
- "milestone_to_programme_tasks": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}, - "programme_task_to_executions": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}
}, - "timing": {
- "milestone_deltas": {
- "property1": 0,
- "property2": 0
}, - "programme_task_deltas": {
- "property1": 0,
- "property2": 0
}, - "overdue_milestones": [
- "string"
], - "overdue_programme_tasks": [
- "string"
], - "critical_path": [
- "string"
]
}, - "procurement_actions": [
- {
- "programme_task_id": "string",
- "name": "string",
- "required_by": "2019-08-24T14:15:22Z",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "lead_days": 0,
- "buffer_days": 0,
- "supplier_type": "string",
- "notes": "string"
}
]
}Return milestones with their related task executions.
| project_id required | string (Project Id) |
[- {
- "milestone": {
- "_id": "507f1f77bcf86cd799439011",
- "completion_percentage": 0,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "Foundation work completed and inspected",
- "due_date": "2024-02-01T00:00:00",
- "name": "Foundation Complete",
- "priority": "high",
- "project_id": "507f1f77bcf86cd799439012",
- "related_document_ids": [
- "507f1f77bcf86cd799439014"
], - "status": "pending",
- "updated_at": "2024-01-01T00:00:00"
}, - "related_executions": [
- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "task_id": "string",
- "agent_id": "string",
- "inputs": { },
- "status": "pending",
- "outputs": { },
- "error": "string",
- "step_results": [
- {
- "step_id": "string",
- "step_name": "string",
- "status": "pending",
- "output": { },
- "error": "string",
- "started_at": "2019-08-24T14:15:22Z",
- "completed_at": "2019-08-24T14:15:22Z",
- "duration_ms": 0
}
], - "total_steps": 0,
- "completed_steps": 0,
- "progress_percentage": 0,
- "started_at": "2019-08-24T14:15:22Z",
- "completed_at": "2019-08-24T14:15:22Z",
- "duration_ms": 0,
- "executed_by": "string",
- "project_id": "string",
- "organization_id": "string"
}
], - "planned_vs_actual": {
- "planned_due": "2019-08-24T14:15:22Z",
- "actual_finish": "2019-08-24T14:15:22Z",
- "delta_days": 0
}
}
]Derive procurement actions from programme tasks for a project.
| project_id required | string (Project Id) |
[- {
- "programme_task_id": "string",
- "name": "string",
- "required_by": "2019-08-24T14:15:22Z",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "lead_days": 0,
- "buffer_days": 0,
- "supplier_type": "string",
- "notes": "string"
}
]Create a new programme task for a project.
| project_id required | string (Project Id) |
| name required | string (Name) Name of the programme task |
Description (string) or Description (null) (Description) Programme task description | |
| project_id required | string (Project Id) ID of the project this task belongs to |
Planned Start (string) or Planned Start (null) (Planned Start) Planned start date | |
Planned End (string) or Planned End (null) (Planned End) Planned end date | |
| status | string (ProgrammeTaskStatus) Default: "planned" Enum: "planned" "in_progress" "completed" "delayed" "cancelled" "on_hold" Programme task status |
| priority | string (ProgrammeTaskPriority) Default: "medium" Enum: "low" "medium" "high" "urgent" Programme task priority |
| completion_percentage | number (Completion Percentage) [ 0 .. 100 ] Default: 0 Task completion percentage (0-100) |
| dependencies | Array of strings (Dependencies) IDs of programme tasks this task depends on |
| milestone_ids | Array of strings (Milestone Ids) IDs of milestones related to this programme task |
| execution_ids | Array of strings (Execution Ids) IDs of task executions linked to this programme task |
Task Template Id (string) or Task Template Id (null) (Task Template Id) Optional task template ID used to create this programme task | |
Adjusted Start (string) or Adjusted Start (null) (Adjusted Start) Start date adjusted after slippage | |
Adjusted End (string) or Adjusted End (null) (Adjusted End) End date adjusted after slippage | |
Import Source (string) or Import Source (null) (Import Source) Source identifier for imports | |
object (Metadata) Sector-specific metadata (procurement, approvals, releases, etc.) |
{- "name": "string",
- "description": "string",
- "project_id": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { }
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "project_id": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { },
- "created_by": "string",
- "updated_by": "string"
}List all programme tasks for a specific project.
| project_id required | string (Project Id) |
[- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "project_id": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { },
- "created_by": "string",
- "updated_by": "string"
}
]Retrieve a single programme task by ID.
| task_id required | string (Task Id) |
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "project_id": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { },
- "created_by": "string",
- "updated_by": "string"
}Update an existing programme task.
| task_id required | string (Task Id) |
Name (string) or Name (null) (Name) | |
Description (string) or Description (null) (Description) | |
Planned Start (string) or Planned Start (null) (Planned Start) | |
Planned End (string) or Planned End (null) (Planned End) | |
ProgrammeTaskStatus (string) or null | |
ProgrammeTaskPriority (string) or null | |
Completion Percentage (number) or Completion Percentage (null) (Completion Percentage) | |
Array of Dependencies (strings) or Dependencies (null) (Dependencies) | |
Array of Milestone Ids (strings) or Milestone Ids (null) (Milestone Ids) | |
Array of Execution Ids (strings) or Execution Ids (null) (Execution Ids) | |
Task Template Id (string) or Task Template Id (null) (Task Template Id) | |
Adjusted Start (string) or Adjusted Start (null) (Adjusted Start) | |
Adjusted End (string) or Adjusted End (null) (Adjusted End) | |
Import Source (string) or Import Source (null) (Import Source) | |
Metadata (object) or Metadata (null) (Metadata) |
{- "name": "string",
- "description": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { }
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "project_id": "string",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "status": "planned",
- "priority": "low",
- "completion_percentage": 0,
- "dependencies": [
- "string"
], - "milestone_ids": [
- "string"
], - "execution_ids": [
- "string"
], - "task_template_id": "string",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "import_source": "string",
- "metadata": { },
- "created_by": "string",
- "updated_by": "string"
}Retrieve programme tasks in an optimized format for Gantt chart rendering.
Returns task data with:
project_id: Project ID to fetch tasks for
current_user: Current authenticated user
List of tasks optimized for Gantt chart display
| project_id required | string (Project Id) |
[- {
- "id": "string",
- "name": "string",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "dependencies": [
- "string"
], - "status": "string",
- "priority": "string",
- "completion_percentage": 0,
- "is_on_critical_path": false,
- "has_slippage": false,
- "description": "string"
}
]Propagate slippage when a task completes late.
When a task completes later than planned, this endpoint calculates the delay and automatically adjusts the start and end dates for all dependent tasks.
task_id: ID of the task that slipped
actual_completion: Actual completion datetime of the task
current_user: Current authenticated user
Dictionary with:
- affected_task_ids: List of task IDs that were adjusted
- delay_days: Number of days the task slipped
- updated_count: Number of tasks updated in database
| task_id required | string (Task Id) |
| actual_completion required | string <date-time> (Actual Completion) |
{ }Import programme tasks from a CSV file.
Expected CSV columns (case-insensitive):
project_id: Project ID to import tasks into
file: CSV file upload
current_user: Current authenticated user
Dictionary with:
- imported_count: Number of tasks successfully imported
- errors: List of error messages for failed rows
- task_ids: List of created task IDs
| project_id required | string (Project Id) |
| file required | string <binary> (File) |
{ }Import programme tasks from Microsoft Project XML exports.
| project_id required | string (Project Id) |
| file required | string <binary> (File) |
{ }Export programme tasks to Microsoft Project XML format.
Exports all programme tasks for the specified project in MSP XML format, which can be imported into Microsoft Project or other compatible tools.
The export preserves:
project_id: Project ID to export tasks from
current_user: Current authenticated user
XML file as downloadable response
| project_id required | string (Project Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Project Defaults
Configure default settings and templates for projects.
Features:
Capture defaults from the specified project.
| project_id required | string (Project Id) |
| name required | string (Name) |
Description (string) or Description (null) (Description) | |
| include_reports | boolean (Include Reports) Default: true |
| report_content_mode | string (ReportContentMode) Default: "placeholder" Enum: "original" "placeholder" How report content should be captured for blueprints. |
Placeholder Text (string) or Placeholder Text (null) (Placeholder Text) | |
| include_forms | boolean (Include Forms) Default: true |
Metadata (object) or Metadata (null) (Metadata) |
{- "name": "string",
- "description": "string",
- "include_reports": true,
- "report_content_mode": "original",
- "placeholder_text": "string",
- "include_forms": true,
- "metadata": { }
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "organization_id": "string",
- "source_project_id": "string",
- "created_by": "string",
- "description": "string",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}, - "template_snapshots": [
- {
- "template_object_id": "string",
- "template_id": "string",
- "template_name": "string",
- "version": "string",
- "scope": "project",
- "serialized_template": { }
}
], - "report_blueprints": [
- {
- "source_report_id": "string",
- "title": "string",
- "category": "Environmental",
- "format": "Text",
- "tags": [
- "string"
], - "content_mode": "original",
- "content": "string",
- "placeholder_text": "Report content to be completed",
- "grant_project_admin_access": true
}
], - "form_template_snapshots": [
- {
- "template_id": "string",
- "template_name": "string",
- "description": "string",
- "category": "string",
- "tags": [
- "string"
], - "scope": "app",
- "version_number": 0,
- "serialized_schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "serialized_ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
]
}
], - "metadata": { }
}List defaults for the current user's organization.
include_public: If True, also return generic/public project defaults (default: True)
db: Database connection
current_user: Authenticated organization user
| include_public | boolean (Include Public) Default: true |
[- {
- "id": "string",
- "name": "string",
- "description": "string",
- "source_project_id": "string",
- "created_by": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]Retrieve a specific defaults snapshot.
| defaults_id required | string (Defaults Id) |
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "string",
- "organization_id": "string",
- "source_project_id": "string",
- "created_by": "string",
- "description": "string",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}, - "template_snapshots": [
- {
- "template_object_id": "string",
- "template_id": "string",
- "template_name": "string",
- "version": "string",
- "scope": "project",
- "serialized_template": { }
}
], - "report_blueprints": [
- {
- "source_report_id": "string",
- "title": "string",
- "category": "Environmental",
- "format": "Text",
- "tags": [
- "string"
], - "content_mode": "original",
- "content": "string",
- "placeholder_text": "Report content to be completed",
- "grant_project_admin_access": true
}
], - "form_template_snapshots": [
- {
- "template_id": "string",
- "template_name": "string",
- "description": "string",
- "category": "string",
- "tags": [
- "string"
], - "scope": "app",
- "version_number": 0,
- "serialized_schema": {
- "fields": [
- {
- "id": "string",
- "type": "text",
- "label": "string",
- "placeholder": "string",
- "help_text": "string",
- "default_value": { },
- "default_value_template": "string",
- "constraints": {
- "required": false,
- "min_length": 0,
- "max_length": 0,
- "min_value": 0,
- "max_value": 0,
- "pattern": "string",
- "allowed_file_types": [
- "string"
], - "max_file_size_mb": 0,
- "max_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
]
}
]
}, - "serialized_ui_schema": {
- "layout": "vertical",
- "columns": 1,
- "field_order": [
- "string"
], - "sections": [
- { }
]
}, - "summary_config": [
- "string"
]
}
], - "metadata": { }
}Apply a defaults snapshot to an existing project.
| defaults_id required | string (Defaults Id) |
| project_id required | string (Project Id) |
{- "project_id": "string"
}{- "custom_fields_added": 0,
- "custom_field_definitions_added": 0,
- "templates_cloned": 0,
- "template_references_tracked": 0,
- "reports_created": 0,
- "form_templates_cloned": 0,
- "form_template_references_tracked": 0
}Project Management
Manage construction projects and their settings.
Features:
Retrieve a list of all projects with pagination and sorting
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
Sort By (string) or Sort By (null) (Sort By) | |
Sort Order (string) or Sort Order (null) (Sort Order) | |
| archived | boolean (Archived) Default: false Filter by archived status |
{- "items": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example project",
- "name": "Example Project",
- "organization_id": "507f1f77bcf86cd799439012",
- "status": "active",
- "tags": [
- "example",
- "demo"
], - "updated_at": "2024-01-01T00:00:00"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Create a new project with the provided data
| name required | string (Name) Name of the project |
Project Reference (string) or Project Reference (null) (Project Reference) Project reference identifier | |
Logo (string) or Logo (null) (Logo) URL to project logo | |
Location (string) or Location (null) (Location) Project location | |
Latitude (number) or Latitude (null) (Latitude) Latitude derived from the project location | |
Longitude (number) or Longitude (null) (Longitude) Longitude derived from the project location | |
ProjectPhaseEnum (string) or null Current project phase | |
Cde (string) or Cde (null) (Cde) Project CDE | |
Cde Color (string) or Cde Color (null) (Cde Color) CDE color code | |
Members (integer) or Members (null) (Members) Number of project members | |
StatusEnum (string) or null Default: "active" Project status: active, archived, or available | |
Description (string) or Description (null) (Description) Project description | |
Start Date (string) or Start Date (null) (Start Date) Project start date | |
End Date (string) or End Date (null) (End Date) Project end date | |
Budget (number) or Budget (null) (Budget) Project budget | |
Currency (string) or Currency (null) (Currency) Budget currency | |
Array of Tags (strings) or Tags (null) (Tags) Project tags | |
| archived | boolean (Archived) Default: false Whether the project is archived |
Archived At (string) or Archived At (null) (Archived At) Date and time the project was archived | |
Completion Percentage (number) or Completion Percentage (null) (Completion Percentage) Project completion percentage | |
| organization_id required | string (Organization Id) ID of the organization this project belongs to |
License Id (string) or License Id (null) (License Id) ID of the license assigned to this project | |
ProjectSettings (object) or null Settings for the project | |
object (Custom Fields) Custom key-value fields for organization-specific project data (e.g., project_number, client_name, contract_id) | |
object (Custom Field Definitions) Schema definitions for custom fields at project level. These override or extend organization-level definitions. Keys should match keys in custom_fields. | |
| created_by required | string (Created By) ID of the user creating the project |
Defaults Id (string) or Defaults Id (null) (Defaults Id) Optional project defaults snapshot to apply after creation |
{- "name": "string",
- "project_reference": "string",
- "logo": "string",
- "location": "string",
- "latitude": 0,
- "longitude": 0,
- "phase": "Initiation / Feasibility",
- "cde": "string",
- "cde_color": "string",
- "members": 0,
- "status": "active",
- "description": "string",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "budget": 0,
- "currency": "string",
- "tags": [
- "string"
], - "archived": false,
- "archived_at": "2019-08-24T14:15:22Z",
- "completion_percentage": 0,
- "organization_id": "string",
- "license_id": "string",
- "project_settings": {
- "uploads_to_pending": true,
- "uploads_to_approved": true,
- "task_priority_hours": {
- "low": 72,
- "medium": 48,
- "high": 24
}
}, - "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}, - "created_by": "string",
- "defaults_id": "string"
}{- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example project",
- "name": "Example Project",
- "organization_id": "507f1f77bcf86cd799439012",
- "status": "active",
- "tags": [
- "example",
- "demo"
], - "updated_at": "2024-01-01T00:00:00"
}Retrieve a specific project by its ID
| project_id required | string (Project Id) |
{- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example project",
- "name": "Example Project",
- "organization_id": "507f1f77bcf86cd799439012",
- "status": "active",
- "tags": [
- "example",
- "demo"
], - "updated_at": "2024-01-01T00:00:00"
}Update an existing project with the provided data
| project_id required | string (Project Id) |
Name (string) or Name (null) (Name) | |
Project Reference (string) or Project Reference (null) (Project Reference) | |
Logo (string) or Logo (null) (Logo) | |
Location (string) or Location (null) (Location) | |
Latitude (number) or Latitude (null) (Latitude) | |
Longitude (number) or Longitude (null) (Longitude) | |
ProjectPhaseEnum (string) or null | |
Cde (string) or Cde (null) (Cde) | |
Cde Color (string) or Cde Color (null) (Cde Color) | |
Members (integer) or Members (null) (Members) | |
Status (string) or Status (null) (Status) | |
Description (string) or Description (null) (Description) | |
Start Date (string) or Start Date (null) (Start Date) | |
End Date (string) or End Date (null) (End Date) | |
Budget (number) or Budget (null) (Budget) | |
Currency (string) or Currency (null) (Currency) | |
Array of Tags (strings) or Tags (null) (Tags) | |
Completion Percentage (number) or Completion Percentage (null) (Completion Percentage) | |
Updated By (string) or Updated By (null) (Updated By) | |
Archived (boolean) or Archived (null) (Archived) | |
Archived At (string) or Archived At (null) (Archived At) | |
Custom Fields (object) or Custom Fields (null) (Custom Fields) | |
Custom Field Definitions (object) or Custom Field Definitions (null) (Custom Field Definitions) |
{- "name": "string",
- "project_reference": "string",
- "logo": "string",
- "location": "string",
- "latitude": 0,
- "longitude": 0,
- "phase": "Initiation / Feasibility",
- "cde": "string",
- "cde_color": "string",
- "members": 0,
- "status": "string",
- "description": "string",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "budget": 0,
- "currency": "string",
- "tags": [
- "string"
], - "completion_percentage": 0,
- "updated_by": "string",
- "archived": true,
- "archived_at": "2019-08-24T14:15:22Z",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}
}{- "_id": "507f1f77bcf86cd799439011",
- "archived": false,
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example project",
- "name": "Example Project",
- "organization_id": "507f1f77bcf86cd799439012",
- "status": "active",
- "tags": [
- "example",
- "demo"
], - "updated_at": "2024-01-01T00:00:00"
}Get all members of a project with pagination, sorting, and their membership info
| project_id required | string (Project Id) |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
Sort By (string) or Sort By (null) (Sort By) | |
Sort Order (string) or Sort Order (null) (Sort Order) |
{- "items": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "clerk_user_id": "user_2vJxJEQkkigpll5LMweU8vcMXoL",
- "company": "Example Corp",
- "created_at": "2024-01-01T00:00:00",
- "email": "john@example.com",
- "joined_at": "2024-01-01T00:00:00",
- "membership": {
- "_id": "507f1f77bcf86cd799439013",
- "created_at": "2024-01-01T00:00:00",
- "joined_at": "2024-01-01T00:00:00",
- "project_id": "507f1f77bcf86cd799439012",
- "role": "admin",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00",
- "user_id": "507f1f77bcf86cd799439011"
}, - "name": "John Doe",
- "organization": {
- "_id": "507f1f77bcf86cd799439015",
- "created_at": "2024-01-01T00:00:00",
- "description": "An example organization",
- "name": "Example Corp",
- "updated_at": "2024-01-01T00:00:00"
}, - "organization_id": "507f1f77bcf86cd799439015",
- "project_ids": [
- "507f1f77bcf86cd799439012"
], - "role": "user",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Create or invite a project user and optionally configure their membership in a single call.
project_id: ID of the project
payload: Payload containing user data and membership details
request: FastAPI request object for accessing raw request body
db: MongoDB database instance
current_user: Current authenticated user
Project member with membership information
HTTPException: If project not found, user not authorized, or user already a member
| project_id required | string (Project Id) |
required | object (ProjectUser-Input) User profile data to create or update within the project context |
ProjectMembershipRequest (object) or null Optional membership configuration to apply for this user on the project | |
Organization Id (string) or Organization Id (null) (Organization Id) Organization that this user should belong to for the project. If provided, the user will be added to the organization's member list. |
{- "member": {
- "_id": "507f1f77bcf86cd799439011",
- "clerk_user_id": "user_2vJxJEQkkigpll5LMweU8vcMXoL",
- "company": "Example Corp",
- "created_at": "2024-01-01T00:00:00",
- "email": "john@example.com",
- "name": "John Doe",
- "role": "user",
- "updated_at": "2024-01-01T00:00:00"
}, - "membership": {
- "role": "admin",
- "status": "active",
- "project_roles": [
- "string"
], - "organization_id": "string"
}, - "organization_id": "string"
}{- "_id": "507f1f77bcf86cd799439011",
- "clerk_user_id": "user_2vJxJEQkkigpll5LMweU8vcMXoL",
- "company": "Example Corp",
- "created_at": "2024-01-01T00:00:00",
- "email": "john@example.com",
- "joined_at": "2024-01-01T00:00:00",
- "membership": {
- "_id": "507f1f77bcf86cd799439013",
- "created_at": "2024-01-01T00:00:00",
- "joined_at": "2024-01-01T00:00:00",
- "project_id": "507f1f77bcf86cd799439012",
- "role": "admin",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00",
- "user_id": "507f1f77bcf86cd799439011"
}, - "name": "John Doe",
- "organization": {
- "_id": "507f1f77bcf86cd799439015",
- "created_at": "2024-01-01T00:00:00",
- "description": "An example organization",
- "name": "Example Corp",
- "updated_at": "2024-01-01T00:00:00"
}, - "organization_id": "507f1f77bcf86cd799439015",
- "project_ids": [
- "507f1f77bcf86cd799439012"
], - "role": "user",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00"
}Remove a member from a project.
project_id: Project ID
user_id: User ID
db: MongoDB database instance
current_user: Current authenticated user
Success message
HTTPException: If user not authorized or member not found
| project_id required | string (Project Id) |
| user_id required | string (User Id) |
{- "property1": "string",
- "property2": "string"
}Update a project member's information. Admins can update any field except email, while users can only update their own information.
| project_id required | string (Project Id) |
| user_id required | string (User Id) |
Name (string) or Name (null) (Name) | |
Avatar (string) or Avatar (null) (Avatar) | |
Company (string) or Company (null) (Company) | |
Phone (string) or Phone (null) (Phone) | |
Department (string) or Department (null) (Department) | |
Location (string) or Location (null) (Location) | |
Bio (string) or Bio (null) (Bio) | |
SocialLinks (object) or null | |
Status (string) or Status (null) (Status) |
{- "name": "string",
- "avatar": "string",
- "company": "string",
- "phone": "string",
- "department": "string",
- "location": "string",
- "bio": "string",
- "social_links": {
- "linkedin": "string",
- "twitter": "string",
- "website": "string"
}, - "status": "string"
}{- "_id": "507f1f77bcf86cd799439011",
- "clerk_user_id": "user_2vJxJEQkkigpll5LMweU8vcMXoL",
- "company": "Example Corp",
- "created_at": "2024-01-01T00:00:00",
- "email": "john@example.com",
- "name": "John Doe",
- "role": "user",
- "updated_at": "2024-01-01T00:00:00"
}Get all memberships for a project with user information
| project_id required | string (Project Id) |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
Sort By (string) or Sort By (null) (Sort By) | |
Sort Order (string) or Sort Order (null) (Sort Order) |
{- "items": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "joined_at": "2024-01-01T00:00:00",
- "organization_id": "507f1f77bcf86cd799439014",
- "project_id": "507f1f77bcf86cd799439013",
- "project_roles": [
- "site_manager",
- "health_safety_officer"
], - "role": "member",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00",
- "user_id": "507f1f77bcf86cd799439012"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Add a user to a project with a specific role
| project_id required | string (Project Id) |
| user_id required | string (User Id) ID of the user |
Organization Id (string) or Organization Id (null) (Organization Id) ID of the organization the membership should be associated with | |
| role | string (ProjectRole) Default: "member" Enum: "admin" "member" "viewer" Role of the user in the project |
| status | string (Status) Default: "active" Status of the membership: active, inactive, pending |
Array of Project Roles (strings) or Project Roles (null) (Project Roles) Organization-defined project role labels to assign with this membership |
{- "user_id": "string",
- "organization_id": "string",
- "role": "admin",
- "status": "active",
- "project_roles": [
- "string"
]
}{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "joined_at": "2024-01-01T00:00:00",
- "organization_id": "507f1f77bcf86cd799439014",
- "project_id": "507f1f77bcf86cd799439013",
- "project_roles": [
- "site_manager",
- "health_safety_officer"
], - "role": "member",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00",
- "user_id": "507f1f77bcf86cd799439012"
}Update a user's role or status in a project
| project_id required | string (Project Id) |
| membership_id required | string (Membership Id) |
Organization Id (string) or Organization Id (null) (Organization Id) | |
ProjectRole (string) or null | |
Status (string) or Status (null) (Status) | |
Array of Project Roles (strings) or Project Roles (null) (Project Roles) |
{- "organization_id": "string",
- "role": "admin",
- "status": "string",
- "project_roles": [
- "string"
]
}{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "joined_at": "2024-01-01T00:00:00",
- "organization_id": "507f1f77bcf86cd799439014",
- "project_id": "507f1f77bcf86cd799439013",
- "project_roles": [
- "site_manager",
- "health_safety_officer"
], - "role": "member",
- "status": "active",
- "updated_at": "2024-01-01T00:00:00",
- "user_id": "507f1f77bcf86cd799439012"
}Create a new project invitation and send invitation email. Requires org_admin role.
| project_id required | string (Project Id) |
| email required | string (Email) Email of the user to invite |
Name (string) or Name (null) (Name) Name of the invitee | |
| role | string (Role) Default: "member" Role to assign: admin, member, viewer |
Array of Project Roles (strings) or Project Roles (null) (Project Roles) Project role labels | |
Personal Message (string) or Personal Message (null) (Personal Message) Personal message to include in invitation | |
| expires_in_days | integer (Expires In Days) [ 1 .. 30 ] Default: 7 Days until invitation expires |
{- "email": "string",
- "name": "string",
- "role": "member",
- "project_roles": [
- "string"
], - "personal_message": "string",
- "expires_in_days": 7
}{- "id": "string",
- "invitation_token": "string",
- "project_id": "string",
- "project_name": "string",
- "invitee_email": "string",
- "invitee_name": "string",
- "inviter_name": "string",
- "organization_name": "string",
- "role": "string",
- "project_roles": [
- "string"
], - "status": "pending",
- "expires_at": "2019-08-24T14:15:22Z",
- "email_sent_at": "2019-08-24T14:15:22Z",
- "email_sent_count": 0,
- "last_resent_at": "2019-08-24T14:15:22Z",
- "personal_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}List all invitations for a project. Optionally filter by status. Requires org_admin role.
| project_id required | string (Project Id) |
InvitationStatus (string) or Status (null) (Status) |
[- {
- "id": "string",
- "invitation_token": "string",
- "project_id": "string",
- "project_name": "string",
- "invitee_email": "string",
- "invitee_name": "string",
- "inviter_name": "string",
- "organization_name": "string",
- "role": "string",
- "project_roles": [
- "string"
], - "status": "pending",
- "expires_at": "2019-08-24T14:15:22Z",
- "email_sent_at": "2019-08-24T14:15:22Z",
- "email_sent_count": 0,
- "last_resent_at": "2019-08-24T14:15:22Z",
- "personal_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}
]Resend invitation email (manual reminder). Requires org_admin role.
| project_id required | string (Project Id) |
| invitation_id required | string (Invitation Id) |
{- "id": "string",
- "invitation_token": "string",
- "project_id": "string",
- "project_name": "string",
- "invitee_email": "string",
- "invitee_name": "string",
- "inviter_name": "string",
- "organization_name": "string",
- "role": "string",
- "project_roles": [
- "string"
], - "status": "pending",
- "expires_at": "2019-08-24T14:15:22Z",
- "email_sent_at": "2019-08-24T14:15:22Z",
- "email_sent_count": 0,
- "last_resent_at": "2019-08-24T14:15:22Z",
- "personal_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}Revoke a pending invitation. Requires org_admin role.
| project_id required | string (Project Id) |
| invitation_id required | string (Invitation Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Resolve short code to full share token.
short_code: Short code
db: Database client
Redirect information
HTTPException: If short code not found
| short_code required | string (Short Code) |
{ }Get invitation details by token (public, no auth required).
| token required | string (Token) |
{- "valid": true,
- "status": "string",
- "project_name": "string",
- "organization_name": "string",
- "inviter_name": "string",
- "invitee_email": "string",
- "role": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "is_expired": true
}Accept a project invitation via magic link. If user is authenticated, uses their account. If not authenticated, creates a pending user account.
| token required | string (Token) |
{- "success": true,
- "redirect_url": "string",
- "project_id": "string",
- "project_name": "string",
- "requires_signup": true,
- "user_created": false
}Generate a new QR code for a resource.
| resource_type required | string (QRCodeResourceType) Enum: "form_instance" "public_share" "project" "document" "report" Type of resource the QR code links to. |
| resource_id required | string (Resource Id) |
| display_name required | string (Display Name) |
| target_url required | string (Target Url) |
Project Id (string) or Project Id (null) (Project Id) | |
| include_logo | boolean (Include Logo) Default: true |
object (Metadata) |
{- "resource_type": "form_instance",
- "resource_id": "string",
- "display_name": "string",
- "target_url": "string",
- "project_id": "string",
- "include_logo": true,
- "metadata": { }
}{- "id": "string",
- "resource_type": "form_instance",
- "resource_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "display_name": "string",
- "target_url": "string",
- "storage_key": "string",
- "qr_code_url": "string",
- "include_logo": true,
- "access_count": 0,
- "last_accessed_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}List QR codes for the organization.
QRCodeResourceType (string) or Resource Type (null) (Resource Type) | |
Project Id (string) or Project Id (null) (Project Id) | |
| page | integer (Page) >= 1 Default: 1 |
| size | integer (Size) [ 1 .. 100 ] Default: 20 |
{- "items": [
- {
- "id": "string",
- "resource_type": "form_instance",
- "resource_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "display_name": "string",
- "target_url": "string",
- "storage_key": "string",
- "qr_code_url": "string",
- "include_logo": true,
- "access_count": 0,
- "last_accessed_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Get a QR code by ID.
| qr_code_id required | string (Qr Code Id) |
{- "id": "string",
- "resource_type": "form_instance",
- "resource_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "display_name": "string",
- "target_url": "string",
- "storage_key": "string",
- "qr_code_url": "string",
- "include_logo": true,
- "access_count": 0,
- "last_accessed_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Generate a QR code for a form instance.
If a QR code already exists for this instance, returns the existing one.
| instance_id required | string (Instance Id) |
Display Name (string) or Display Name (null) (Display Name) Custom display name (defaults to form title) | |
| include_logo | boolean (Include Logo) Default: true Include planops logo in center |
{- "display_name": "string",
- "include_logo": true
}{- "qr_code_id": "string",
- "qr_code_url": "string",
- "target_url": "string",
- "display_name": "string",
- "created_at": "2019-08-24T14:15:22Z"
}Get the QR code for a form instance if one exists.
| instance_id required | string (Instance Id) |
{- "id": "string",
- "resource_type": "form_instance",
- "resource_id": "string",
- "organization_id": "string",
- "project_id": "string",
- "display_name": "string",
- "target_url": "string",
- "storage_key": "string",
- "qr_code_url": "string",
- "include_logo": true,
- "access_count": 0,
- "last_accessed_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Get QR code image for a form instance directly (PNG).
Returns 404 if no QR code exists for this instance.
| instance_id required | string (Instance Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Report Generation
Generate and manage construction project reports.
Features:
Create a new report.
report: Report data to create
db: MongoDB client instance
current_user: Current authenticated user
Created report
HTTPException: If project not found or user not authorized
| title required | string (Title) Report title |
| project_id required | string (Project Id) Associated project ID |
| content required | string (Content) Report content |
| category required | string (ReportCategory) Enum: "Environmental" "Risk" "Construction" "Progress" "Financial" "Quality" "Safety" "Other" Report category |
| format required | string (ReportFormat) Enum: "Text" "Table" "Combined" Report format |
Array of objects (Sharing) Sharing permissions | |
| tags | Array of strings (Tags) Report tags |
{- "title": "string",
- "project_id": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
]
}{- "id": "string",
- "title": "string",
- "project_id": "string",
- "project_name": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "created_by": "string",
- "created_by_name": "string",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
], - "organization_id": "string",
- "is_deleted": true,
- "version": 0,
- "history": [
- {
- "version": 0,
- "changed_at": "2019-08-24T14:15:22Z",
- "changed_by": "string",
- "changed_by_name": "string",
- "changes": { },
- "previous_values": { }
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Get reports with optional filtering and pagination.
project_id: Optional project ID filter
category: Optional category filter
report_format: Optional format filter
tags: Optional tags filter (comma-separated)
created_by: Optional creator filter
search: Optional text search across title/content/tags
content_keywords: Optional comma-separated keywords to match against content
page: Page number (1-based)
size: Number of items per page
db: MongoDB client instance
current_user: Current authenticated user
Paginated response containing reports
HTTPException: If database operation fails
Project Id (string) or Project Id (null) (Project Id) Filter by project ID | |
ReportCategory (string) or Category (null) (Category) Filter by category | |
ReportFormat (string) or Report Format (null) (Report Format) Filter by format | |
Tags (string) or Tags (null) (Tags) Filter by tags (comma-separated) | |
Created By (string) or Created By (null) (Created By) Filter by creator user ID | |
Search (string) or Search (null) (Search) Text search applied to title, content, and tags | |
Content Keywords (string) or Content Keywords (null) (Content Keywords) Comma-separated keywords to match inside content for category-style discovery | |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
{- "items": [
- {
- "id": "string",
- "title": "string",
- "project_id": "string",
- "project_name": "string",
- "category": "Environmental",
- "format": "Text",
- "created_by": "string",
- "created_by_name": "string",
- "tags": [
- "string"
], - "version": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Fetch multiple reports in a single request.
request: Batch request containing list of report IDs
db: MongoDB client instance
current_user: Current authenticated user
Batch response containing fetched reports and not found IDs
HTTPException: If database operation fails
| report_ids | Array of strings (Report Ids) List of report IDs to fetch |
{- "report_ids": [
- "string"
]
}{- "reports": [
- {
- "id": "string",
- "title": "string",
- "project_id": "string",
- "project_name": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "created_by": "string",
- "created_by_name": "string",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
], - "organization_id": "string",
- "is_deleted": true,
- "version": 0,
- "history": [
- {
- "version": 0,
- "changed_at": "2019-08-24T14:15:22Z",
- "changed_by": "string",
- "changed_by_name": "string",
- "changes": { },
- "previous_values": { }
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "not_found": [
- "string"
]
}Get a specific report with associated comments.
report_id: ID of report to retrieve
db: MongoDB client instance
current_user: Current authenticated user
Report data with comments
HTTPException: If report not found or user not authorized
| report_id required | string (Report Id) |
{- "id": "string",
- "title": "string",
- "project_id": "string",
- "project_name": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "created_by": "string",
- "created_by_name": "string",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
], - "organization_id": "string",
- "is_deleted": true,
- "version": 0,
- "history": [
- {
- "version": 0,
- "changed_at": "2019-08-24T14:15:22Z",
- "changed_by": "string",
- "changed_by_name": "string",
- "changes": { },
- "previous_values": { }
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "comments": [
- {
- "_id": "string",
- "content": "string",
- "created_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string",
- "avatar": "string"
}, - "entity_type": "string",
- "entity_id": "string",
- "project_id": "string",
- "parent_id": "string",
- "mentions": [
- "string"
], - "attachments": [
- { }
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": "string"
}
], - "created_by_user": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string",
- "avatar": "string"
}
}Update a report.
report_id: ID of report to update
report_update: Report update data
db: MongoDB client instance
current_user: Current authenticated user
Updated report
HTTPException: If report not found or user not authorized
| report_id required | string (Report Id) |
Title (string) or Title (null) (Title) Report title | |
Content (string) or Content (null) (Content) Report content | |
ReportCategory (string) or null Report category | |
ReportFormat (string) or null Report format | |
Array of Sharing (objects) or Sharing (null) (Sharing) Sharing permissions | |
Array of Tags (strings) or Tags (null) (Tags) Report tags |
{- "title": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
]
}{- "id": "string",
- "title": "string",
- "project_id": "string",
- "project_name": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "created_by": "string",
- "created_by_name": "string",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
], - "organization_id": "string",
- "is_deleted": true,
- "version": 0,
- "history": [
- {
- "version": 0,
- "changed_at": "2019-08-24T14:15:22Z",
- "changed_by": "string",
- "changed_by_name": "string",
- "changes": { },
- "previous_values": { }
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Delete a report (soft delete).
report_id: ID of report to delete
db: MongoDB client instance
current_user: Current authenticated user
Success message
HTTPException: If report not found or user not authorized
| report_id required | string (Report Id) |
{- "property1": "string",
- "property2": "string"
}Get report change history.
report_id: ID of report to get history for
db: MongoDB client instance
current_user: Current authenticated user
page: Page number (1-based)
size: Number of items per page
Paginated history entries
HTTPException: If report not found or user not authorized
| report_id required | string (Report Id) |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
{- "items": [
- { }
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Get previous versions of a report.
report_id: ID of report to get versions for
version: Optional specific version number to retrieve
db: MongoDB client instance
current_user: Current authenticated user
page: Page number (1-based)
size: Number of items per page
Paginated previous versions, each containing version number and report data.
If version parameter is provided, returns only that version if it exists.
HTTPException: If report not found, user not authorized, or version not found
| report_id required | string (Report Id) |
Version (integer) or Version (null) (Version) Optional specific version number to retrieve | |
| page | integer (Page) >= 1 Default: 1 Page number |
| size | integer (Size) [ 1 .. 100 ] Default: 10 Number of items per page |
{- "items": [
- { }
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0
}Search & Discovery
Search across all project content including documents, tasks, and forms.
Features:
Unified search across all entity types.
Supports:
request: FastAPI request
query: Search query string
entity_types: Entity types to search (empty = all)
response_mode: Response format (flat or grouped)
project_id: Filter by project ID
organization_id: Filter by organization ID
start_date: Filter by start date
end_date: Filter by end date
use_semantic_search: Enable semantic search
include_highlights: Include text highlighting
page: Page number
page_size: Results per page
db: MongoDB client instance
current_user: Current authenticated user
SearchResponse (flat) or GroupedSearchResponse (grouped)
HTTPException: If search fails
| query | string (Query) Default: "" Search query (optional, returns all matching entities when empty) |
| entity_types | Array of strings (Entity Types) Default: "" Items Enum: "document" "task" "comment" "query" "project" "user" "agent" "organization" "meeting" "milestone" "workflow" "form_template" "form_submission" "report" "virtual_document" "notification" "programme" Entity types to search in (empty = all) |
| response_mode | string (ResponseMode) Default: "flat" Enum: "flat" "grouped" Response format: 'flat' (unified list) or 'grouped' (by entity type) |
Project Id (string) or Project Id (null) (Project Id) Project ID to filter by | |
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID to filter by | |
Start Date (string) or Start Date (null) (Start Date) Start date to filter by | |
End Date (string) or End Date (null) (End Date) End date to filter by | |
| use_semantic_search | boolean (Use Semantic Search) Default: false Enable semantic/vector search |
| include_highlights | boolean (Include Highlights) Default: true Include text highlighting |
| page | integer (Page) >= 1 Default: 1 Page number |
| page_size | integer (Page Size) [ 1 .. 100 ] Default: 20 Results per page |
{- "results": [
- {
- "id": "string",
- "entity_type": "document",
- "title": "string",
- "description": "string",
- "project_id": "string",
- "project_name": "string",
- "organization_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "score": 0,
- "result_type": "text",
- "thumbnail_url": "string",
- "image_url": "string",
- "metadata": { },
- "highlights": [
- {
- "field": "string",
- "snippet": "string",
- "positions": [
- [
- 0,
- 0
]
]
}
]
}
], - "total": 0,
- "page": 0,
- "page_size": 0,
- "has_more": true,
- "query_time_ms": 0
}Unified search across all entity types.
Supports:
request: FastAPI request
query: Search query string
entity_types: Entity types to search (empty = all)
response_mode: Response format (flat or grouped)
project_id: Filter by project ID
organization_id: Filter by organization ID
start_date: Filter by start date
end_date: Filter by end date
use_semantic_search: Enable semantic search
include_highlights: Include text highlighting
page: Page number
page_size: Results per page
db: MongoDB client instance
current_user: Current authenticated user
SearchResponse (flat) or GroupedSearchResponse (grouped)
HTTPException: If search fails
| query | string (Query) Default: "" Search query (optional, returns all matching entities when empty) |
| entity_types | Array of strings (Entity Types) Default: "" Items Enum: "document" "task" "comment" "query" "project" "user" "agent" "organization" "meeting" "milestone" "workflow" "form_template" "form_submission" "report" "virtual_document" "notification" "programme" Entity types to search in (empty = all) |
| response_mode | string (ResponseMode) Default: "flat" Enum: "flat" "grouped" Response format: 'flat' (unified list) or 'grouped' (by entity type) |
Project Id (string) or Project Id (null) (Project Id) Project ID to filter by | |
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID to filter by | |
Start Date (string) or Start Date (null) (Start Date) Start date to filter by | |
End Date (string) or End Date (null) (End Date) End date to filter by | |
| use_semantic_search | boolean (Use Semantic Search) Default: false Enable semantic/vector search |
| include_highlights | boolean (Include Highlights) Default: true Include text highlighting |
| page | integer (Page) >= 1 Default: 1 Page number |
| page_size | integer (Page Size) [ 1 .. 100 ] Default: 20 Results per page |
{- "results": [
- {
- "id": "string",
- "entity_type": "document",
- "title": "string",
- "description": "string",
- "project_id": "string",
- "project_name": "string",
- "organization_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "score": 0,
- "result_type": "text",
- "thumbnail_url": "string",
- "image_url": "string",
- "metadata": { },
- "highlights": [
- {
- "field": "string",
- "snippet": "string",
- "positions": [
- [
- 0,
- 0
]
]
}
]
}
], - "total": 0,
- "page": 0,
- "page_size": 0,
- "has_more": true,
- "query_time_ms": 0
}Progressive search via Server-Sent Events.
Streams results in two phases:
SSE Events:
initial_results: Fast text search resultssemantic_update: Updated results with semantic document matches merged inerror: If semantic search fails (text results already delivered)done: Search complete| query | string (Query) Default: "" Search query |
| entity_types | Array of strings (Entity Types) Default: "" Items Enum: "document" "task" "comment" "query" "project" "user" "agent" "organization" "meeting" "milestone" "workflow" "form_template" "form_submission" "report" "virtual_document" "notification" "programme" Entity types to search in (empty = all) |
Project Id (string) or Project Id (null) (Project Id) Project ID to filter by | |
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID to filter by | |
Start Date (string) or Start Date (null) (Start Date) Start date to filter by | |
End Date (string) or End Date (null) (End Date) End date to filter by | |
| include_highlights | boolean (Include Highlights) Default: true Include text highlighting |
| page | integer (Page) >= 1 Default: 1 Page number |
| page_size | integer (Page Size) [ 1 .. 100 ] Default: 20 Results per page |
nullProgressive search via Server-Sent Events.
Streams results in two phases:
SSE Events:
initial_results: Fast text search resultssemantic_update: Updated results with semantic document matches merged inerror: If semantic search fails (text results already delivered)done: Search complete| query | string (Query) Default: "" Search query |
| entity_types | Array of strings (Entity Types) Default: "" Items Enum: "document" "task" "comment" "query" "project" "user" "agent" "organization" "meeting" "milestone" "workflow" "form_template" "form_submission" "report" "virtual_document" "notification" "programme" Entity types to search in (empty = all) |
Project Id (string) or Project Id (null) (Project Id) Project ID to filter by | |
Organization Id (string) or Organization Id (null) (Organization Id) Organization ID to filter by | |
Start Date (string) or Start Date (null) (Start Date) Start date to filter by | |
End Date (string) or End Date (null) (End Date) End date to filter by | |
| include_highlights | boolean (Include Highlights) Default: true Include text highlighting |
| page | integer (Page) >= 1 Default: 1 Page number |
| page_size | integer (Page Size) [ 1 .. 100 ] Default: 20 Results per page |
nullTask Management
Create, assign, and track tasks within construction projects.
Features:
List tasks for a project with optional filtering.
project_id: Project ID
status: Filter by task status
assigned_to: Filter by assigned user ID
current_user: Current authenticated user
List of tasks matching the criteria
HTTPException: If project not found or user not authorized
| project_id required | string (Project Id) |
Status (string) or Status (null) (Status) | |
Assigned To (string) or Assigned To (null) (Assigned To) |
[- {
- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example task",
- "name": "Example Task",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_object_id": "507f1f77bcf86cd799439014",
- "related_object_type": "document",
- "status": "pending",
- "updated_at": "2024-01-01T00:00:00"
}
]Create a new task for a project.
project_id: Project ID
task: Task data
current_user: Current authenticated user
db: Database connection (MongoDB or AsyncIOMotorClient)
Created task data
HTTPException: If project not found
| project_id required | string (Project Id) |
| name required | string (Name) Name of the task |
Description (string) or Description (null) (Description) Task description | |
| assignment_type | string (AssignmentType) Default: "user" Enum: "user" "agent_task" Type of assignment: user or agent_task |
Assigned To (string) or Assigned To (null) (Assigned To) ID of the assigned user (can be string or PyObjectId) | |
Assigned Agent Id (string) or Assigned Agent Id (null) (Assigned Agent Id) Agent ID if assignment_type=AGENT_TASK | |
Assigned Agent Task Id (string) or Assigned Agent Task Id (null) (Assigned Agent Task Id) Agent task_id if assignment_type=AGENT_TASK | |
Agent Task Inputs (object) or Agent Task Inputs (null) (Agent Task Inputs) Input parameters for the agent task | |
| status | string (Status) Default: "pending" Task status |
| priority | string (TaskPriority) Default: "medium" Enum: "low" "medium" "high" Task priority |
Due Date (string) or Due Date (null) (Due Date) Task due date | |
Estimated Hours (number) or Estimated Hours (null) (Estimated Hours) Estimated hours to complete | |
Actual Hours (number) or Actual Hours (null) (Actual Hours) Actual hours spent | |
Completion Percentage (number) or Completion Percentage (null) (Completion Percentage) Task completion percentage | |
| tags | Array of strings (Tags) Task tags |
| dependencies | Array of strings (Dependencies) IDs of tasks this task depends on |
Related Object Id (string) or Related Object Id (null) (Related Object Id) ID of the related object (e.g., document) this task is associated with | |
Related Object Type (string) or Related Object Type (null) (Related Object Type) Type of the related object (e.g., 'document', 'workspace_item') | |
Project Id (string) or Project Id (null) (Project Id) ID of the project this task belongs to | |
Created By (string) or Created By (null) (Created By) ID of the user creating the task | |
Closed Reason (string) or Closed Reason (null) (Closed Reason) Human-readable reason why the task was automatically closed | |
TaskClosureReason (string) or null Machine-readable reason code for automatic task closure | |
TaskSchedule (object) or null Scheduling configuration for recurring or one-time execution |
{- "name": "string",
- "description": "string",
- "assignment_type": "user",
- "assigned_to": "string",
- "assigned_agent_id": "string",
- "assigned_agent_task_id": "string",
- "agent_task_inputs": { },
- "status": "pending",
- "priority": "low",
- "due_date": "2019-08-24T14:15:22Z",
- "estimated_hours": 0,
- "actual_hours": 0,
- "completion_percentage": 0,
- "tags": [
- "string"
], - "dependencies": [
- "string"
], - "related_object_id": "string",
- "related_object_type": "string",
- "project_id": "string",
- "created_by": "string",
- "closed_reason": "string",
- "closed_reason_code": "document_revised",
- "schedule": {
- "enabled": true,
- "frequency": "once",
- "interval": 0,
- "days_of_week": [
- 0
], - "day_of_month": 0,
- "cron_expression": "string",
- "time_of_day": "string",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "last_execution": "2019-08-24T14:15:22Z",
- "next_execution": "2019-08-24T14:15:22Z"
}
}{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example task",
- "name": "Example Task",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_object_id": "507f1f77bcf86cd799439014",
- "related_object_type": "document",
- "status": "pending",
- "updated_at": "2024-01-01T00:00:00"
}Get task by ID with associated comments and user information.
task_id: Task ID
current_user: Current authenticated user
Task data with associated comments and user information
HTTPException: If task not found or user not authorized
| task_id required | string (Task Id) |
{- "_id": "507f1f77bcf86cd799439011",
- "assigned_user": {
- "_id": "507f1f77bcf86cd799439013",
- "company": "Example Corp",
- "email": "john@example.com",
- "name": "John Doe"
}, - "comments": [
- {
- "_id": "507f1f77bcf86cd799439015",
- "content": "Example comment",
- "created_at": "2024-01-01T00:00:00",
- "created_by": {
- "_id": "507f1f77bcf86cd799439013",
- "company": "Example Corp",
- "email": "john@example.com",
- "name": "John Doe"
}, - "entity_id": "507f1f77bcf86cd799439011",
- "entity_type": "task",
- "project_id": "507f1f77bcf86cd799439012"
}
], - "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "created_by_user": {
- "_id": "507f1f77bcf86cd799439013",
- "company": "Example Corp",
- "email": "john@example.com",
- "name": "John Doe"
}, - "description": "An example task",
- "name": "Example Task",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_object_id": "507f1f77bcf86cd799439014",
- "related_object_type": "document",
- "status": "pending",
- "updated_at": "2024-01-01T00:00:00"
}Update a task.
task_id: Task ID
updates: Task updates
current_user: Current authenticated user
Updated task data
HTTPException: If user not authorized or task not found
| task_id required | string (Task Id) |
Name (string) or Name (null) (Name) | |
Description (string) or Description (null) (Description) | |
AssignmentType (string) or null | |
Assigned To (string) or Assigned To (null) (Assigned To) | |
Assigned Agent Id (string) or Assigned Agent Id (null) (Assigned Agent Id) | |
Assigned Agent Task Id (string) or Assigned Agent Task Id (null) (Assigned Agent Task Id) | |
Agent Task Inputs (object) or Agent Task Inputs (null) (Agent Task Inputs) | |
Status (string) or Status (null) (Status) | |
TaskPriority (string) or null | |
Due Date (string) or Due Date (null) (Due Date) | |
Estimated Hours (number) or Estimated Hours (null) (Estimated Hours) | |
Actual Hours (number) or Actual Hours (null) (Actual Hours) | |
Completion Percentage (number) or Completion Percentage (null) (Completion Percentage) | |
Array of Tags (strings) or Tags (null) (Tags) | |
Array of Dependencies (strings) or Dependencies (null) (Dependencies) | |
Related Object Id (string) or Related Object Id (null) (Related Object Id) | |
Related Object Type (string) or Related Object Type (null) (Related Object Type) | |
Updated By (string) or Updated By (null) (Updated By) | |
Closed Reason (string) or Closed Reason (null) (Closed Reason) | |
TaskClosureReason (string) or null | |
TaskSchedule (object) or null |
{- "name": "string",
- "description": "string",
- "assignment_type": "user",
- "assigned_to": "string",
- "assigned_agent_id": "string",
- "assigned_agent_task_id": "string",
- "agent_task_inputs": { },
- "status": "string",
- "priority": "low",
- "due_date": "2019-08-24T14:15:22Z",
- "estimated_hours": 0,
- "actual_hours": 0,
- "completion_percentage": 0,
- "tags": [
- "string"
], - "dependencies": [
- "string"
], - "related_object_id": "string",
- "related_object_type": "string",
- "updated_by": "string",
- "closed_reason": "string",
- "closed_reason_code": "document_revised",
- "schedule": {
- "enabled": true,
- "frequency": "once",
- "interval": 0,
- "days_of_week": [
- 0
], - "day_of_month": 0,
- "cron_expression": "string",
- "time_of_day": "string",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "last_execution": "2019-08-24T14:15:22Z",
- "next_execution": "2019-08-24T14:15:22Z"
}
}{- "_id": "507f1f77bcf86cd799439011",
- "created_at": "2024-01-01T00:00:00",
- "created_by": "507f1f77bcf86cd799439013",
- "description": "An example task",
- "name": "Example Task",
- "priority": "medium",
- "project_id": "507f1f77bcf86cd799439012",
- "related_object_id": "507f1f77bcf86cd799439014",
- "related_object_type": "document",
- "status": "pending",
- "updated_at": "2024-01-01T00:00:00"
}Delete a task.
task_id: Task ID
current_user: Current authenticated user
db: Database connection (MongoDB or AsyncIOMotorClient)
Success message
HTTPException: If task not found or user not authorized
| task_id required | string (Task Id) |
{- "property1": "string",
- "property2": "string"
}Virtual Documents
Manage virtual document templates and instances.
Features:
Create a new document template.
| template_id required | string (Template Id) Unique template slug identifier |
| template_name required | string (Template Name) |
| template_type required | string (DocumentTemplateType) Enum: "health_safety_plan" "method_statement" "risk_assessment" "construction_plan" "quality_plan" "environmental_plan" "inspection_report" "compliance_report" "project_report" "project_document" "general_report" "general_document" Supported virtual document template types. |
| scope | string (TemplateScope-Input) Default: "org" Enum: "app" "org" "project" Template visibility scope: 'app' for app-wide system templates, 'org' for organization-wide (default), 'project' for project-specific. |
| version required | string (Version) Semantic version string, e.g. 1.0.0 |
| major_version required | integer (Major Version) |
| minor_version required | integer (Minor Version) |
| patch_version required | integer (Patch Version) |
| description | string (Description) Default: "" |
| author_user_id | string (Author User Id) Default: "" Author user ID (optional - will be set from authenticated user if empty) |
Organization Id (string) or Organization Id (null) (Organization Id) Organization that owns this template (null for app-scoped templates) | |
| project_ids | Array of strings (Project Ids) |
Requires License Feature (string) or Requires License Feature (null) (Requires License Feature) | |
object (Custom Fields) Template-specific custom values | |
object (Custom Field Definitions) Schema definitions for template custom fields | |
UserInputSchema (object) or null Declarative schema for collecting per-template user inputs. When present, the frontend can render fields without hardcoding. | |
Array of objects (Sections) | |
Array of objects (Data Bindings) | |
Array of objects (Conditional Sections) | |
Array of objects (Computed Fields) | |
Array of objects (Validation Rules) | |
| output_format | string (OutputFormat) Default: "html" Enum: "html" "markdown" "json" Supported rendering formats. |
PDFSettings (object) or null | |
| regulatory_references | Array of strings (Regulatory References) |
Array of objects (Required Approvals) | |
| retention_period_days | integer (Retention Period Days) Default: 2555 |
| status | string (TemplateStatus) Default: "draft" Enum: "draft" "review" "approved" "published" "archived" Lifecycle status for document templates. |
Published At (string) or Published At (null) (Published At) | |
| is_active | boolean (Is Active) Default: true |
| created_at | string <date-time> (Created At) |
| updated_at | string <date-time> (Updated At) |
Estimated Iu (number) or Estimated Iu (null) (Estimated Iu) Estimated Intelligence Units (IU) cost for generating a document from this template. Based on section count: up to 4 sections = 1 IU, +1 IU per 2 additional sections. | |
Iu Pricing Note (string) or Iu Pricing Note (null) (Iu Pricing Note) Human-readable explanation of the IU pricing for this template. Example: '1 IU (4 sections)' or '3 IU (8 sections)'. | |
Default Source Template Id (string) or Default Source Template Id (null) (Default Source Template Id) Reference to the original template when cloned from defaults. | |
Default Snapshot Id (string) or Default Snapshot Id (null) (Default Snapshot Id) Project defaults identifier if created during defaults application. | |
RevisionSummaryConfig (object) or null Optional configuration for persisting revision difference summaries. |
{- "template_id": "string",
- "template_name": "string",
- "template_type": "health_safety_plan",
- "scope": "app",
- "version": "string",
- "major_version": 0,
- "minor_version": 0,
- "patch_version": 0,
- "description": "",
- "author_user_id": "",
- "organization_id": "string",
- "project_ids": [
- "string"
], - "requires_license_feature": "string",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}, - "user_input_schema": {
- "fields": [
- {
- "field_name": "string",
- "field_type": "string",
- "label": "string",
- "description": "string",
- "required": false,
- "filter": { },
- "options": [
- { }
]
}
]
}, - "sections": [
- {
- "section_id": "string",
- "section_number": "string",
- "title": "string",
- "description": "string",
- "content_type": "static",
- "static_content": "string",
- "data_binding_ref": "string",
- "template_string": "string",
- "subsections": [
- { }
], - "include_in_toc": true,
- "page_break_before": false,
- "required": true,
- "css_classes": [
- "string"
], - "document_placeholders": [
- {
- "placeholder_id": "string",
- "placeholder_name": "string",
- "position": "before_content",
- "allowed_document_types": [
- "string"
], - "multiple": false,
- "required": false,
- "default_document_id": "string"
}
]
}
], - "data_bindings": [
- {
- "binding_id": "string",
- "binding_name": "string",
- "description": "string",
- "source_type": "agentcon_api",
- "source_config": { },
- "agentcon_endpoint": "string",
- "agentcon_params": { },
- "request_method": "GET",
- "request_body": { },
- "external_api_endpoint": "string",
- "external_api_params": { },
- "external_system_id": "string",
- "mongodb_collection": "string",
- "mongodb_query": { },
- "tool_name": "string",
- "tool_arguments": { },
- "transform_function": "string",
- "format_template": "string",
- "cache_ttl": 3600,
- "cache_key_template": "{binding_id}:{project_id}",
- "depends_on": [
- "string"
]
}
], - "conditional_sections": [
- {
- "section_id": "string",
- "condition": "string",
- "description": "string"
}
], - "computed_fields": [
- {
- "field_id": "string",
- "field_name": "string",
- "computation": "string",
- "depends_on": [
- "string"
], - "fallback_value": { }
}
], - "validation_rules": [
- {
- "rule_id": "string",
- "description": "string",
- "validation_expression": "string",
- "error_message": "string",
- "severity": "warning"
}
], - "output_format": "html",
- "pdf_settings": {
- "page_size": "A4",
- "margin_top": "2cm",
- "margin_bottom": "2cm",
- "margin_left": "2cm",
- "margin_right": "2cm",
- "header_template": "string",
- "footer_template": "string",
- "include_page_numbers": true,
- "watermark": "string",
- "custom_css": "string"
}, - "regulatory_references": [
- "string"
], - "required_approvals": [
- {
- "role": "string",
- "order": 0,
- "required": true
}
], - "retention_period_days": 2555,
- "status": "draft",
- "published_at": "2019-08-24T14:15:22Z",
- "is_active": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "estimated_iu": 0,
- "iu_pricing_note": "string",
- "default_source_template_id": "string",
- "default_snapshot_id": "string",
- "revision_summary_config": {
- "enabled": false,
- "summary_binding_id": "string",
- "revision_history_binding_id": "string",
- "history_summary_field": "difference_summary"
}
}{- "_id": "661f7d8a7a7b5d0012fa0a12",
- "template_id": "health-safety-plan",
- "template_name": "Construction Phase Health & Safety Plan",
- "template_type": "health_safety_plan",
- "version": "1.0.0"
}List available templates with optional filters.
By default includes app-scoped templates along with organization templates.
Organization Id (string) or Organization Id (null) (Organization Id) | |
DocumentTemplateType (string) or Template Type (null) (Template Type) | |
TemplateStatus (string) or Status (null) (Status) | |
TemplateScope (string) or Scope (null) (Scope) Filter by scope: 'app' for app-wide, 'org' for organization, 'project' for project-specific. | |
| include_app_templates | boolean (Include App Templates) Default: true Include app-wide system templates in results (default: true). |
[- {
- "_id": "661f7d8a7a7b5d0012fa0a12",
- "template_id": "health-safety-plan",
- "template_name": "Construction Phase Health & Safety Plan",
- "template_type": "health_safety_plan",
- "version": "1.0.0"
}
]Retrieve a single template by ID.
Access is allowed if:
| template_id required | string (Template Id) |
{- "_id": "661f7d8a7a7b5d0012fa0a12",
- "template_id": "health-safety-plan",
- "template_name": "Construction Phase Health & Safety Plan",
- "template_type": "health_safety_plan",
- "version": "1.0.0"
}Update existing template metadata.
| template_id required | string (Template Id) |
| create_new_version | boolean (Create New Version) Default: false Create a new version instead of updating in place |
Template Name (string) or Template Name (null) (Template Name) | |
DocumentTemplateType (string) or null | |
TemplateScope (string) or null | |
Description (string) or Description (null) (Description) | |
Custom Fields (object) or Custom Fields (null) (Custom Fields) | |
Custom Field Definitions (object) or Custom Field Definitions (null) (Custom Field Definitions) | |
Array of Sections (objects) or Sections (null) (Sections) | |
Array of Data Bindings (objects) or Data Bindings (null) (Data Bindings) | |
Array of Conditional Sections (objects) or Conditional Sections (null) (Conditional Sections) | |
Array of Computed Fields (objects) or Computed Fields (null) (Computed Fields) | |
Array of Validation Rules (objects) or Validation Rules (null) (Validation Rules) | |
Array of Required Approvals (objects) or Required Approvals (null) (Required Approvals) | |
Array of Regulatory References (strings) or Regulatory References (null) (Regulatory References) | |
Array of Project Ids (strings) or Project Ids (null) (Project Ids) | |
Requires License Feature (string) or Requires License Feature (null) (Requires License Feature) | |
UserInputSchema (object) or null | |
TemplateStatus (string) or null | |
Published At (string) or Published At (null) (Published At) | |
Is Active (boolean) or Is Active (null) (Is Active) | |
PDFSettings (object) or null | |
Retention Period Days (integer) or Retention Period Days (null) (Retention Period Days) | |
RevisionSummaryConfig (object) or null |
{- "template_name": "string",
- "template_type": "health_safety_plan",
- "scope": "app",
- "description": "string",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "required": false,
- "default_value": { },
- "options": [
- "string"
], - "validation": {
- "min": 0,
- "max": 0,
- "min_length": 0,
- "max_length": 0,
- "pattern": "string",
- "min_date": "string",
- "max_date": "string"
}, - "display_order": 0,
- "category": "string",
- "visible_in_templates": true
}
}, - "sections": [
- {
- "section_id": "string",
- "section_number": "string",
- "title": "string",
- "description": "string",
- "content_type": "static",
- "static_content": "string",
- "data_binding_ref": "string",
- "template_string": "string",
- "subsections": [
- { }
], - "include_in_toc": true,
- "page_break_before": false,
- "required": true,
- "css_classes": [
- "string"
], - "document_placeholders": [
- {
- "placeholder_id": "string",
- "placeholder_name": "string",
- "position": "before_content",
- "allowed_document_types": [
- "string"
], - "multiple": false,
- "required": false,
- "default_document_id": "string"
}
]
}
], - "data_bindings": [
- {
- "binding_id": "string",
- "binding_name": "string",
- "description": "string",
- "source_type": "agentcon_api",
- "source_config": { },
- "agentcon_endpoint": "string",
- "agentcon_params": { },
- "request_method": "GET",
- "request_body": { },
- "external_api_endpoint": "string",
- "external_api_params": { },
- "external_system_id": "string",
- "mongodb_collection": "string",
- "mongodb_query": { },
- "tool_name": "string",
- "tool_arguments": { },
- "transform_function": "string",
- "format_template": "string",
- "cache_ttl": 3600,
- "cache_key_template": "{binding_id}:{project_id}",
- "depends_on": [
- "string"
]
}
], - "conditional_sections": [
- {
- "section_id": "string",
- "condition": "string",
- "description": "string"
}
], - "computed_fields": [
- {
- "field_id": "string",
- "field_name": "string",
- "computation": "string",
- "depends_on": [
- "string"
], - "fallback_value": { }
}
], - "validation_rules": [
- {
- "rule_id": "string",
- "description": "string",
- "validation_expression": "string",
- "error_message": "string",
- "severity": "warning"
}
], - "required_approvals": [
- {
- "role": "string",
- "order": 0,
- "required": true
}
], - "regulatory_references": [
- "string"
], - "project_ids": [
- "string"
], - "requires_license_feature": "string",
- "user_input_schema": {
- "fields": [
- {
- "field_name": "string",
- "field_type": "string",
- "label": "string",
- "description": "string",
- "required": false,
- "filter": { },
- "options": [
- { }
]
}
]
}, - "status": "draft",
- "published_at": "2019-08-24T14:15:22Z",
- "is_active": true,
- "pdf_settings": {
- "page_size": "A4",
- "margin_top": "2cm",
- "margin_bottom": "2cm",
- "margin_left": "2cm",
- "margin_right": "2cm",
- "header_template": "string",
- "footer_template": "string",
- "include_page_numbers": true,
- "watermark": "string",
- "custom_css": "string"
}, - "retention_period_days": 0,
- "revision_summary_config": {
- "enabled": false,
- "summary_binding_id": "string",
- "revision_history_binding_id": "string",
- "history_summary_field": "difference_summary"
}
}{- "_id": "661f7d8a7a7b5d0012fa0a12",
- "template_id": "health-safety-plan",
- "template_name": "Construction Phase Health & Safety Plan",
- "template_type": "health_safety_plan",
- "version": "1.0.0"
}Get all document placeholders defined in a template.
| template_id required | string (Template Id) |
[- {
- "placeholder_id": "string",
- "placeholder_name": "string",
- "position": 0,
- "allowed_document_types": [
- "string"
], - "multiple": true,
- "required": true,
- "section_id": "string",
- "section_title": "string"
}
]Get per-project defaults for a template.
| template_id required | string (Template Id) |
| project_id required | string (Project Id) Project ID for which to fetch defaults |
{- "project_id": "string",
- "template_id": "string",
- "defaults": { }
}Create or update per-project defaults for a template.
| template_id required | string (Template Id) |
| project_id required | string (Project Id) |
| template_id required | string (Template Id) |
object (Defaults) |
{- "project_id": "string",
- "template_id": "string",
- "defaults": { }
}{- "project_id": "string",
- "template_id": "string",
- "defaults": { }
}Validate that a document reference is valid and accessible.
| document_id required | string (Document Id) |
| reference_type required | string (Reference Type) |
Array of Pages (integers) or Pages (null) (Pages) |
{- "document_id": "string",
- "reference_type": "string",
- "pages": [
- 0
]
}{ }Return a concise summary of the differences between the latest revisions.
| template_id required | string (Template Id) |
| project_id required | string (Project Id) Project ID that owns the template document |
Document Id (string) or Document Id (null) (Document Id) Optional explicit document to compare; defaults to the latest version | |
| max_changes | integer (Max Changes) [ 1 .. 50 ] Default: 12 Limit the number of change entries shared with the summarizer |
{- "project_id": "string",
- "document_id": "string",
- "max_changes": 12
}{- "template_id": "string",
- "project_id": "string",
- "summary": "string",
- "agent_summary": "string",
- "current_document_id": "string",
- "previous_document_id": "string",
- "current_version_number": 0,
- "previous_version_number": 0,
- "change_count": 0,
- "changes": [
- {
- "section_id": "string",
- "change_type": "content_modified",
- "description": "string",
- "old_value": "string",
- "new_value": "string"
}
]
}Generate a virtual document from template and project data.
| template_id required | string (Template Id) |
| project_id required | string (Project Id) |
Title (string) or Title (null) (Title) Custom title for the generated document (overrides template default) | |
object (User Inputs) Default: {} | |
Array of objects (Document References) References to documents to insert into the virtual document |
{- "template_id": "string",
- "project_id": "string",
- "title": "string",
- "user_inputs": { },
- "document_references": [
- {
- "document_id": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}
}
]
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "document_id": "string",
- "template_id": "string",
- "template_version": "string",
- "project_id": "string",
- "organization_id": "string",
- "created_by_user_id": "string",
- "title": "string",
- "document_type": "health_safety_plan",
- "generated_at": "2019-08-24T14:15:22Z",
- "generation_trigger": "manual",
- "generation_duration_ms": 0,
- "content": "string",
- "content_r2_key": "string",
- "content_format": "html",
- "content_hash": "string",
- "content_size_bytes": 0,
- "data_snapshot": { },
- "data_snapshot_r2_key": "string",
- "data_snapshot_hash": "string",
- "data_snapshot_size_bytes": 0,
- "data_sources_used": [
- {
- "binding_id": "string",
- "source_type": "agentcon_api",
- "source_identifier": "string",
- "fetched_at": "2019-08-24T14:15:22Z",
- "fetch_duration_ms": 0,
- "record_count": 0,
- "data_hash": "string",
- "cache_hit": false
}
], - "version_number": 1,
- "is_current": true,
- "supersedes": "string",
- "status": "draft",
- "validation_results": [
- {
- "rule_id": "string",
- "passed": true,
- "message": "string",
- "severity": "warning"
}
], - "is_valid": true,
- "approval_status": "pending",
- "approvals": [
- {
- "approval_id": "string",
- "approver_user_id": "string",
- "approver_name": "string",
- "approver_role": "string",
- "required": true,
- "status": "pending",
- "comments": "string",
- "approved_at": "2019-08-24T14:15:22Z",
- "order": 0
}
], - "pdf_exports": [
- {
- "export_id": "string",
- "exported_at": "2019-08-24T14:15:22Z",
- "exported_by_user_id": "string",
- "r2_path": "string",
- "file_size": 0,
- "purpose": "string",
- "digital_signature": "string",
- "agentcon_document_id": "string"
}
], - "valid_from": "2019-08-24T14:15:22Z",
- "valid_until": "2019-08-24T14:15:22Z",
- "invalidation_reason": "string",
- "changes_from_previous": [
- {
- "section_id": "string",
- "change_type": "content_modified",
- "description": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "document_references": [
- {
- "document_id": "string",
- "document_title": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}, - "inserted_at": "2019-08-24T14:15:22Z"
}
], - "revision_summary": "string"
}Retrieve a generated virtual document.
| document_id required | string (Document Id) |
| include_data_snapshot | boolean (Include Data Snapshot) Default: false |
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "document_id": "string",
- "template_id": "string",
- "template_version": "string",
- "project_id": "string",
- "organization_id": "string",
- "created_by_user_id": "string",
- "title": "string",
- "document_type": "health_safety_plan",
- "generated_at": "2019-08-24T14:15:22Z",
- "generation_trigger": "manual",
- "generation_duration_ms": 0,
- "content": "string",
- "content_r2_key": "string",
- "content_format": "html",
- "content_hash": "string",
- "content_size_bytes": 0,
- "data_snapshot": { },
- "data_snapshot_r2_key": "string",
- "data_snapshot_hash": "string",
- "data_snapshot_size_bytes": 0,
- "data_sources_used": [
- {
- "binding_id": "string",
- "source_type": "agentcon_api",
- "source_identifier": "string",
- "fetched_at": "2019-08-24T14:15:22Z",
- "fetch_duration_ms": 0,
- "record_count": 0,
- "data_hash": "string",
- "cache_hit": false
}
], - "version_number": 1,
- "is_current": true,
- "supersedes": "string",
- "status": "draft",
- "validation_results": [
- {
- "rule_id": "string",
- "passed": true,
- "message": "string",
- "severity": "warning"
}
], - "is_valid": true,
- "approval_status": "pending",
- "approvals": [
- {
- "approval_id": "string",
- "approver_user_id": "string",
- "approver_name": "string",
- "approver_role": "string",
- "required": true,
- "status": "pending",
- "comments": "string",
- "approved_at": "2019-08-24T14:15:22Z",
- "order": 0
}
], - "pdf_exports": [
- {
- "export_id": "string",
- "exported_at": "2019-08-24T14:15:22Z",
- "exported_by_user_id": "string",
- "r2_path": "string",
- "file_size": 0,
- "purpose": "string",
- "digital_signature": "string",
- "agentcon_document_id": "string"
}
], - "valid_from": "2019-08-24T14:15:22Z",
- "valid_until": "2019-08-24T14:15:22Z",
- "invalidation_reason": "string",
- "changes_from_previous": [
- {
- "section_id": "string",
- "change_type": "content_modified",
- "description": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "document_references": [
- {
- "document_id": "string",
- "document_title": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}, - "inserted_at": "2019-08-24T14:15:22Z"
}
], - "revision_summary": "string"
}Update a virtual document in place or create a new version.
| document_id required | string (Document Id) |
| create_new_version | boolean (Create New Version) Default: false Create a new document version based on updates |
Title (string) or Title (null) (Title) | |
Metadata (object) or Metadata (null) (Metadata) | |
VirtualDocumentStatus (string) or null | |
ApprovalStatus (string) or null | |
Content (string) or Content (null) (Content) | |
OutputFormat (string) or null | |
User Inputs (object) or User Inputs (null) (User Inputs) | |
Array of Document References (objects) or Document References (null) (Document References) |
{- "title": "string",
- "metadata": { },
- "status": "draft",
- "approval_status": "pending",
- "content": "string",
- "content_format": "html",
- "user_inputs": { },
- "document_references": [
- {
- "document_id": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}
}
]
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "document_id": "string",
- "template_id": "string",
- "template_version": "string",
- "project_id": "string",
- "organization_id": "string",
- "created_by_user_id": "string",
- "title": "string",
- "document_type": "health_safety_plan",
- "generated_at": "2019-08-24T14:15:22Z",
- "generation_trigger": "manual",
- "generation_duration_ms": 0,
- "content": "string",
- "content_r2_key": "string",
- "content_format": "html",
- "content_hash": "string",
- "content_size_bytes": 0,
- "data_snapshot": { },
- "data_snapshot_r2_key": "string",
- "data_snapshot_hash": "string",
- "data_snapshot_size_bytes": 0,
- "data_sources_used": [
- {
- "binding_id": "string",
- "source_type": "agentcon_api",
- "source_identifier": "string",
- "fetched_at": "2019-08-24T14:15:22Z",
- "fetch_duration_ms": 0,
- "record_count": 0,
- "data_hash": "string",
- "cache_hit": false
}
], - "version_number": 1,
- "is_current": true,
- "supersedes": "string",
- "status": "draft",
- "validation_results": [
- {
- "rule_id": "string",
- "passed": true,
- "message": "string",
- "severity": "warning"
}
], - "is_valid": true,
- "approval_status": "pending",
- "approvals": [
- {
- "approval_id": "string",
- "approver_user_id": "string",
- "approver_name": "string",
- "approver_role": "string",
- "required": true,
- "status": "pending",
- "comments": "string",
- "approved_at": "2019-08-24T14:15:22Z",
- "order": 0
}
], - "pdf_exports": [
- {
- "export_id": "string",
- "exported_at": "2019-08-24T14:15:22Z",
- "exported_by_user_id": "string",
- "r2_path": "string",
- "file_size": 0,
- "purpose": "string",
- "digital_signature": "string",
- "agentcon_document_id": "string"
}
], - "valid_from": "2019-08-24T14:15:22Z",
- "valid_until": "2019-08-24T14:15:22Z",
- "invalidation_reason": "string",
- "changes_from_previous": [
- {
- "section_id": "string",
- "change_type": "content_modified",
- "description": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "document_references": [
- {
- "document_id": "string",
- "document_title": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}, - "inserted_at": "2019-08-24T14:15:22Z"
}
], - "revision_summary": "string"
}List virtual documents for a given project.
| project_id required | string (Project Id) |
DocumentTemplateType (string) or Template Type (null) (Template Type) | |
| current_only | boolean (Current Only) Default: true |
[- {
- "document_id": "string",
- "template_id": "string",
- "template_version": "string",
- "project_id": "string",
- "title": "string",
- "document_type": "health_safety_plan",
- "generated_at": "2019-08-24T14:15:22Z",
- "version_number": 0,
- "status": "draft",
- "approval_status": "pending",
- "is_current": true
}
]Return version history for a virtual document.
The group is inferred from the given document's template_id, project_id, and title.
| document_id required | string (Document Id) |
| limit | integer (Limit) [ 1 .. 100 ] Default: 10 |
| sort | string (Sort) Default: "-version_number" Sort by field, prefix '-' for desc |
{- "items": [
- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "document_id": "string",
- "template_id": "string",
- "template_version": "string",
- "project_id": "string",
- "organization_id": "string",
- "created_by_user_id": "string",
- "title": "string",
- "document_type": "health_safety_plan",
- "generated_at": "2019-08-24T14:15:22Z",
- "generation_trigger": "manual",
- "generation_duration_ms": 0,
- "content": "string",
- "content_r2_key": "string",
- "content_format": "html",
- "content_hash": "string",
- "content_size_bytes": 0,
- "data_snapshot": { },
- "data_snapshot_r2_key": "string",
- "data_snapshot_hash": "string",
- "data_snapshot_size_bytes": 0,
- "data_sources_used": [
- {
- "binding_id": "string",
- "source_type": "agentcon_api",
- "source_identifier": "string",
- "fetched_at": "2019-08-24T14:15:22Z",
- "fetch_duration_ms": 0,
- "record_count": 0,
- "data_hash": "string",
- "cache_hit": false
}
], - "version_number": 1,
- "is_current": true,
- "supersedes": "string",
- "status": "draft",
- "validation_results": [
- {
- "rule_id": "string",
- "passed": true,
- "message": "string",
- "severity": "warning"
}
], - "is_valid": true,
- "approval_status": "pending",
- "approvals": [
- {
- "approval_id": "string",
- "approver_user_id": "string",
- "approver_name": "string",
- "approver_role": "string",
- "required": true,
- "status": "pending",
- "comments": "string",
- "approved_at": "2019-08-24T14:15:22Z",
- "order": 0
}
], - "pdf_exports": [
- {
- "export_id": "string",
- "exported_at": "2019-08-24T14:15:22Z",
- "exported_by_user_id": "string",
- "r2_path": "string",
- "file_size": 0,
- "purpose": "string",
- "digital_signature": "string",
- "agentcon_document_id": "string"
}
], - "valid_from": "2019-08-24T14:15:22Z",
- "valid_until": "2019-08-24T14:15:22Z",
- "invalidation_reason": "string",
- "changes_from_previous": [
- {
- "section_id": "string",
- "change_type": "content_modified",
- "description": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "document_references": [
- {
- "document_id": "string",
- "document_title": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}, - "inserted_at": "2019-08-24T14:15:22Z"
}
], - "revision_summary": "string"
}
], - "total": 0
}Fetch versions via query parameter document_id.
| document_id required | string (Document Id) Anchor document_id to list versions for |
| limit | integer (Limit) [ 1 .. 100 ] Default: 10 |
| sort | string (Sort) Default: "-version_number" |
{- "items": [
- {
- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "document_id": "string",
- "template_id": "string",
- "template_version": "string",
- "project_id": "string",
- "organization_id": "string",
- "created_by_user_id": "string",
- "title": "string",
- "document_type": "health_safety_plan",
- "generated_at": "2019-08-24T14:15:22Z",
- "generation_trigger": "manual",
- "generation_duration_ms": 0,
- "content": "string",
- "content_r2_key": "string",
- "content_format": "html",
- "content_hash": "string",
- "content_size_bytes": 0,
- "data_snapshot": { },
- "data_snapshot_r2_key": "string",
- "data_snapshot_hash": "string",
- "data_snapshot_size_bytes": 0,
- "data_sources_used": [
- {
- "binding_id": "string",
- "source_type": "agentcon_api",
- "source_identifier": "string",
- "fetched_at": "2019-08-24T14:15:22Z",
- "fetch_duration_ms": 0,
- "record_count": 0,
- "data_hash": "string",
- "cache_hit": false
}
], - "version_number": 1,
- "is_current": true,
- "supersedes": "string",
- "status": "draft",
- "validation_results": [
- {
- "rule_id": "string",
- "passed": true,
- "message": "string",
- "severity": "warning"
}
], - "is_valid": true,
- "approval_status": "pending",
- "approvals": [
- {
- "approval_id": "string",
- "approver_user_id": "string",
- "approver_name": "string",
- "approver_role": "string",
- "required": true,
- "status": "pending",
- "comments": "string",
- "approved_at": "2019-08-24T14:15:22Z",
- "order": 0
}
], - "pdf_exports": [
- {
- "export_id": "string",
- "exported_at": "2019-08-24T14:15:22Z",
- "exported_by_user_id": "string",
- "r2_path": "string",
- "file_size": 0,
- "purpose": "string",
- "digital_signature": "string",
- "agentcon_document_id": "string"
}
], - "valid_from": "2019-08-24T14:15:22Z",
- "valid_until": "2019-08-24T14:15:22Z",
- "invalidation_reason": "string",
- "changes_from_previous": [
- {
- "section_id": "string",
- "change_type": "content_modified",
- "description": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "document_references": [
- {
- "document_id": "string",
- "document_title": "string",
- "placeholder_id": "string",
- "reference_type": "full_document",
- "pages": [
- 0
], - "display_options": {
- "max_width": "100%",
- "max_height": "string",
- "alignment": "center",
- "caption": "string",
- "page_break_before": false,
- "page_break_after": false
}, - "inserted_at": "2019-08-24T14:15:22Z"
}
], - "revision_summary": "string"
}
], - "total": 0
}Render a virtual document as a PDF and store it in R2.
| document_id required | string (Document Id) |
| purpose | string (Purpose) <= 200 characters Default: "manual_export" |
| upload_to_agentcon | boolean (Upload To Agentcon) Default: false If true, upload the resulting PDF to the Agent-Con document service. |
Filename (string) or Filename (null) (Filename) Optional filename to use when storing or downloading the PDF. | |
object (Agentcon Metadata) Additional metadata to send when uploading to Agent-Con. |
{- "purpose": "manual_export",
- "upload_to_agentcon": false,
- "filename": "string",
- "agentcon_metadata": { }
}{- "export": {
- "export_id": "string",
- "exported_at": "2019-08-24T14:15:22Z",
- "exported_by_user_id": "string",
- "r2_path": "string",
- "file_size": 0,
- "purpose": "string",
- "digital_signature": "string",
- "agentcon_document_id": "string"
}, - "download_url": "string",
- "agentcon_document": { }
}