Download OpenAPI specification:Download
Public API for PlanOps construction project management
File Uploads
Upload files to the system with presigned URLs.
Upload Flow:
List connector blueprints.
Returns active blueprints by default. Pass include_inactive=true to
include archived blueprints in the result.
| include_inactive | boolean (Include Inactive) Default: false |
[- {
- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}
]List connector blueprints.
Returns active blueprints by default. Pass include_inactive=true to
include archived blueprints in the result.
| include_inactive | boolean (Include Inactive) Default: false |
[- {
- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}
]Create a new connector blueprint (write-restricted).
| connector_id required | string (Connector Id) Unique slug for the blueprint, e.g. 'smartwaste' |
| name required | string (Name) Human-readable connector name |
Description (string) or Description (null) (Description) | |
Tagline (string) or Tagline (null) (Tagline) Short marketing line shown under the name in the gallery | |
Icon (string) or Icon (null) (Icon) Icon identifier or URL | |
| tags | Array of strings (Tags) |
| category required | string (Category) Catalogue category, e.g. 'waste-management' |
required | object (ConnectorVendor) Vendor metadata |
| system_type | string (System Type) Default: "rest_api" Underlying transport, mirrors ExternalSystemType |
| base_url required | string (Base Url) Base URL for upstream API calls |
required | object (ConnectorAuthentication) Authentication contract for a connector blueprint. |
Array of objects (Actions) | |
ConnectorHealthCheck (object) or null | |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) Token-bucket rate limit applied per (org, connector_slug) | |
| timeout_seconds | integer (Timeout Seconds) [ 1 .. 300 ] Default: 30 |
| retry_attempts | integer (Retry Attempts) [ 0 .. 10 ] Default: 3 |
| version | integer (Version) >= 1 Default: 1 |
| active | boolean (Active) Default: true |
object (Metadata) | |
| property name* additional property | any |
{- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "icon": "string",
- "tags": [
- "string"
], - "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "system_type": "rest_api",
- "base_url": "string",
- "authentication": {
- "type": "string",
- "fields": [
- {
- "key": "string",
- "label": "string",
- "input_type": "password",
- "required": true,
- "description": "string",
- "placeholder": "string",
- "help_text": "string",
- "default": { }
}
], - "header_template": {
- "property1": "string",
- "property2": "string"
}
}, - "actions": [
- {
- "slug": "string",
- "name": "string",
- "description": "string",
- "method": "GET",
- "path": "string",
- "path_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "query_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "body_schema": { },
- "header_template": {
- "property1": "string",
- "property2": "string"
}, - "timeout_seconds": 1,
- "retry_attempts": 10
}
], - "health_check": {
- "path": "string",
- "method": "GET",
- "expected_status": 200
}, - "rate_limit_per_minute": 1,
- "timeout_seconds": 30,
- "retry_attempts": 3,
- "version": 1,
- "active": true,
- "metadata": { }
}{- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}Create a new connector blueprint (write-restricted).
| connector_id required | string (Connector Id) Unique slug for the blueprint, e.g. 'smartwaste' |
| name required | string (Name) Human-readable connector name |
Description (string) or Description (null) (Description) | |
Tagline (string) or Tagline (null) (Tagline) Short marketing line shown under the name in the gallery | |
Icon (string) or Icon (null) (Icon) Icon identifier or URL | |
| tags | Array of strings (Tags) |
| category required | string (Category) Catalogue category, e.g. 'waste-management' |
required | object (ConnectorVendor) Vendor metadata |
| system_type | string (System Type) Default: "rest_api" Underlying transport, mirrors ExternalSystemType |
| base_url required | string (Base Url) Base URL for upstream API calls |
required | object (ConnectorAuthentication) Authentication contract for a connector blueprint. |
Array of objects (Actions) | |
ConnectorHealthCheck (object) or null | |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) Token-bucket rate limit applied per (org, connector_slug) | |
| timeout_seconds | integer (Timeout Seconds) [ 1 .. 300 ] Default: 30 |
| retry_attempts | integer (Retry Attempts) [ 0 .. 10 ] Default: 3 |
| version | integer (Version) >= 1 Default: 1 |
| active | boolean (Active) Default: true |
object (Metadata) | |
| property name* additional property | any |
{- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "icon": "string",
- "tags": [
- "string"
], - "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "system_type": "rest_api",
- "base_url": "string",
- "authentication": {
- "type": "string",
- "fields": [
- {
- "key": "string",
- "label": "string",
- "input_type": "password",
- "required": true,
- "description": "string",
- "placeholder": "string",
- "help_text": "string",
- "default": { }
}
], - "header_template": {
- "property1": "string",
- "property2": "string"
}
}, - "actions": [
- {
- "slug": "string",
- "name": "string",
- "description": "string",
- "method": "GET",
- "path": "string",
- "path_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "query_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "body_schema": { },
- "header_template": {
- "property1": "string",
- "property2": "string"
}, - "timeout_seconds": 1,
- "retry_attempts": 10
}
], - "health_check": {
- "path": "string",
- "method": "GET",
- "expected_status": 200
}, - "rate_limit_per_minute": 1,
- "timeout_seconds": 30,
- "retry_attempts": 3,
- "version": 1,
- "active": true,
- "metadata": { }
}{- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}Fetch a single blueprint by connector_id.
| connector_id required | string (Connector Id) |
{- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}Fetch a single blueprint by connector_id.
| connector_id required | string (Connector Id) |
{- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}Update an existing blueprint (write-restricted).
| connector_id required | string (Connector Id) |
Name (string) or Name (null) (Name) | |
Description (string) or Description (null) (Description) | |
Tagline (string) or Tagline (null) (Tagline) | |
Icon (string) or Icon (null) (Icon) | |
Array of Tags (strings) or Tags (null) (Tags) | |
Category (string) or Category (null) (Category) | |
ConnectorVendor (object) or null | |
System Type (string) or System Type (null) (System Type) | |
Base Url (string) or Base Url (null) (Base Url) | |
ConnectorAuthentication (object) or null | |
Array of Actions (objects) or Actions (null) (Actions) | |
ConnectorHealthCheck (object) or null | |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) | |
Timeout Seconds (integer) or Timeout Seconds (null) (Timeout Seconds) | |
Retry Attempts (integer) or Retry Attempts (null) (Retry Attempts) | |
Version (integer) or Version (null) (Version) | |
Active (boolean) or Active (null) (Active) | |
Metadata (object) or Metadata (null) (Metadata) | |
| property name* additional property | any |
{- "name": "string",
- "description": "string",
- "tagline": "string",
- "icon": "string",
- "tags": [
- "string"
], - "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "system_type": "string",
- "base_url": "string",
- "authentication": {
- "type": "string",
- "fields": [
- {
- "key": "string",
- "label": "string",
- "input_type": "password",
- "required": true,
- "description": "string",
- "placeholder": "string",
- "help_text": "string",
- "default": { }
}
], - "header_template": {
- "property1": "string",
- "property2": "string"
}
}, - "actions": [
- {
- "slug": "string",
- "name": "string",
- "description": "string",
- "method": "GET",
- "path": "string",
- "path_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "query_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "body_schema": { },
- "header_template": {
- "property1": "string",
- "property2": "string"
}, - "timeout_seconds": 1,
- "retry_attempts": 10
}
], - "health_check": {
- "path": "string",
- "method": "GET",
- "expected_status": 200
}, - "rate_limit_per_minute": 0,
- "timeout_seconds": 0,
- "retry_attempts": 0,
- "version": 0,
- "active": true,
- "metadata": { }
}{- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}Update an existing blueprint (write-restricted).
| connector_id required | string (Connector Id) |
Name (string) or Name (null) (Name) | |
Description (string) or Description (null) (Description) | |
Tagline (string) or Tagline (null) (Tagline) | |
Icon (string) or Icon (null) (Icon) | |
Array of Tags (strings) or Tags (null) (Tags) | |
Category (string) or Category (null) (Category) | |
ConnectorVendor (object) or null | |
System Type (string) or System Type (null) (System Type) | |
Base Url (string) or Base Url (null) (Base Url) | |
ConnectorAuthentication (object) or null | |
Array of Actions (objects) or Actions (null) (Actions) | |
ConnectorHealthCheck (object) or null | |
Rate Limit Per Minute (integer) or Rate Limit Per Minute (null) (Rate Limit Per Minute) | |
Timeout Seconds (integer) or Timeout Seconds (null) (Timeout Seconds) | |
Retry Attempts (integer) or Retry Attempts (null) (Retry Attempts) | |
Version (integer) or Version (null) (Version) | |
Active (boolean) or Active (null) (Active) | |
Metadata (object) or Metadata (null) (Metadata) | |
| property name* additional property | any |
{- "name": "string",
- "description": "string",
- "tagline": "string",
- "icon": "string",
- "tags": [
- "string"
], - "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "system_type": "string",
- "base_url": "string",
- "authentication": {
- "type": "string",
- "fields": [
- {
- "key": "string",
- "label": "string",
- "input_type": "password",
- "required": true,
- "description": "string",
- "placeholder": "string",
- "help_text": "string",
- "default": { }
}
], - "header_template": {
- "property1": "string",
- "property2": "string"
}
}, - "actions": [
- {
- "slug": "string",
- "name": "string",
- "description": "string",
- "method": "GET",
- "path": "string",
- "path_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "query_params": [
- {
- "key": "string",
- "type": "string",
- "required": false,
- "default": { },
- "description": "string"
}
], - "body_schema": { },
- "header_template": {
- "property1": "string",
- "property2": "string"
}, - "timeout_seconds": 1,
- "retry_attempts": 10
}
], - "health_check": {
- "path": "string",
- "method": "GET",
- "expected_status": 200
}, - "rate_limit_per_minute": 0,
- "timeout_seconds": 0,
- "retry_attempts": 0,
- "version": 0,
- "active": true,
- "metadata": { }
}{- "active": true,
- "category": "waste-management",
- "connector_id": "smartwaste",
- "description": "BRE SMARTWaste reporting",
- "name": "SMARTWaste",
- "system_type": "rest_api",
- "version": 1
}Return the lightweight gallery feed used by the frontend.
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}Return the lightweight gallery feed used by the frontend.
{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}Create the global catalogue manifest (write-restricted).
| key | string (Key) Default: "global" Manifest key (only 'global' is used today) |
| version | integer (Version) >= 1 Default: 1 |
Array of objects (Entries) | |
object (Metadata) | |
| published_at | string <date-time> (Published At) |
| property name* additional property | any |
{- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}Create the global catalogue manifest (write-restricted).
| key | string (Key) Default: "global" Manifest key (only 'global' is used today) |
| version | integer (Version) >= 1 Default: 1 |
Array of objects (Entries) | |
object (Metadata) | |
| published_at | string <date-time> (Published At) |
| property name* additional property | any |
{- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}Update the global catalogue manifest (write-restricted).
Version (integer) or Version (null) (Version) | |
Array of Entries (objects) or Entries (null) (Entries) | |
Metadata (object) or Metadata (null) (Metadata) | |
Published At (string) or Published At (null) (Published At) | |
| property name* additional property | any |
{- "version": 0,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}Update the global catalogue manifest (write-restricted).
Version (integer) or Version (null) (Version) | |
Array of Entries (objects) or Entries (null) (Entries) | |
Metadata (object) or Metadata (null) (Metadata) | |
Published At (string) or Published At (null) (Published At) | |
| property name* additional property | any |
{- "version": 0,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}{- "_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "key": "global",
- "version": 1,
- "entries": [
- {
- "connector_id": "string",
- "name": "string",
- "description": "string",
- "tagline": "string",
- "category": "string",
- "vendor": {
- "name": "string",
- "homepage": "string",
- "support_url": "string",
- "credentials_help_url": "string",
- "credentials_help_text": "string",
- "logo_url": "string"
}, - "version": 0,
- "active": true,
- "icon": "string",
- "icon_url": "string",
- "tags": [
- "string"
]
}
], - "metadata": { },
- "published_at": "2019-08-24T14:15:22Z"
}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 | |
Viewable Pdf Path (string) or Viewable Pdf Path (null) (Viewable Pdf Path) R2 path to a viewable PDF rendition of the document. Populated for Word documents (.doc/.docx), which browsers cannot render natively, so the in-app viewer can fetch and display a PDF instead. PDFs are served from r2_path directly and leave this unset. | |
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 | |
Content Hash (string) or Content Hash (null) (Content Hash) Hex digest of the document's raw bytes (SHA-256 by default). Indexed for content-based deduplication and submission-to-document matching (spec §4.2-4.3). | |
Content Hash Algo (string) or Content Hash Algo (null) (Content Hash Algo) Algorithm used to compute content_hash (e.g. 'sha256') | |
DocumentSource (string) or null How this document entered the system (upload, cde_sync, public_submission, …) | |
SourceSubmissionRef (object) or null Back-reference to the public-page submission this document was ingested from. Set only when source == PUBLIC_SUBMISSION. | |
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 | |
DrawingComparisonStatus (string) or null Status of automatic drawing comparison for this document. PENDING means the comparison is deferred (e.g. parent still processing) and will be retried; NOT_APPLICABLE means no comparison is expected. | |
Comparison Status Reason (string) or Comparison Status Reason (null) (Comparison Status Reason) Human-readable explanation for the current comparison_status. | |
Page Count (integer) or Page Count (null) (Page Count) Number of pages detected for this document (PDF page count). None when the page count could not be determined. | |
Comparison Eligible (boolean) or Comparison Eligible (null) (Comparison Eligible) Whether this document is eligible for drawing comparison. True for single-page documents, False for multi-page documents, None when eligibility could not be determined (e.g. unknown page count). | |
ComparisonEligibility (string) or null Machine-readable reason for the comparison eligibility decision (e.g. eligible, excluded_multipage, unknown_page_count). | |
Revision Of (string) or Revision Of (null) (Revision Of) Document ID of the parent document this is an explicit revision of | |
| removed_in_resubmission | boolean (Removed In Resubmission) Default: false Flagged when this document's slot/file was not re-supplied in a later resubmission for the same recipient+page. The document is never auto-deleted; this flag lets the UI surface the gap (spec §4.6). |
Removed In Resubmission At (string) or Removed In Resubmission At (null) (Removed In Resubmission At) When the document was flagged as removed-in-resubmission, if ever | |
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 |
| is_latest | boolean (Is Latest) Default: true Whether this is the latest version |
| is_deleted | boolean (Is Deleted) Default: false Whether the document is deleted |
PhotoMetadata (object) or null EXIF and device metadata for photo documents (location, device, timestamp) | |
| org_extraction_status | string (OrgExtractionStatus) Default: "pending" Enum: "pending" "success" "partial" "failed_enrichment" "failed_creation" Status of organization extraction during document processing |
Org Extraction Error (string) or Org Extraction Error (null) (Org Extraction Error) Human-readable summary of the last org extraction error, if any | |
Extracted Organization (object) or Extracted Organization (null) (Extracted Organization) Summary of the organization extracted from this document: {id, name, website_domain} or null. | |
| 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 |
AssigneeUser (object) or null User who uploaded the document (overridden server-side) |
{- "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",
- "document_id": "string",
- "revision_of": "string",
- "revision": "string",
- "filename": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "viewable_pdf_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "content_hash": "string",
- "content_hash_algo": "string",
- "source": "upload",
- "source_submission_ref": {
- "public_page_id": "string",
- "submission_id": "string",
- "file_id": "string",
- "block_id": "string",
- "submitter_email": "string",
- "ingested_at": "2019-08-24T14:15:22Z"
}, - "drawing_comparison_id": "string",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string",
- "removed_in_resubmission": false,
- "removed_in_resubmission_at": "2019-08-24T14:15:22Z",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "is_latest": true,
- "is_deleted": false,
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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": [ ],
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "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
compact: Exclude large fields (content, version_history) for lighter responses
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) Organisation 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 |
| compact | boolean (Compact) Default: false Return compact response excluding large fields like 'content' and 'version_history'. Useful for listing documents without the full extracted text. |
{- "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": [ ],
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0,
- "next_cursor": "string"
}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": [ ],
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "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",
- "document_id": "string",
- "revision_of": "string",
- "revision": "string",
- "filename": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "viewable_pdf_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "content_hash": "string",
- "content_hash_algo": "string",
- "source": "upload",
- "source_submission_ref": {
- "public_page_id": "string",
- "submission_id": "string",
- "file_id": "string",
- "block_id": "string",
- "submitter_email": "string",
- "ingested_at": "2019-08-24T14:15:22Z"
}, - "drawing_comparison_id": "string",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string",
- "removed_in_resubmission": false,
- "removed_in_resubmission_at": "2019-08-24T14:15:22Z",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "is_latest": true,
- "is_deleted": false,
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "authoring_organization_id": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "last_modified": "2019-08-24T14:15:22Z",
- "task_ids": [
- "string"
], - "related_queries": [
- "string"
], - "handover_links": [
- {
- "handover_id": "string",
- "item_id": "string",
- "status": "string",
- "attached_at": "2019-08-24T14:15:22Z"
}
]
}
]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",
- "document_id": "string",
- "revision_of": "string",
- "revision": "string",
- "filename": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "viewable_pdf_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "content_hash": "string",
- "content_hash_algo": "string",
- "source": "upload",
- "source_submission_ref": {
- "public_page_id": "string",
- "submission_id": "string",
- "file_id": "string",
- "block_id": "string",
- "submitter_email": "string",
- "ingested_at": "2019-08-24T14:15:22Z"
}, - "drawing_comparison_id": "string",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string",
- "removed_in_resubmission": false,
- "removed_in_resubmission_at": "2019-08-24T14:15:22Z",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "is_latest": true,
- "is_deleted": false,
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "authoring_organization_id": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "last_modified": "2019-08-24T14:15:22Z",
- "task_ids": [
- "string"
], - "related_queries": [
- "string"
], - "handover_links": [
- {
- "handover_id": "string",
- "item_id": "string",
- "status": "string",
- "attached_at": "2019-08-24T14:15:22Z"
}
]
}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": [ ],
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "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"
}Return the full revision chain for a document, oldest first.
Enumerates every document linked to the requested one through
revision_of (in either direction), giving the API/UI a way to list
"all revisions of document X" (APP-1212).
document_id: ID of any document in the chain
db: MongoDB client instance
current_user: Current authenticated user
RevisionChainResponse ordered oldest -> newest
HTTPException: If the document is not found or access is denied
| document_id required | string (Document Id) |
{- "document_id": "string",
- "count": 0,
- "revisions": [
- {
- "document_id": "string",
- "filename": "string",
- "document_reference": "string",
- "revision": "string",
- "revision_of": "string",
- "is_latest": false,
- "created_at": "2019-08-24T14:15:22Z"
}
]
}Return the reverse-index entries recording which HandoverItems cite this document.
| document_id required | string (Document Id) |
[- {
- "handover_id": "string",
- "item_id": "string",
- "status": "string",
- "attached_at": "2019-08-24T14:15:22Z"
}
]Generate a temporary download link for a document.
document_id: ID of document to generate link for
db: MongoDB client instance
current_user: Current authenticated user
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 a presigned inline view URL for the in-app multi-page viewer.
Returns a plain presigned GET URL (no Content-Disposition: attachment)
so a browser-side PDF renderer can fetch and display the bytes inline:
r2_path.viewable_pdf_path PDF rendition produced during processing — browsers
cannot render .docx/.pptx natively.The accurate page_count (derived from the rendered PDF — the slide count
for PowerPoint) is returned alongside so the viewer can show a page badge.
document_id: ID of the document to view
expiration: URL expiration time in seconds
db: MongoDB client instance
current_user: Current authenticated user
Dictionary with the inline ``view_url``, ``content_type``,
``page_count`` and ``expires_at``.
HTTPException: If the document or a viewable rendition is not found, or
the caller is not authorised.
| document_id required | string (Document Id) |
| expiration | integer (Expiration) [ 300 .. 86400 ] Default: 3600 URL expiration time in seconds (5 minutes to 24 hours) |
{ }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",
- "document_id": "string",
- "revision_of": "string",
- "revision": "string",
- "filename": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "viewable_pdf_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "content_hash": "string",
- "content_hash_algo": "string",
- "source": "upload",
- "source_submission_ref": {
- "public_page_id": "string",
- "submission_id": "string",
- "file_id": "string",
- "block_id": "string",
- "submitter_email": "string",
- "ingested_at": "2019-08-24T14:15:22Z"
}, - "drawing_comparison_id": "string",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string",
- "removed_in_resubmission": false,
- "removed_in_resubmission_at": "2019-08-24T14:15:22Z",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "is_latest": true,
- "is_deleted": false,
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "_id": "string",
- "project_id": "string",
- "organization_id": "string",
- "authoring_organization_id": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "last_modified": "2019-08-24T14:15:22Z",
- "task_ids": [
- "string"
], - "related_queries": [
- "string"
], - "handover_links": [
- {
- "handover_id": "string",
- "item_id": "string",
- "status": "string",
- "attached_at": "2019-08-24T14:15:22Z"
}
]
}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
}
}
]
}, - "original_image_url": "string",
- "comparison_image_url": "string"
}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 |
Connector Slug (string) or Connector Slug (null) (Connector Slug) Optional reference to a ConnectorBlueprint.connector_id. When set, blueprint-derived fields (base_url, system_type, authentication_type, custom_headers) are locked server-side. | |
Connector Version (integer) or Connector Version (null) (Connector Version) Version of the linked ConnectorBlueprint when the system was created/updated | |
| 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",
- "connector_slug": "string",
- "connector_version": 0,
- "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",
- "connector_slug": "string",
- "connector_version": 0,
- "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 |
Connector Slug (string) or Connector Slug (null) (Connector Slug) Optional reference to a ConnectorBlueprint.connector_id. When set, blueprint-derived fields (base_url, system_type, authentication_type, custom_headers) are locked server-side. | |
Connector Version (integer) or Connector Version (null) (Connector Version) Version of the linked ConnectorBlueprint when the system was created/updated | |
| 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",
- "connector_slug": "string",
- "connector_version": 0,
- "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",
- "connector_slug": "string",
- "connector_version": 0,
- "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) Organisation 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",
- "connector_slug": "string",
- "connector_version": 0,
- "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) Organisation 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",
- "connector_slug": "string",
- "connector_version": 0,
- "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",
- "connector_slug": "string",
- "connector_version": 0,
- "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",
- "connector_slug": "string",
- "connector_version": 0,
- "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 | |
Connector Slug (string) or Connector Slug (null) (Connector Slug) | |
Connector Version (integer) or Connector Version (null) (Connector Version) | |
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",
- "connector_slug": "string",
- "connector_version": 0,
- "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",
- "connector_slug": "string",
- "connector_version": 0,
- "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 | |
Connector Slug (string) or Connector Slug (null) (Connector Slug) | |
Connector Version (integer) or Connector Version (null) (Connector Version) | |
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",
- "connector_slug": "string",
- "connector_version": 0,
- "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",
- "connector_slug": "string",
- "connector_version": 0,
- "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"
}Run the blueprint's declared health check against the upstream.
| system_id required | string (System Id) |
object (Path Params) | |
object (Query Params) | |
Body (object) or Body (null) (Body) | |
Organization Id (string) or Organization Id (null) (Organization Id) |
{- "path_params": {
- "property1": "string",
- "property2": "string"
}, - "query_params": { },
- "body": { },
- "organization_id": "string"
}{ }Run the blueprint's declared health check against the upstream.
| system_id required | string (System Id) |
object (Path Params) | |
object (Query Params) | |
Body (object) or Body (null) (Body) | |
Organization Id (string) or Organization Id (null) (Organization Id) |
{- "path_params": {
- "property1": "string",
- "property2": "string"
}, - "query_params": { },
- "body": { },
- "organization_id": "string"
}{ }Backwards-compatible Geoapify geocoding shim.
Prefer POST /external-systems/{system_id}/proxy/{action_slug} once the
blueprint is in place. When the system is blueprint-linked this delegates
to the generic proxy (action geocode); otherwise it falls back to the
historical bespoke flow so existing custom integrations keep working.
| 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"
}{ }Backwards-compatible Geoapify geocoding shim.
Prefer POST /external-systems/{system_id}/proxy/{action_slug} once the
blueprint is in place. When the system is blueprint-linked this delegates
to the generic proxy (action geocode); otherwise it falls back to the
historical bespoke flow so existing custom integrations keep working.
| 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"
}{ }Forward an action call through the linked connector blueprint.
Resolves system_id to an ExternalSystem, looks up the linked
ConnectorBlueprint, validates that action_slug is declared, applies
rate limits, and forwards the call upstream with stored credentials.
| system_id required | string (System Id) |
| action_slug required | string (Action Slug) |
object (Path Params) | |
object (Query Params) | |
Body (object) or Body (null) (Body) | |
Organization Id (string) or Organization Id (null) (Organization Id) |
{- "path_params": {
- "property1": "string",
- "property2": "string"
}, - "query_params": { },
- "body": { },
- "organization_id": "string"
}{ }Forward an action call through the linked connector blueprint.
Resolves system_id to an ExternalSystem, looks up the linked
ConnectorBlueprint, validates that action_slug is declared, applies
rate limits, and forwards the call upstream with stored credentials.
| system_id required | string (System Id) |
| action_slug required | string (Action Slug) |
object (Path Params) | |
object (Query Params) | |
Body (object) or Body (null) (Body) | |
Organization Id (string) or Organization Id (null) (Organization Id) |
{- "path_params": {
- "property1": "string",
- "property2": "string"
}, - "query_params": { },
- "body": { },
- "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'. | |
| allowed_instance_types | Array of strings (Allowed Instance Types) Items Enum: "assigned" "open" "anonymous" Instance types that can be selected when issuing this form. Omit or pass all three to allow all methods. Exclude 'anonymous' for forms requiring identified recipients. |
Issue Via Agent Task Id (string) or Issue Via Agent Task Id (null) (Issue Via Agent Task Id) Optional agent task_id slug. When set, the front-end's 'Issue' action should run the named agent task instead of calling POST /forms/instances directly. Use this for templates that need server-side hydration before issue. | |
| default_allow_self_service | boolean (Default Allow Self Service) Default: false Let supervisors request additional permits themselves from the public link, without a project manager issuing each one. Off by default. |
Default Self Service Cap (integer) or Default Self Service Cap (null) (Default Self Service Cap) How many extra permits a supervisor may request from one permit. Must be 1 or more. Leave empty for no limit. Only applies when self-service is on. |
{- "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
}, - "allowed_instance_types": [
- "assigned"
], - "issue_via_agent_task_id": "string",
- "default_allow_self_service": false,
- "default_self_service_cap": 0
}{- "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",
- "updated_by_user_id": "string",
- "archived": false,
- "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
}, - "allowed_instance_types": [
- "assigned"
], - "issue_via_agent_task_id": "string",
- "default_allow_self_service": false,
- "default_self_service_cap": 0,
- "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)search: Full-text search across template name, description, tags, and categoryTemplates are returned in order of most recently updated first (or by relevance when searching).
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. | |
Search (string) or Search (null) (Search) Full-text search across template name, description, tags, and category. Results are ranked by relevance. | |
| include_archived | boolean (Include Archived) Default: false Include archived templates in results (default: false). |
| page | integer (Page) >= 1 Default: 1 Page number (1-based). |
| size | integer (Size) [ 1 .. 200 ] Default: 20 Number of items per page (max 200). |
{- "items": [
- {
- "id": "string",
- "scope": "app",
- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "archived": false,
- "latest_version_number": 0,
- "allowed_instance_types": [
- "assigned"
], - "issue_via_agent_task_id": "string",
- "default_allow_self_service": false,
- "default_self_service_cap": 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,
- "next_cursor": "string"
}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",
- "updated_by_user_id": "string",
- "archived": false,
- "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
}, - "allowed_instance_types": [
- "assigned"
], - "issue_via_agent_task_id": "string",
- "default_allow_self_service": false,
- "default_self_service_cap": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Update a form template's metadata and self-service policy.
Returns 200 with the full, updated template body so the Form Builder can round-trip the saved state (this endpoint does not return 204).
Only the following non-versioned fields can be updated:
name: Template display namedescription: Template descriptioncategory: Category for organisationtags: Tags for filteringarchived: Archive/unarchive the templatedefault_allow_self_service: Allow supervisors to self-issue additional permitsdefault_self_service_cap: Maximum self-issued permits per origin permit (1 or more)Self-service rules:
default_allow_self_service: false clears any stale cap.default_allow_self_service: false is rejected with 422.Note: 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"],
"default_allow_self_service": true,
"default_self_service_cap": 2
}
| 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. | |
Archived (boolean) or Archived (null) (Archived) Set to true to archive (hide from listings) or false to unarchive. | |
FormSequenceConfig (object) or null Updated sequence configuration for form references. | |
Array of Allowed Instance Types (strings) or Allowed Instance Types (null) (Allowed Instance Types) Updated list of allowed instance types. Replaces existing list entirely. | |
Issue Via Agent Task Id (string) or Issue Via Agent Task Id (null) (Issue Via Agent Task Id) Updated agent-task slug used by the front-end's 'Issue' action. Pass an empty string to clear (omit to leave unchanged). | |
Default Allow Self Service (boolean) or Default Allow Self Service (null) (Default Allow Self Service) Let supervisors request additional permits themselves from the public link, without a project manager issuing each one. Turn this off to keep issuing manual-only. | |
Default Self Service Cap (integer) or Default Self Service Cap (null) (Default Self Service Cap) How many extra permits a supervisor may request from one permit. Must be 1 or more. Leave empty for no limit. Only applies when self-service is on. |
{- "name": "string",
- "description": "string",
- "category": "Environmental",
- "tags": [
- "string"
], - "archived": true,
- "sequence_config": {
- "enabled": false,
- "prefix": "FORM",
- "format_pattern": "{prefix}-{sequence:05d}",
- "per_project": false,
- "include_project_ref": false
}, - "allowed_instance_types": [
- "assigned"
], - "issue_via_agent_task_id": "string",
- "default_allow_self_service": true,
- "default_self_service_cap": 0
}{- "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",
- "updated_by_user_id": "string",
- "archived": false,
- "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
}, - "allowed_instance_types": [
- "assigned"
], - "issue_via_agent_task_id": "string",
- "default_allow_self_service": false,
- "default_self_service_cap": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Returns audit log entries for the given template in reverse-chronological order. Currently captures changes to self-service policy fields.
| template_id required | string (Template Id) |
[- {
- "id": "string",
- "template_id": "string",
- "event": "string",
- "actor_user_id": "string",
- "changed_fields": { },
- "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 SummaryConfigEntry (object))) 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) | |
Default Allow Self Service (boolean) or Default Allow Self Service (null) (Default Allow Self Service) Deprecated: use FormTemplate.default_allow_self_service. Kept for one release while the frontend migrates. | |
Default Self Service Cap (integer) or Default Self Service Cap (null) (Default Self Service Cap) Deprecated: use FormTemplate.default_self_service_cap. Kept for one release while the frontend migrates. |
{- "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,
- "min_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false,
- "duration_from_field": "string",
- "max_duration_hours": 0,
- "min_duration_hours": 0,
- "duration_error_message": "string"
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
], - "computed": {
- "formula": "string",
- "inputs": [
- "string"
], - "display_format": "integer",
- "decimal_places": 2,
- "currency": "string",
- "suffix": "string",
- "allow_override": false
}, - "default_expression": "string",
- "quick_options": [
- {
- "label": "string",
- "expression": "string"
}
]
}
]
}, - "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"
], - "org_membership_roles": [
- "string"
]
}, - "requires_signature": false,
- "require_drawn_signature": false,
- "allow_amendments": true,
- "lock_on_next_complete": 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"
}
], - "default_allow_self_service": true,
- "default_self_service_cap": 0
}{- "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,
- "min_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false,
- "duration_from_field": "string",
- "max_duration_hours": 0,
- "min_duration_hours": 0,
- "duration_error_message": "string"
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
], - "computed": {
- "formula": "string",
- "inputs": [
- "string"
], - "display_format": "integer",
- "decimal_places": 2,
- "currency": "string",
- "suffix": "string",
- "allow_override": false
}, - "default_expression": "string",
- "quick_options": [
- {
- "label": "string",
- "expression": "string"
}
]
}
]
}, - "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"
], - "org_membership_roles": [
- "string"
]
}, - "requires_signature": false,
- "require_drawn_signature": false,
- "allow_amendments": true,
- "lock_on_next_complete": 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",
- "default_allow_self_service": true,
- "default_self_service_cap": 0
}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 .. 200 ] Default: 20 Number of items per page (max 200). |
{- "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,
- "min_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false,
- "duration_from_field": "string",
- "max_duration_hours": 0,
- "min_duration_hours": 0,
- "duration_error_message": "string"
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
], - "computed": {
- "formula": "string",
- "inputs": [
- "string"
], - "display_format": "integer",
- "decimal_places": 2,
- "currency": "string",
- "suffix": "string",
- "allow_override": false
}, - "default_expression": "string",
- "quick_options": [
- {
- "label": "string",
- "expression": "string"
}
]
}
]
}, - "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"
], - "org_membership_roles": [
- "string"
]
}, - "requires_signature": false,
- "require_drawn_signature": false,
- "allow_amendments": true,
- "lock_on_next_complete": 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",
- "default_allow_self_service": true,
- "default_self_service_cap": 0
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0,
- "next_cursor": "string"
}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,
- "min_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false,
- "duration_from_field": "string",
- "max_duration_hours": 0,
- "min_duration_hours": 0,
- "duration_error_message": "string"
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
], - "computed": {
- "formula": "string",
- "inputs": [
- "string"
], - "display_format": "integer",
- "decimal_places": 2,
- "currency": "string",
- "suffix": "string",
- "allow_override": false
}, - "default_expression": "string",
- "quick_options": [
- {
- "label": "string",
- "expression": "string"
}
]
}
]
}, - "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"
], - "org_membership_roles": [
- "string"
]
}, - "requires_signature": false,
- "require_drawn_signature": false,
- "allow_amendments": true,
- "lock_on_next_complete": 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",
- "default_allow_self_service": true,
- "default_self_service_cap": 0
}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,
- "min_files": 1,
- "image_max_dimension": 1,
- "image_quality": 1,
- "capture_source": "camera",
- "preserve_gps": false,
- "duration_from_field": "string",
- "max_duration_hours": 0,
- "min_duration_hours": 0,
- "duration_error_message": "string"
}, - "options": [
- {
- "value": "string",
- "label": "string",
- "disabled": false
}
], - "fields": [
- { }
], - "computed": {
- "formula": "string",
- "inputs": [
- "string"
], - "display_format": "integer",
- "decimal_places": 2,
- "currency": "string",
- "suffix": "string",
- "allow_override": false
}, - "default_expression": "string",
- "quick_options": [
- {
- "label": "string",
- "expression": "string"
}
]
}
]
}, - "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"
], - "org_membership_roles": [
- "string"
]
}, - "requires_signature": false,
- "require_drawn_signature": false,
- "allow_amendments": true,
- "lock_on_next_complete": 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",
- "default_allow_self_service": true,
- "default_self_service_cap": 0
}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. | |
Allow Self Service (boolean) or Allow Self Service (null) (Allow Self Service) Per-instance override letting supervisors self-issue additional sibling permits from the public link. When null, the value is inherited from the template default (then the deprecated version default). Overrides the template default when set. | |
Self Service Cap (integer) or Self Service Cap (null) (Self Service Cap) Per-instance cap on how many extra permits can be self-issued from this instance's family. Must be 1 or more. Leave null for no limit. Only applies when allow_self_service resolves to true; ignored (cleared) when it resolves to false. | |
Run Follow On Agent Task (boolean) or Run Follow On Agent Task (null) (Run Follow On Agent Task) Per-issue choice for whether the form's follow-on agent on-submit task(s) should run when this instance is submitted. When null, the value is inherited from the project default and then the organisation default. Only meaningful when the form's active version has an AGENT_TASK on-submit task. |
{- "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"
], - "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true
}{- "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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "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). | |
Permit Group Id (string) or Permit Group Id (null) (Permit Group Id) Filter by permit_group_id to return all sibling permits in a family. | |
Requested By Email (string) or Requested By Email (null) (Requested By Email) Filter by the requester's email. Combine with template_id and project_id to locate a recipient's permit family when permit_group_id is unknown. | |
Origin Instance Id (string) or Origin Instance Id (null) (Origin Instance Id) Filter by origin instance ID to return its direct clones. | |
| page | integer (Page) >= 1 Default: 1 Page number (1-based). |
| size | integer (Size) [ 1 .. 200 ] Default: 20 Number of items per page (max 200). |
{- "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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "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,
- "next_cursor": "string"
}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. | |
Allow Self Service (boolean) or Allow Self Service (null) (Allow Self Service) Per-instance override applied to every issued instance, letting supervisors self-issue additional sibling permits from the public link. When null, the value is inherited from the template default (then the deprecated version default). | |
Self Service Cap (integer) or Self Service Cap (null) (Self Service Cap) Per-instance cap applied to every issued instance. Must be 1 or more. Leave null for no limit. Only applies when allow_self_service resolves to true. | |
Run Follow On Agent Task (boolean) or Run Follow On Agent Task (null) (Run Follow On Agent Task) Per-issue choice applied to every issued instance for whether the form's follow-on agent on-submit task(s) should run. When null, the value is inherited from the project default and then the organisation default. |
{- "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"
], - "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true
}{- "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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "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
}List form instances linked to an organisation (company) and/or a person, with a worklist status per instance and a roll-up summary.
Drives the "Forms" tab on the company/person detail surface. Provide
organization_id to scope to a company, and/or user_id to narrow to the forms
issued to a specific person. At least one must be supplied.
Each instance carries a worklist status:
completed: the form has been submittedin_progress: started but not yet submittedoverdue: past its due date (or expired) and not submittednot_started: issued but not started and not overdueThe summary rolls these up into total, complete, overdue, in_progress
and not_started. Cancelled instances are excluded unless include_cancelled is set.
Organization Id (string) or Organization Id (null) (Organization Id) Company (organisation) to list linked forms for. | |
User Id (string) or User Id (null) (User Id) Person (recipient user ID) to narrow the linked forms to. | |
Project Id (string) or Project Id (null) (Project Id) Optional project filter. | |
| include_cancelled | boolean (Include Cancelled) Default: false Include cancelled instances in the results and summary. |
| limit | integer (Limit) [ 1 .. 500 ] Default: 200 Maximum instances to return. |
{- "instances": [
- {
- "id": "string",
- "template_id": "string",
- "version_id": "string",
- "project_id": "string",
- "issued_to_user_id": "string",
- "issued_to_external": {
- "name": "string",
- "email": "string"
}, - "title": "string",
- "reference": "string",
- "status": "completed",
- "raw_status": "issued",
- "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "summary": {
- "total": 0,
- "complete": 0,
- "overdue": 0,
- "in_progress": 0,
- "not_started": 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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Clone an existing form instance into a fresh sibling instance, inheriting template, pinned version, prefill/locked/hidden fields, workflow config, instructions, project and expiry policy. The clone is linked back to the origin via origin_instance_id and shares a permit_group_id with all other siblings in the family.
| instance_id required | string (Instance Id) |
IssuedToExternal (object) or null External requester details for self-serve clones from the public view. Mutually optional with an authenticated session: when the caller is an authenticated user, identity is taken from the session. | |
Requested By Email (string) or Requested By Email (null) (Requested By Email) Override for the requester's email. When omitted, it is derived from requester_external or the authenticated user's profile. |
{- "requester_external": {
- "name": "string",
- "email": "string"
}, - "requested_by_email": "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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Cancel (dismiss) a form instance.
Only instances with status 'issued', 'in_progress' or 'expired' can be cancelled. The status held immediately before cancellation is recorded so the instance can be restored via the reinstate endpoint (Undo). The call is idempotent: cancelling an already-cancelled instance returns it unchanged.
| 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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Reinstate (un-cancel) a previously cancelled form instance.
Backs the Undo affordance on the Forms Dashboard quick-dismiss flow. The
instance is restored to the lifecycle state it held before being dismissed
(recorded in previous_status; defaulting to 'issued' when unknown). The
call is idempotent: reinstating an instance that is not cancelled returns it
unchanged, so a duplicate Undo request is harmless.
| 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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "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) | |
Instance Id (string) or Instance Id (null) (Instance 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) | |
Template Id (string) or Template Id (null) (Template Id) Filter by form template ID | |
| page | integer (Page) >= 1 Default: 1 |
| size | integer (Size) [ 1 .. 200 ] 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,
- "next_cursor": "string"
}List workflow form instances that have not yet been finalized into a submission.
The default Responses listing (GET /submissions) only returns fully-submitted
forms, which leaves an audit gap for workflow forms whose state lives in
per-section completions (e.g. a permit that has been granted but not closed).
This endpoint surfaces those partial instances and includes the latest
completion per section so callers can show who signed what, when, with which
signature, and link back to the per-section audit trail.
By default, instances with status submitted, cancelled, or expired are
excluded. Pass include_expired=true to retain expired instances in the result.
Project 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. | |
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 internal user the form was issued to. | |
| include_expired | boolean (Include Expired) Default: false Include expired instances in the result. |
| page | integer (Page) >= 1 Default: 1 |
| size | integer (Size) [ 1 .. 200 ] Default: 20 |
{- "items": [
- {
- "instance_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"
}, - "status": "issued",
- "workflow_status": "pending",
- "title": "string",
- "reference": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z",
- "completed_section_count": 0,
- "total_section_count": 0,
- "section_completions": [
- {
- "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",
- "method": "drawn",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string",
- "dutyholder_role": "client",
- "dutyholder_assignment_id": "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",
- "values": { }
}
]
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0,
- "next_cursor": "string"
}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 .. 200 ] 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,
- "next_cursor": "string"
}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,
- "require_drawn_signature": false,
- "allow_amendments": true,
- "assignees": [
- { }
], - "completed_by": { },
- "completed_at": "2019-08-24T14:15:22Z",
- "revision_count": 0,
- "is_current_user_assigned": false,
- "can_complete": false,
- "is_locked": false,
- "can_amend": 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 | |
SignatureMethod (string) or null How the signature was produced. Required when signature_data or use_saved_signature is provided. Sections with require_drawn_signature=true must use 'drawn'. | |
| use_saved_signature | boolean (Use Saved Signature) Default: false If true, apply the current user's saved profile signature instead of providing signature_data. The recorded method will be 'saved' and the section must not require a drawn signature. |
{- "section_id": "string",
- "values": { },
- "signature_data": "string",
- "signature_method": "drawn",
- "use_saved_signature": false
}{- "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",
- "method": "drawn",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string",
- "dutyholder_role": "client",
- "dutyholder_assignment_id": "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",
- "values": { }
}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 | |
SignatureMethod (string) or null How the new signature was produced (drawn/typed/uploaded/saved). | |
| use_saved_signature | boolean (Use Saved Signature) Default: false If true, apply the current user's saved profile signature. |
Amendment Note (string) or Amendment Note (null) (Amendment Note) Reason for amendment |
{- "values": { },
- "signature_data": "string",
- "signature_method": "drawn",
- "use_saved_signature": false,
- "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",
- "method": "drawn",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string",
- "dutyholder_role": "client",
- "dutyholder_assignment_id": "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",
- "values": { }
}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",
- "current_section_awaiting_user": false,
- "prefill_values": { },
- "locked_field_ids": [
- "string"
], - "hidden_field_ids": [
- "string"
], - "reference": "string",
- "origin_instance_id": "string",
- "permit_group_id": "string",
- "requested_by_email": "string",
- "allow_self_service": true,
- "self_service_cap": 0,
- "run_follow_on_agent_task": true,
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
], - "permissions": {
- "property1": true,
- "property2": true
}, - "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",
- "method": "drawn",
- "signed_at": "2019-08-24T14:15:22Z",
- "ip_address": "string",
- "user_agent": "string",
- "dutyholder_role": "client",
- "dutyholder_assignment_id": "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",
- "values": { }
}
]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) | |
OrganizationSecuritySettings (object) or null Org-level security policy, including 2FA enforcement (APP-1319). | |
Run Form Follow On Agent Tasks (boolean) or Run Form Follow On Agent Tasks (null) (Run Form Follow On Agent Tasks) Organisation-level default for whether a form's follow-on agent on-submit task runs when a form is submitted (APP-987). |
{- "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",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}
}, - "security_settings": {
- "require_2fa": false,
- "require_2fa_for_project_access": false,
- "require_2fa_for_org_admins": false,
- "grace_period_days": 0,
- "exempted_user_ids": [
- "string"
], - "policy_updated_at": "2019-08-24T14:15:22Z"
}, - "run_form_follow_on_agent_tasks": 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 | |
SignupAttribution (object) or null First-touch marketing attribution captured at signup | |
SavedSignature (object) or null Optional saved signature for re-use when completing form sections. Personal data — only exposed to the owning user. | |
| 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 |
| is_service_context | boolean (Is Service Context) Default: false True if authenticated via M2M/service token (allows cross-org access) |
| 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) |
| sso_managed | boolean (Sso Managed) Default: false True if this user's membership is managed by an enterprise SSO connection |
Sso Connection Id (string) or Sso Connection Id (null) (Sso Connection Id) ID of the SSO connection that provisioned this user, if any | |
| idp_groups | Array of strings (Idp Groups) Last-seen IdP groups from the SSO token/claims (for audit and role mapping) |
{- "_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"
}Get the org-level security policy (2FA enforcement). Org admins only.
| org_id required | string (Org Id) |
{- "require_2fa": false,
- "require_2fa_for_project_access": false,
- "require_2fa_for_org_admins": false,
- "grace_period_days": 0,
- "exempted_user_ids": [
- "string"
], - "policy_updated_at": "2019-08-24T14:15:22Z"
}Update the org-level security policy (2FA enforcement). Org admins only.
| org_id required | string (Org Id) |
| require_2fa | boolean (Require 2Fa) Default: false Enforce 2FA for all users with org-level access (members of this org). |
| require_2fa_for_project_access | boolean (Require 2Fa For Project Access) Default: false Enforce 2FA for non-org / project-only collaborators (users belonging to OTHER orgs) accessing this organisation's projects. |
| require_2fa_for_org_admins | boolean (Require 2Fa For Org Admins) Default: false When set, enforce 2FA for org/billing admins even if require_2fa is off. When require_2fa is on this is implied for everyone. |
Grace Period Days (integer) or Grace Period Days (null) (Grace Period Days) Optional grace window (in days, measured from policy_updated_at) during which users without 2FA are not yet blocked. None means no grace period. | |
| exempted_user_ids | Array of strings (Exempted User Ids) User IDs explicitly exempted from this org's 2FA enforcement. |
Policy Updated At (string) or Policy Updated At (null) (Policy Updated At) When the security policy was last changed; the grace period is measured from this timestamp. |
{- "require_2fa": false,
- "require_2fa_for_project_access": false,
- "require_2fa_for_org_admins": false,
- "grace_period_days": 0,
- "exempted_user_ids": [
- "string"
], - "policy_updated_at": "2019-08-24T14:15:22Z"
}{- "require_2fa": false,
- "require_2fa_for_project_access": false,
- "require_2fa_for_org_admins": false,
- "grace_period_days": 0,
- "exempted_user_ids": [
- "string"
], - "policy_updated_at": "2019-08-24T14:15:22Z"
}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,
- "next_cursor": "string"
}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 | |
Viewable Pdf Path (string) or Viewable Pdf Path (null) (Viewable Pdf Path) R2 path to a viewable PDF rendition of the document. Populated for Word documents (.doc/.docx), which browsers cannot render natively, so the in-app viewer can fetch and display a PDF instead. PDFs are served from r2_path directly and leave this unset. | |
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 | |
Content Hash (string) or Content Hash (null) (Content Hash) Hex digest of the document's raw bytes (SHA-256 by default). Indexed for content-based deduplication and submission-to-document matching (spec §4.2-4.3). | |
Content Hash Algo (string) or Content Hash Algo (null) (Content Hash Algo) Algorithm used to compute content_hash (e.g. 'sha256') | |
DocumentSource (string) or null How this document entered the system (upload, cde_sync, public_submission, …) | |
SourceSubmissionRef (object) or null Back-reference to the public-page submission this document was ingested from. Set only when source == PUBLIC_SUBMISSION. | |
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 | |
DrawingComparisonStatus (string) or null Status of automatic drawing comparison for this document. PENDING means the comparison is deferred (e.g. parent still processing) and will be retried; NOT_APPLICABLE means no comparison is expected. | |
Comparison Status Reason (string) or Comparison Status Reason (null) (Comparison Status Reason) Human-readable explanation for the current comparison_status. | |
Page Count (integer) or Page Count (null) (Page Count) Number of pages detected for this document (PDF page count). None when the page count could not be determined. | |
Comparison Eligible (boolean) or Comparison Eligible (null) (Comparison Eligible) Whether this document is eligible for drawing comparison. True for single-page documents, False for multi-page documents, None when eligibility could not be determined (e.g. unknown page count). | |
ComparisonEligibility (string) or null Machine-readable reason for the comparison eligibility decision (e.g. eligible, excluded_multipage, unknown_page_count). | |
Revision Of (string) or Revision Of (null) (Revision Of) Document ID of the parent document this is an explicit revision of | |
| removed_in_resubmission | boolean (Removed In Resubmission) Default: false Flagged when this document's slot/file was not re-supplied in a later resubmission for the same recipient+page. The document is never auto-deleted; this flag lets the UI surface the gap (spec §4.6). |
Removed In Resubmission At (string) or Removed In Resubmission At (null) (Removed In Resubmission At) When the document was flagged as removed-in-resubmission, if ever | |
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 |
| is_latest | boolean (Is Latest) Default: true Whether this is the latest version |
| is_deleted | boolean (Is Deleted) Default: false Whether the document is deleted |
PhotoMetadata (object) or null EXIF and device metadata for photo documents (location, device, timestamp) | |
| org_extraction_status | string (OrgExtractionStatus) Default: "pending" Enum: "pending" "success" "partial" "failed_enrichment" "failed_creation" Status of organization extraction during document processing |
Org Extraction Error (string) or Org Extraction Error (null) (Org Extraction Error) Human-readable summary of the last org extraction error, if any | |
Extracted Organization (object) or Extracted Organization (null) (Extracted Organization) Summary of the organization extracted from this document: {id, name, website_domain} or null. | |
| 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 |
AssigneeUser (object) or null User who uploaded the document (overridden server-side) |
{- "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",
- "document_id": "string",
- "revision_of": "string",
- "revision": "string",
- "filename": "string"
}
], - "thumbnail_image_path": "string",
- "full_image_path": "string",
- "viewable_pdf_path": "string",
- "error": "string",
- "error_detail": { },
- "filename": "string",
- "r2_path": "string",
- "file_extension": "string",
- "file_handling_tier": "RECORD_ONLY",
- "content_hash": "string",
- "content_hash_algo": "string",
- "source": "upload",
- "source_submission_ref": {
- "public_page_id": "string",
- "submission_id": "string",
- "file_id": "string",
- "block_id": "string",
- "submitter_email": "string",
- "ingested_at": "2019-08-24T14:15:22Z"
}, - "drawing_comparison_id": "string",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string",
- "removed_in_resubmission": false,
- "removed_in_resubmission_at": "2019-08-24T14:15:22Z",
- "virtual_document_id": "string",
- "virtual_document_version": 0,
- "auto_generated": false,
- "is_latest": true,
- "is_deleted": false,
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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": [ ],
- "photo_metadata": {
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0,
- "accuracy": 0,
- "altitude_accuracy": 0
}, - "captured_at": "2019-08-24T14:15:22Z",
- "device_make": "string",
- "device_model": "string",
- "orientation": 0,
- "image_width": 0,
- "image_height": 0
}
}, - "latest_version": "string",
- "is_latest": true,
- "is_deleted": false,
- "revision": "string",
- "purpose": "string",
- "keywords": [ ],
- "uploaded_by": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "company": "string"
}, - "org_extraction_status": "pending",
- "org_extraction_error": "string",
- "extracted_organization": { },
- "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",
- "comparison_status": "NOT_APPLICABLE",
- "comparison_status_reason": "string",
- "page_count": 0,
- "comparison_eligible": true,
- "comparison_eligibility_reason": "eligible",
- "revision_of": "string"
}Programme Management
Manage construction programmes and schedules.
Features:
Return milestones, programme tasks, and executions for a project.
When start_date and/or end_date are supplied, only programme tasks
whose planned window overlaps the requested range are returned. This trims
the payload for large programmes instead of returning every task.
| project_id required | string (Project Id) |
Start Date (string) or Start Date (null) (Start Date) Only include tasks whose planned window ends on or after this date | |
End Date (string) or End Date (null) (End Date) Only include tasks whose planned window starts on or before this date |
{- "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": { },
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string",
- "is_archived": false,
- "archived_at": "2019-08-24T14:15:22Z",
- "archived_by": "string",
- "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",
- "notify_override": {
- "enabled": true,
- "channels": [
- "string"
]
}, - "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,
- "current_step_id": "string",
- "current_step_name": "string",
- "started_at": "2019-08-24T14:15:22Z",
- "completed_at": "2019-08-24T14:15:22Z",
- "duration_ms": 0,
- "executed_by": "string",
- "executed_by_name": "string",
- "executed_by_email": "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",
- "notify_override": {
- "enabled": true,
- "channels": [
- "string"
]
}, - "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,
- "current_step_id": "string",
- "current_step_name": "string",
- "started_at": "2019-08-24T14:15:22Z",
- "completed_at": "2019-08-24T14:15:22Z",
- "duration_ms": 0,
- "executed_by": "string",
- "executed_by_name": "string",
- "executed_by_email": "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": { },
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string",
- "is_archived": false,
- "archived_at": "2019-08-24T14:15:22Z",
- "archived_by": "string",
- "created_by": "string",
- "updated_by": "string"
}List all programme tasks for a specific project.
| project_id required | string (Project Id) |
| include_archived | boolean (Include Archived) Default: false Include archived programme tasks (hidden by default). |
| include_deleted | boolean (Include Deleted) Default: false Include soft-deleted programme tasks (org admin only — soft-deleted records are retained for H&S / legal compliance). |
[- {
- "_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": { },
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string",
- "is_archived": false,
- "archived_at": "2019-08-24T14:15:22Z",
- "archived_by": "string",
- "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": { },
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string",
- "is_archived": false,
- "archived_at": "2019-08-24T14:15:22Z",
- "archived_by": "string",
- "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": { },
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string",
- "is_archived": false,
- "archived_at": "2019-08-24T14:15:22Z",
- "archived_by": "string",
- "created_by": "string",
- "updated_by": "string"
}Soft-delete a programme task.
Programme tasks are retained for H&S / legal compliance and never hard-deleted. Use the archive endpoint to hide a task from default UI lists.
| task_id required | string (Task Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "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"
}
]
}Export programme Gantt chart as a PDF file.
project_id: Project ID
page_size: Page size (a4, a3, letter, custom)
orientation: Page orientation (landscape, portrait)
start_date: Optional start of date range filter
end_date: Optional end of date range filter
current_user: Current authenticated user
PDF file as downloadable response
| project_id required | string (Project Id) |
| page_size | string (PageSize) Default: "a4" Enum: "a4" "a3" "letter" "custom" Supported page sizes. |
| orientation | string (Orientation) Default: "landscape" Enum: "landscape" "portrait" Page orientation. |
Start Date (string) or Start Date (null) (Start Date) | |
End Date (string) or End Date (null) (End Date) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Export programme Gantt chart as a PNG image.
project_id: Project ID
page_size: Page size (a4, a3, letter, custom)
orientation: Page orientation (landscape, portrait)
start_date: Optional start of date range filter
end_date: Optional end of date range filter
scale: Resolution multiplier (default 2.0 for retina)
current_user: Current authenticated user
PNG image as downloadable response
| project_id required | string (Project Id) |
| page_size | string (PageSize) Default: "a4" Enum: "a4" "a3" "letter" "custom" Supported page sizes. |
| orientation | string (Orientation) Default: "landscape" Enum: "landscape" "portrait" Page orientation. |
Start Date (string) or Start Date (null) (Start Date) | |
End Date (string) or End Date (null) (End Date) | |
| scale | number (Scale) Default: 2 |
{- "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 |
| include_dashboard | boolean (Include Dashboard) Default: false |
Metadata (object) or Metadata (null) (Metadata) |
{- "name": "string",
- "description": "string",
- "include_reports": true,
- "report_content_mode": "original",
- "placeholder_text": "string",
- "include_forms": true,
- "include_dashboard": false,
- "metadata": { }
}nullList 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"
}
]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,
- "dashboard_created": 0,
- "dashboard_widgets_added": 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 |
Is Hrb (boolean) or Is Hrb (null) (Is Hrb) Filter by Higher-Risk Building status. true = HRB only, false = non-HRB only, omit = all projects. | |
Organization Id (string) or Organization Id (null) (Organization Id) Scope the listing to a single organisation the caller belongs to. Defaults to the caller's currently active organisation. Projects owned by the caller's other organisations are excluded so an org switch cannot leak a stale cross-org project (APP-1299). |
{- "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,
- "next_cursor": "string"
}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 | |
Country (string) or Country (null) (Country) ISO 3166-1 alpha-2 country code of the site (e.g. 'GB', 'US'); drives location-conditional knowledge packs. | |
Subdivision (string) or Subdivision (null) (Subdivision) ISO 3166-2 sub-national code or bare subdivision of the site (e.g. 'US-CA' or 'CA') for sub-national packs. | |
Jurisdiction (string) or Jurisdiction (null) (Jurisdiction) Explicit jurisdiction code overriding country/subdivision for knowledge-pack resolution (e.g. 'GB', 'US-CA', 'EU'). | |
ProjectSectorEnum (string) or null Project sector classification | |
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 deleted | |
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 | |
| is_sample | boolean (Is Sample) Default: false Flag indicating this project is a seeded sample (used for the onboarding 'safe to explore' badge). |
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. | |
F10 Required (boolean) or F10 Required (null) (F10 Required) Whether the project requires an HSE F10 notification under CDM 2015. Null means notifiability has not yet been assessed. | |
F10 Reference (string) or F10 Reference (null) (F10 Reference) HSE-issued F10 notification reference number | |
F10 Submitted At (string) or F10 Submitted At (null) (F10 Submitted At) Date the original F10 notification was submitted to HSE | |
F10 Period Start (string) or F10 Period Start (null) (F10 Period Start) Start of the construction period covered by the F10 notification | |
F10 Period End (string) or F10 Period End (null) (F10 Period End) End of the construction period covered by the F10 notification | |
F10StatusEnum (string) or null Lifecycle status of the F10 notification | |
F10 Last Revised At (string) or F10 Last Revised At (null) (F10 Last Revised At) Date the F10 notification was last revised | |
F10 Notes (string) or F10 Notes (null) (F10 Notes) Free-text notes about the F10 notification | |
Expected Peak Workers (integer) or Expected Peak Workers (null) (Expected Peak Workers) Expected peak number of workers on site simultaneously. Used together with project duration to derive F10 notifiability. | |
Expected Person Days (integer) or Expected Person Days (null) (Expected Person Days) Expected total person-days of construction work. Used to derive F10 notifiability under CDM 2015. | |
Is Hrb (boolean) or Is Hrb (null) (Is Hrb) Whether the project is a Higher-Risk Building under the Building Safety Act 2022. Drives Gateway 2/3 flows and which evidence is in scope. Null means HRB status has not yet been assessed. | |
Hrb Storeys (integer) or Hrb Storeys (null) (Hrb Storeys) Number of storeys above ground level for the building. | |
Hrb Height M (number) or Hrb Height M (null) (Hrb Height M) Height of the building in metres, measured to the top occupied storey. | |
Hrb Residential Units (integer) or Hrb Residential Units (null) (Hrb Residential Units) Total number of residential units in the building. | |
HRBOccupationStatusEnum (string) or null Whether the building is in occupation or not yet occupied. | |
HRBBuildCategoryEnum (string) or null Build category for HRB scope: new build, Cat A alteration, or Cat B alteration. | |
Hrb Notes (string) or Hrb Notes (null) (Hrb Notes) Free-text notes about the HRB assessment. | |
| audit_stop_work_flag | boolean (Audit Stop Work Flag) Default: false Whether the project is currently under an auditor-issued stop-work directive. Set automatically by the audit follow-up pipeline (APP-431) when an auditor submits an audit with stop_work_recommended=true. |
Audit Stop Work At (string) or Audit Stop Work At (null) (Audit Stop Work At) Timestamp at which the stop-work flag was raised. | |
Audit Stop Work Submission Id (string) or Audit Stop Work Submission Id (null) (Audit Stop Work Submission Id) ID of the audit submission that triggered the stop-work flag. | |
Audit Stop Work Reason (string) or Audit Stop Work Reason (null) (Audit Stop Work Reason) Reason captured by the auditor when raising stop-work. | |
WholeLifeCostParameters (object) or null Whole-life-cost parameter set (study period, discount rate, maintenance regime, replacement cycles, energy price basis). Null means the project uses the standard ISO 15686-5 / HM Treasury Green Book defaults (APP-1337). | |
| 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,
- "country": "string",
- "subdivision": "string",
- "jurisdiction": "string",
- "sector": "residential",
- "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",
- "is_sample": false,
- "completion_percentage": 0,
- "organization_id": "string",
- "license_id": "string",
- "project_settings": {
- "uploads_to_pending": true,
- "process_uploads": true,
- "compare_uploads": true,
- "create_review_task": true,
- "review_task_assignee": "string",
- "task_priority_hours": {
- "low": 72,
- "medium": 48,
- "high": 24
}, - "minor_tw_categories": [
- "scaffold"
], - "run_form_follow_on_agent_tasks": true
}, - "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}
}, - "f10_required": true,
- "f10_reference": "string",
- "f10_submitted_at": "2019-08-24T14:15:22Z",
- "f10_period_start": "2019-08-24T14:15:22Z",
- "f10_period_end": "2019-08-24T14:15:22Z",
- "f10_status": "not_required",
- "f10_last_revised_at": "2019-08-24T14:15:22Z",
- "f10_notes": "string",
- "expected_peak_workers": 0,
- "expected_person_days": 0,
- "is_hrb": true,
- "hrb_storeys": 0,
- "hrb_height_m": 0,
- "hrb_residential_units": 0,
- "hrb_occupation_status": "in_occupation",
- "hrb_build_category": "new_build",
- "hrb_notes": "string",
- "audit_stop_work_flag": false,
- "audit_stop_work_at": "2019-08-24T14:15:22Z",
- "audit_stop_work_submission_id": "string",
- "audit_stop_work_reason": "string",
- "wlc_parameters": {
- "standard": "iso_15686_5",
- "study_period_years": 60,
- "discount_rate": 0.035,
- "discount_rate_basis": "hm_treasury_green_book",
- "currency": "GBP",
- "base_year": 0,
- "maintenance_regime": "reactive",
- "annual_maintenance_cost": 0,
- "annual_maintenance_pct_of_capex": 0,
- "replacement_cycles": [
- {
- "component": "string",
- "element_code": "string",
- "interval_years": 0,
- "unit_cost": 0,
- "notes": "string"
}
], - "energy_price_basis": {
- "source": "string",
- "base_year": 0,
- "base_price_per_kwh": 0,
- "annual_escalation_rate": 0,
- "notes": "string"
}, - "annual_operational_energy_kwh": 0,
- "notes": "string",
- "updated_at": "2019-08-24T14:15:22Z"
}, - "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) | |
ProjectSectorEnum (string) or null | |
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) | |
StatusEnum (string) or null | |
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) | |
Is Sample (boolean) or Is Sample (null) (Is Sample) | |
ProjectSettings (object) or null | |
Custom Fields (object) or Custom Fields (null) (Custom Fields) | |
Custom Field Definitions (object) or Custom Field Definitions (null) (Custom Field Definitions) | |
F10 Required (boolean) or F10 Required (null) (F10 Required) | |
F10 Reference (string) or F10 Reference (null) (F10 Reference) | |
F10 Submitted At (string) or F10 Submitted At (null) (F10 Submitted At) | |
F10 Period Start (string) or F10 Period Start (null) (F10 Period Start) | |
F10 Period End (string) or F10 Period End (null) (F10 Period End) | |
F10StatusEnum (string) or null | |
F10 Last Revised At (string) or F10 Last Revised At (null) (F10 Last Revised At) | |
F10 Notes (string) or F10 Notes (null) (F10 Notes) | |
Expected Peak Workers (integer) or Expected Peak Workers (null) (Expected Peak Workers) | |
Expected Person Days (integer) or Expected Person Days (null) (Expected Person Days) | |
Is Hrb (boolean) or Is Hrb (null) (Is Hrb) | |
Hrb Storeys (integer) or Hrb Storeys (null) (Hrb Storeys) | |
Hrb Height M (number) or Hrb Height M (null) (Hrb Height M) | |
Hrb Residential Units (integer) or Hrb Residential Units (null) (Hrb Residential Units) | |
HRBOccupationStatusEnum (string) or null | |
HRBBuildCategoryEnum (string) or null | |
Hrb Notes (string) or Hrb Notes (null) (Hrb Notes) | |
WholeLifeCostParameters (object) or null |
{- "name": "string",
- "project_reference": "string",
- "logo": "string",
- "location": "string",
- "latitude": 0,
- "longitude": 0,
- "sector": "residential",
- "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"
], - "completion_percentage": 0,
- "updated_by": "string",
- "archived": true,
- "archived_at": "2019-08-24T14:15:22Z",
- "is_sample": true,
- "project_settings": {
- "uploads_to_pending": true,
- "process_uploads": true,
- "compare_uploads": true,
- "create_review_task": true,
- "review_task_assignee": "string",
- "task_priority_hours": {
- "low": 72,
- "medium": 48,
- "high": 24
}, - "minor_tw_categories": [
- "scaffold"
], - "run_form_follow_on_agent_tasks": true
}, - "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}
}, - "f10_required": true,
- "f10_reference": "string",
- "f10_submitted_at": "2019-08-24T14:15:22Z",
- "f10_period_start": "2019-08-24T14:15:22Z",
- "f10_period_end": "2019-08-24T14:15:22Z",
- "f10_status": "not_required",
- "f10_last_revised_at": "2019-08-24T14:15:22Z",
- "f10_notes": "string",
- "expected_peak_workers": 0,
- "expected_person_days": 0,
- "is_hrb": true,
- "hrb_storeys": 0,
- "hrb_height_m": 0,
- "hrb_residential_units": 0,
- "hrb_occupation_status": "in_occupation",
- "hrb_build_category": "new_build",
- "hrb_notes": "string",
- "wlc_parameters": {
- "standard": "iso_15686_5",
- "study_period_years": 60,
- "discount_rate": 0.035,
- "discount_rate_basis": "hm_treasury_green_book",
- "currency": "GBP",
- "base_year": 0,
- "maintenance_regime": "reactive",
- "annual_maintenance_cost": 0,
- "annual_maintenance_pct_of_capex": 0,
- "replacement_cycles": [
- {
- "component": "string",
- "element_code": "string",
- "interval_years": 0,
- "unit_cost": 0,
- "notes": "string"
}
], - "energy_price_basis": {
- "source": "string",
- "base_year": 0,
- "base_price_per_kwh": 0,
- "annual_escalation_rate": 0,
- "notes": "string"
}, - "annual_operational_energy_kwh": 0,
- "notes": "string",
- "updated_at": "2019-08-24T14:15:22Z"
}
}{- "_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"
}Atomically archive a project, setting archived=true, status='archived' and archived_at together so any client stays consistent.
| 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"
}Atomically restore a project, setting archived=false, status='active' and clearing archived_at together so any client stays consistent.
| 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"
}Return the categories that default to the minor workflow on this project.
New projects (no TWC opt-in yet) return an empty list.
| project_id required | string (Project Id) |
{- "categories": [
- "scaffold"
]
}Replace the project's minor-workflow allowlist atomically (TWC-controlled).
Only a project's TWC, a project admin, or an org admin may mutate the list. Every successful PUT writes an audit entry capturing the actor, project and the before/after diff.
| project_id required | string (Project Id) |
| categories | Array of strings (Categories) Items Enum: "scaffold" "formwork" "falsework" "propping" "back_propping" "excavation_support" "sheet_piling" "cofferdam" "hoarding" "edge_protection" "temp_access" "crane_base" "mast_climber" "hoist" "other" "minor_screen" "dust_hoarding" "floor_protection" "signage_barrier" |
{- "categories": [
- "scaffold"
]
}{- "categories": [
- "scaffold"
]
}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 .. 500 ] 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) | |
Search (string) or Search (null) (Search) Case-insensitive search across member name, email, role and organisation name |
{- "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,
- "next_cursor": "string"
}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,
- "next_cursor": "string"
}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 |
| send_email | boolean (Send Email) Default: true Whether to send invitation email. Set false to create the record without emailing. |
{- "email": "string",
- "name": "string",
- "role": "member",
- "project_roles": [
- "string"
], - "personal_message": "string",
- "expires_in_days": 7,
- "send_email": true
}{- "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"
}
]
}Create a safe-to-explore sample project populated with demonstration documents, a toolbox-talk form template, mock team members, one issued form and a few calendar events. Idempotent per user: subsequent calls by the same user return the existing sample project without creating duplicates.
{- "project_id": "string",
- "route": "string",
- "is_new": true
}Get onboarding (setup guide) progress for a specific project.
Returns only project-scoped workflows for the given project, including any
phase-specific dynamic workflows. This is the dedicated counterpart to
GET /api/v1/user/onboarding for project setup (BE-12 / §5.1).
| project_id required | string (Project Id) |
| include_dynamic | boolean (Include Dynamic) Default: true Include dynamically generated phase-specific workflows |
{- "context": {
- "applied_roles": [
- "org_admin"
], - "project_phase": "construction"
}, - "onboarding_complete": false,
- "overall_progress_percentage": 40,
- "suggestions": [
- {
- "actions": [
- {
- "action_type": "primary",
- "activity_id": "org.branding.setup",
- "label": "Set Up Branding",
- "path": "/settings/branding"
}
], - "cta_path": "/settings/branding",
- "cta_text": "Set Up Branding",
- "description": "Add your logo and brand colors",
- "display_type": "banner",
- "icon": "wand-sparkles",
- "priority": 1,
- "reason": "Continue with Set Up Your Organization",
- "step_id": "setup_branding",
- "suggestion_id": "suggest_org_setup_branding",
- "title": "Set Up Branding",
- "workflow_id": "onboarding.org_setup"
}
], - "user_id": "507f1f77bcf86cd799439011",
- "workflows": [
- {
- "completed": false,
- "description": "Complete your organization profile",
- "display_type": "banner",
- "is_dynamic": false,
- "name": "Set Up Your Organization",
- "progress_percentage": 33.3,
- "steps": [
- {
- "activity_ids": [
- "org.branding.setup"
], - "completed": false,
- "description": "Add your logo and brand colors",
- "icon": "wand-sparkles",
- "name": "Set Up Branding",
- "step_id": "setup_branding"
}
], - "workflow_id": "onboarding.org_setup"
}
]
}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
}Create a new public page.
Creates a configurable page accessible by external parties via a share link. Automatically creates an associated public share and optionally sends an invitation email to the recipient.
| title required | string (Title) <= 300 characters |
Description (string) or Description (null) (Description) | |
| page_type required | string (Page Type) <= 100 characters |
| project_id required | string (Project Id) |
Workspace Item Id (string) or Workspace Item Id (null) (Workspace Item Id) | |
Lifecycle Code (string) or Lifecycle Code (null) (Lifecycle Code) | |
Recipient Name (string) or Recipient Name (null) (Recipient Name) | |
Recipient Email (string) or Recipient Email (null) (Recipient Email) | |
Recipient Company (string) or Recipient Company (null) (Recipient Company) | |
Recipient Company Id (string) or Recipient Company Id (null) (Recipient Company Id) | |
Array of objects (Blocks) | |
| downloadable_document_ids | Array of strings (Downloadable Document Ids) |
Array of Allowed Upload Types (strings) or Allowed Upload Types (null) (Allowed Upload Types) | |
Max Upload Size Mb (integer) or Max Upload Size Mb (null) (Max Upload Size Mb) | |
Max Uploads (integer) or Max Uploads (null) (Max Uploads) | |
| verification_method | string (VerificationMethod) Default: "email_match" Enum: "email_code" "access_code" "email_match" "none" Methods for verifying the identity of a page visitor. |
Access Code (string) or Access Code (null) (Access Code) Plain-text access code (will be hashed before storage) | |
On Submit Workflow Config Id (string) or On Submit Workflow Config Id (null) (On Submit Workflow Config Id) | |
On Submit Agent Task Id (string) or On Submit Agent Task Id (null) (On Submit Agent Task Id) | |
On Submit Stage Transition (string) or On Submit Stage Transition (null) (On Submit Stage Transition) | |
On Accept Stage Transition (string) or On Accept Stage Transition (null) (On Accept Stage Transition) | |
On Accept Agent Task Id (string) or On Accept Agent Task Id (null) (On Accept Agent Task Id) | |
On Reject Agent Task Id (string) or On Reject Agent Task Id (null) (On Reject Agent Task Id) | |
On Resubmission Agent Task Id (string) or On Resubmission Agent Task Id (null) (On Resubmission Agent Task Id) | |
DocumentIngestionConfig (object) or null | |
Max Submissions (integer) or Max Submissions (null) (Max Submissions) | |
| allow_resubmission | boolean (Allow Resubmission) Default: true |
| notify_on_submit_user_ids | Array of strings (Notify On Submit User Ids) |
| notify_on_accept_user_ids | Array of strings (Notify On Accept User Ids) |
| notify_recipient_on_accept | boolean (Notify Recipient On Accept) Default: true |
| notify_recipient_on_reject | boolean (Notify Recipient On Reject) Default: true |
| notify_recipient_on_resubmission_request | boolean (Notify Recipient On Resubmission Request) Default: true |
Expires In Days (integer) or Expires In Days (null) (Expires In Days) | |
| send_invitation_email | boolean (Send Invitation Email) Default: true Send an invitation email to the recipient on creation |
{- "title": "string",
- "description": "string",
- "page_type": "string",
- "project_id": "string",
- "workspace_item_id": "string",
- "lifecycle_code": "string",
- "recipient_name": "string",
- "recipient_email": "string",
- "recipient_company": "string",
- "recipient_company_id": "string",
- "blocks": [
- {
- "block_type": "instructions",
- "order": 0,
- "title": "string",
- "description": "string",
- "config": { },
- "required": false
}
], - "downloadable_document_ids": [
- "string"
], - "allowed_upload_types": [
- "string"
], - "max_upload_size_mb": 1,
- "max_uploads": 1,
- "verification_method": "email_code",
- "access_code": "string",
- "on_submit_workflow_config_id": "string",
- "on_submit_agent_task_id": "string",
- "on_submit_stage_transition": "string",
- "on_accept_stage_transition": "string",
- "on_accept_agent_task_id": "string",
- "on_reject_agent_task_id": "string",
- "on_resubmission_agent_task_id": "string",
- "document_ingestion_config": {
- "enabled": false,
- "trigger": "on_submit",
- "target_status": "draft",
- "file_handling_tier": "RECORD_ONLY",
- "apply_to_blocks": [
- "string"
], - "category": "string",
- "tags": [
- "string"
], - "dedupe_scope": "project"
}, - "max_submissions": 0,
- "allow_resubmission": true,
- "notify_on_submit_user_ids": [
- "string"
], - "notify_on_accept_user_ids": [
- "string"
], - "notify_recipient_on_accept": true,
- "notify_recipient_on_reject": true,
- "notify_recipient_on_resubmission_request": true,
- "expires_in_days": 1,
- "send_invitation_email": true
}{- "id": "string",
- "title": "string",
- "description": "string",
- "status": "draft",
- "page_type": "string",
- "organization_id": "string",
- "project_id": "string",
- "created_by": "string",
- "created_by_name": "string",
- "workspace_item_id": "string",
- "workspace_item_ref": "string",
- "lifecycle_code": "string",
- "recipient_name": "string",
- "recipient_email": "string",
- "recipient_company": "string",
- "recipient_company_id": "string",
- "blocks": [
- {
- "block_id": "string",
- "block_type": "instructions",
- "order": 0,
- "title": "string",
- "description": "string",
- "config": { },
- "required": false
}
], - "downloadable_document_ids": [
- "string"
], - "allowed_upload_types": [
- "string"
], - "max_upload_size_mb": 0,
- "max_uploads": 0,
- "verification_method": "email_code",
- "on_submit_workflow_config_id": "string",
- "on_submit_agent_task_id": "string",
- "on_submit_stage_transition": "string",
- "on_accept_stage_transition": "string",
- "on_accept_agent_task_id": "string",
- "on_reject_agent_task_id": "string",
- "on_resubmission_agent_task_id": "string",
- "document_ingestion_config": {
- "enabled": false,
- "trigger": "on_submit",
- "target_status": "draft",
- "file_handling_tier": "RECORD_ONLY",
- "apply_to_blocks": [
- "string"
], - "category": "string",
- "tags": [
- "string"
], - "dedupe_scope": "project"
}, - "submissions": [
- {
- "submission_id": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "submitter_name": "string",
- "submitter_email": "string",
- "values": { },
- "uploaded_files": [
- {
- "file_id": "string",
- "filename": "string",
- "content_type": "string",
- "size_bytes": 0,
- "r2_key": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "download_url": "string",
- "block_id": "string",
- "document_id": "string",
- "ingestion_status": "pending"
}
], - "verification_method": "string",
- "verified_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "review_notes": "string",
- "resubmission_of": "string",
- "generated_report_id": "string",
- "generated_report_error": "string"
}
], - "max_submissions": 0,
- "allow_resubmission": true,
- "notify_on_submit_user_ids": [
- "string"
], - "notify_on_accept_user_ids": [
- "string"
], - "notify_recipient_on_accept": true,
- "notify_recipient_on_reject": true,
- "notify_recipient_on_resubmission_request": true,
- "share_id": "string",
- "share_token": "string",
- "share_url": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}List public pages for the current organization.
Project Id (string) or Project Id (null) (Project Id) Filter by project ID | |
PublicPageStatus (string) or Status (null) (Status) | |
Page Type (string) or Page Type (null) (Page Type) Filter by page type | |
| skip | integer (Skip) >= 0 Default: 0 |
| limit | integer (Limit) [ 1 .. 100 ] Default: 50 |
{ }Get a public page by ID.
| page_id required | string (Page Id) |
{- "id": "string",
- "title": "string",
- "description": "string",
- "status": "draft",
- "page_type": "string",
- "organization_id": "string",
- "project_id": "string",
- "created_by": "string",
- "created_by_name": "string",
- "workspace_item_id": "string",
- "workspace_item_ref": "string",
- "lifecycle_code": "string",
- "recipient_name": "string",
- "recipient_email": "string",
- "recipient_company": "string",
- "recipient_company_id": "string",
- "blocks": [
- {
- "block_id": "string",
- "block_type": "instructions",
- "order": 0,
- "title": "string",
- "description": "string",
- "config": { },
- "required": false
}
], - "downloadable_document_ids": [
- "string"
], - "allowed_upload_types": [
- "string"
], - "max_upload_size_mb": 0,
- "max_uploads": 0,
- "verification_method": "email_code",
- "on_submit_workflow_config_id": "string",
- "on_submit_agent_task_id": "string",
- "on_submit_stage_transition": "string",
- "on_accept_stage_transition": "string",
- "on_accept_agent_task_id": "string",
- "on_reject_agent_task_id": "string",
- "on_resubmission_agent_task_id": "string",
- "document_ingestion_config": {
- "enabled": false,
- "trigger": "on_submit",
- "target_status": "draft",
- "file_handling_tier": "RECORD_ONLY",
- "apply_to_blocks": [
- "string"
], - "category": "string",
- "tags": [
- "string"
], - "dedupe_scope": "project"
}, - "submissions": [
- {
- "submission_id": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "submitter_name": "string",
- "submitter_email": "string",
- "values": { },
- "uploaded_files": [
- {
- "file_id": "string",
- "filename": "string",
- "content_type": "string",
- "size_bytes": 0,
- "r2_key": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "download_url": "string",
- "block_id": "string",
- "document_id": "string",
- "ingestion_status": "pending"
}
], - "verification_method": "string",
- "verified_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "review_notes": "string",
- "resubmission_of": "string",
- "generated_report_id": "string",
- "generated_report_error": "string"
}
], - "max_submissions": 0,
- "allow_resubmission": true,
- "notify_on_submit_user_ids": [
- "string"
], - "notify_on_accept_user_ids": [
- "string"
], - "notify_recipient_on_accept": true,
- "notify_recipient_on_reject": true,
- "notify_recipient_on_resubmission_request": true,
- "share_id": "string",
- "share_token": "string",
- "share_url": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Update a public page.
| page_id required | string (Page Id) |
Title (string) or Title (null) (Title) | |
Description (string) or Description (null) (Description) | |
PublicPageStatus (string) or null | |
Array of Blocks (objects) or Blocks (null) (Blocks) | |
Array of Downloadable Document Ids (strings) or Downloadable Document Ids (null) (Downloadable Document Ids) | |
Recipient Name (string) or Recipient Name (null) (Recipient Name) | |
Recipient Email (string) or Recipient Email (null) (Recipient Email) | |
Recipient Company (string) or Recipient Company (null) (Recipient Company) | |
Array of Notify On Submit User Ids (strings) or Notify On Submit User Ids (null) (Notify On Submit User Ids) | |
Array of Notify On Accept User Ids (strings) or Notify On Accept User Ids (null) (Notify On Accept User Ids) | |
Expires In Days (integer) or Expires In Days (null) (Expires In Days) |
{- "title": "string",
- "description": "string",
- "status": "draft",
- "blocks": [
- {
- "block_type": "instructions",
- "order": 0,
- "title": "string",
- "description": "string",
- "config": { },
- "required": false
}
], - "downloadable_document_ids": [
- "string"
], - "recipient_name": "string",
- "recipient_email": "string",
- "recipient_company": "string",
- "notify_on_submit_user_ids": [
- "string"
], - "notify_on_accept_user_ids": [
- "string"
], - "expires_in_days": 1
}{- "id": "string",
- "title": "string",
- "description": "string",
- "status": "draft",
- "page_type": "string",
- "organization_id": "string",
- "project_id": "string",
- "created_by": "string",
- "created_by_name": "string",
- "workspace_item_id": "string",
- "workspace_item_ref": "string",
- "lifecycle_code": "string",
- "recipient_name": "string",
- "recipient_email": "string",
- "recipient_company": "string",
- "recipient_company_id": "string",
- "blocks": [
- {
- "block_id": "string",
- "block_type": "instructions",
- "order": 0,
- "title": "string",
- "description": "string",
- "config": { },
- "required": false
}
], - "downloadable_document_ids": [
- "string"
], - "allowed_upload_types": [
- "string"
], - "max_upload_size_mb": 0,
- "max_uploads": 0,
- "verification_method": "email_code",
- "on_submit_workflow_config_id": "string",
- "on_submit_agent_task_id": "string",
- "on_submit_stage_transition": "string",
- "on_accept_stage_transition": "string",
- "on_accept_agent_task_id": "string",
- "on_reject_agent_task_id": "string",
- "on_resubmission_agent_task_id": "string",
- "document_ingestion_config": {
- "enabled": false,
- "trigger": "on_submit",
- "target_status": "draft",
- "file_handling_tier": "RECORD_ONLY",
- "apply_to_blocks": [
- "string"
], - "category": "string",
- "tags": [
- "string"
], - "dedupe_scope": "project"
}, - "submissions": [
- {
- "submission_id": "string",
- "submitted_at": "2019-08-24T14:15:22Z",
- "submitter_name": "string",
- "submitter_email": "string",
- "values": { },
- "uploaded_files": [
- {
- "file_id": "string",
- "filename": "string",
- "content_type": "string",
- "size_bytes": 0,
- "r2_key": "string",
- "uploaded_at": "2019-08-24T14:15:22Z",
- "download_url": "string",
- "block_id": "string",
- "document_id": "string",
- "ingestion_status": "pending"
}
], - "verification_method": "string",
- "verified_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "review_notes": "string",
- "resubmission_of": "string",
- "generated_report_id": "string",
- "generated_report_error": "string"
}
], - "max_submissions": 0,
- "allow_resubmission": true,
- "notify_on_submit_user_ids": [
- "string"
], - "notify_on_accept_user_ids": [
- "string"
], - "notify_recipient_on_accept": true,
- "notify_recipient_on_reject": true,
- "notify_recipient_on_resubmission_request": true,
- "share_id": "string",
- "share_token": "string",
- "share_url": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Accept a submission on a public page.
| page_id required | string (Page Id) |
| submission_id required | string (Submission Id) |
Review Notes (string) or Review Notes (null) (Review Notes) | |
Any of string (Review Notes) | |
{- "review_notes": "string"
}{- "property1": "string",
- "property2": "string"
}Reject a submission on a public page.
| page_id required | string (Page Id) |
| submission_id required | string (Submission Id) |
Review Notes (string) or Review Notes (null) (Review Notes) | |
Any of string (Review Notes) | |
{- "review_notes": "string"
}{- "property1": "string",
- "property2": "string"
}Request resubmission with feedback notes.
| page_id required | string (Page Id) |
| submission_id required | string (Submission Id) |
Review Notes (string) or Review Notes (null) (Review Notes) | |
Any of string (Review Notes) | |
{- "review_notes": "string"
}{- "property1": "string",
- "property2": "string"
}Re-queue the on-submit agent task for a failed submission (APP-390).
Looks up the page that owns the submission within the caller's
organisation, clears any captured generated_report_error and
stale generated_report_id on the submission, then re-enqueues
the page's on-submit agent task. The frontend banner / triage tile
will return to the in-progress state on the next refetch.
| submission_id required | string (Submission Id) |
{- "property1": "string",
- "property2": "string"
}Resolve a permit hub for a returning recipient (APP-800).
hub_token: Opaque per-recipient hub token.
email: Recipient email for the verification gate.
db: Database client.
The recipient's permits for this hub's project/template.
HTTPException: 404 if the hub is unknown, 401 if email is required,
403 if the email does not match the hub recipient.
| hub_token required | string (Hub Token) |
Email (string) or Email (null) (Email) |
{- "hub_token": "string",
- "recipient_email": "string",
- "permit_count": 0,
- "can_request_another": false,
- "permits": [
- {
- "instance_id": "string",
- "share_token": "string",
- "reference": "string",
- "title": "string",
- "status": "issued",
- "workflow_status": "pending",
- "expires_at": "2019-08-24T14:15:22Z",
- "summary_values": [
- {
- "field_id": "string",
- "label": "string",
- "value": { },
- "icon": "string",
- "show_on_card": false
}
]
}
]
}Generate a new QR code for a resource.
| resource_type required | string (QRCodeResourceType) Enum: "form_instance" "public_share" "project" "document" "report" "plant" 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,
- "next_cursor": "string"
}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" "BIM" "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 |
Approval Status (string) or Approval Status (null) (Approval Status) Optional approval gate (opt-in). When omitted the report is created live with no review gate (default behaviour). When set it must be one of the ApprovalStatus values (pending / in_progress / approved / rejected / revoked). |
{- "title": "string",
- "project_id": "string",
- "content": "string",
- "category": "Environmental",
- "format": "Text",
- "sharing": [
- {
- "user_id": "string",
- "user_name": "string",
- "role": "Owner"
}
], - "tags": [
- "string"
], - "approval_status": "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,
- "approval_status": "string",
- "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
created_at_start: Optional start datetime filter (inclusive)
created_at_end: Optional end datetime filter (inclusive)
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 | |
Created At Start (string) or Created At Start (null) (Created At Start) Return reports created on or after this datetime | |
Created At End (string) or Created At End (null) (Created At End) Return reports created on or before this datetime | |
| 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"
], - "approval_status": "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,
- "next_cursor": "string"
}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,
- "approval_status": "string",
- "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,
- "approval_status": "string",
- "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,
- "approval_status": "string",
- "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,
- "next_cursor": "string"
}List previous-version metadata for a report (no content payload).
Use GET /reports/{report_id}/versions/{version}/content to fetch the
actual content for a specific version.
| 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": [
- {
- "version": 0,
- "title": "string",
- "category": "Environmental",
- "format": "Text",
- "tags": [
- "string"
], - "changed_by": "string",
- "changed_by_name": "string",
- "changes": { },
- "content_size": 0,
- "has_content": true,
- "created_at": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0,
- "next_cursor": "string"
}Return the content payload for a specific previous version.
Content may be served inline from Mongo or fetched transparently from R2 when the snapshot was tiered off for size reasons.
| report_id required | string (Report Id) |
| version required | integer (Version) |
{- "version": 0,
- "content": "string"
}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 and pagination.
project_id: Project ID
status: Filter by task status
assigned_to: Filter by assigned user ID
task_type: Filter by task type (manual, programme, automated)
page: Page number (1-based)
size: Number of items per page
include_archived: Include archived records (hidden by default)
include_deleted: Include soft-deleted records (org admin only)
current_user: Current authenticated user
Paginated 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) | |
TaskType (string) or Task Type (null) (Task Type) | |
| page | integer (Page) >= 1 Default: 1 Page number (1-based). |
| size | integer (Size) [ 1 .. 100 ] Default: 20 Number of items per page (max 100). |
| include_archived | boolean (Include Archived) Default: false Include archived tasks (hidden by default). |
| include_deleted | boolean (Include Deleted) Default: false Include soft-deleted tasks (org admin only — soft-deleted records are retained for H&S / legal compliance and normally hidden from the UI). |
{- "items": [
- {
- "_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"
}
], - "total": 0,
- "page": 1,
- "size": 1,
- "has_more": true,
- "total_pages": 0,
- "next_cursor": "string"
}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 | |
| task_type | string (TaskType) Default: "manual" Enum: "manual" "programme" "automated" Type of task: manual, programme, or automated |
| 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" "urgent" 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) DEPRECATED (APP-851): use | |
Related Object Type (string) or Related Object Type (null) (Related Object Type) DEPRECATED (APP-851): use | |
| document_ids | Array of strings (Document Ids) Canonical multi-document link field (APP-851). |
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 | |
Source Submission Id (string) or Source Submission Id (null) (Source Submission Id) FormSubmission ID this task was raised from (APP-341) | |
Source Item Index (integer) or Source Item Index (null) (Source Item Index) 0-based index of the flagged item within the submission's repeater values (APP-341). | |
TaskSchedule (object) or null Scheduling configuration for recurring or one-time execution | |
Planned Start (string) or Planned Start (null) (Planned Start) Planned start date | |
Planned End (string) or Planned End (null) (Planned End) Planned end date | |
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 | |
Float Days (number) or Float Days (null) (Float Days) Float days in the schedule | |
| milestone_ids | Array of strings (Milestone Ids) Milestone IDs |
Phase (string) or Phase (null) (Phase) Phase designation | |
| on_critical_path | boolean (On Critical Path) Default: false Whether task is on the critical path |
{- "name": "string",
- "description": "string",
- "task_type": "manual",
- "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",
- "document_ids": [
- "string"
], - "project_id": "string",
- "created_by": "string",
- "closed_reason": "string",
- "closed_reason_code": "document_revised",
- "source_submission_id": "string",
- "source_item_index": 0,
- "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"
}, - "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "float_days": 0,
- "milestone_ids": [
- "string"
], - "phase": "string",
- "on_critical_path": false
}{- "_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) | |
TaskType (string) or null | |
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) | |
Array of Document Ids (strings) or Document Ids (null) (Document Ids) | |
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 | |
Planned Start (string) or Planned Start (null) (Planned Start) | |
Planned End (string) or Planned End (null) (Planned End) | |
Adjusted Start (string) or Adjusted Start (null) (Adjusted Start) | |
Adjusted End (string) or Adjusted End (null) (Adjusted End) | |
Float Days (number) or Float Days (null) (Float Days) | |
Array of Milestone Ids (strings) or Milestone Ids (null) (Milestone Ids) | |
Phase (string) or Phase (null) (Phase) | |
On Critical Path (boolean) or On Critical Path (null) (On Critical Path) |
{- "name": "string",
- "description": "string",
- "task_type": "manual",
- "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",
- "document_ids": [
- "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"
}, - "planned_start": "2019-08-24T14:15:22Z",
- "planned_end": "2019-08-24T14:15:22Z",
- "adjusted_start": "2019-08-24T14:15:22Z",
- "adjusted_end": "2019-08-24T14:15:22Z",
- "float_days": 0,
- "milestone_ids": [
- "string"
], - "phase": "string",
- "on_critical_path": true
}{- "_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"
}Create multiple tasks in a single request.
Designed for agent workflows that process form submissions and generate a
list of action tasks. Each item uses title, assignee_role, and
due_date_offset (days from today) rather than the standard
TaskCreate field names. Unknown fields are folded into tags or the
task description rather than causing a validation error.
The tasks body field accepts:
tasks array.request: Batch task creation request.
current_user: Authenticated user (must have project access).
db: Database connection.
``TaskBatchResult`` with successfully created tasks and any per-item
failures.
HTTPException 400: If ``project_id`` is invalid or ``tasks`` cannot
be parsed.
HTTPException 403: If the user is not authorised for the project.
HTTPException 404: If the project does not exist.
| project_id required | string (Project Id) Project to create tasks in. |
| tasks required | any (Tasks) Tasks to create. May be a JSON string, a dict with a 'tasks' array, or a list of task objects. |
Source (object) or Source (null) (Source) Source metadata (e.g. form submission reference). |
{- "project_id": "string",
- "tasks": null,
- "source": { }
}{- "created": [
- {
- "_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"
}
], - "failed": [
- { }
], - "total": 0,
- "created_count": 0,
- "failed_count": 0
}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" "progress_report" "inspection_report" "compliance_report" "project_report" "project_document" "general_report" "general_document" "building_user_guide" "building_log_book" "commissioning_report" "handover_document" "operations_manual" "design_report" "sustainability_report" "fire_strategy" "waste_management_plan" "traffic_management_plan" "travel_plan" "tender_report" "cost_report" "programme_report" "environmental_impact_assessment" "asset_register" "nec_early_warning_log" "nec_programme_submission" "ground_investigation_report" "ceequal_report" "utility_plans" "infrastructure_monthly_report" "asset_handover_pack" "interface_management_plan" "stakeholder_engagement_plan" "bim_execution_plan" Supported virtual document template types. |
| scope | string (TemplateScope) 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)'. | |
Iu Cost Override (number) or Iu Cost Override (null) (Iu Cost Override) Fixed IU charge for generating a document from this template. When set, this exact value is charged and shown instead of the section-based estimate. Set per-template in planops-configs as a subjective high/medium/low rating (3/2/1). | |
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",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}
}, - "user_input_schema": {
- "fields": [
- {
- "field_name": "string",
- "field_type": "string",
- "label": "string",
- "description": "string",
- "required": false,
- "filter": { },
- "options": [
- { }
], - "advanced": false,
- "generation": {
- "agent_id": "string",
- "task_id": "string",
- "defaults": { },
- "defaults_locked": false,
- "hide_inputs": [
- "string"
], - "output_mapping": {
- "source_path": "string",
- "value_type": "single_id",
- "merge_strategy": "replace"
}
}, - "default_value": { },
- "default_expression": "string"
}
]
}, - "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",
- "iu_cost_override": 0,
- "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.
When project_id is provided, returns all templates available for that project:
Organization Id (string) or Organization Id (null) (Organization Id) | |
Project Id (string) or Project Id (null) (Project Id) Filter templates available for a specific project. Returns APP templates, ORG templates for the project's organization, and PROJECT templates assigned to this project. | |
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 | |
Iu Cost Override (number) or Iu Cost Override (null) (Iu Cost Override) |
{- "template_name": "string",
- "template_type": "health_safety_plan",
- "scope": "app",
- "description": "string",
- "custom_fields": { },
- "custom_field_definitions": {
- "property1": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "visible_in_templates": true
}, - "property2": {
- "type": "text",
- "description": "string",
- "help_text": "string",
- "example_value": { },
- "unit": "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",
- "regex": "string",
- "currency_code": "string",
- "unit": "string",
- "max_file_size_bytes": 0,
- "allowed_mime_types": [
- "string"
]
}, - "validation_regex": "string",
- "display_order": 0,
- "order_index": 0,
- "category": "General",
- "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": [
- { }
], - "advanced": false,
- "generation": {
- "agent_id": "string",
- "task_id": "string",
- "defaults": { },
- "defaults_locked": false,
- "hide_inputs": [
- "string"
], - "output_mapping": {
- "source_path": "string",
- "value_type": "single_id",
- "merge_strategy": "replace"
}
}, - "default_value": { },
- "default_expression": "string"
}
]
}, - "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"
}, - "iu_cost_override": 0
}{- "_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) |
| diff_format | string (Diff Format) Default: "structured" Enum: "structured" "raw" Diff payload format. 'structured' (default) emits field_changes; 'raw' emits legacy old_value/new_value blobs for debugging. |
| 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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "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 | |
| recipient_user_ids | Array of strings (Recipient User Ids) Project members to receive the issued document version (APP-542). |
| notify | boolean (Notify) Default: true If True and recipient_user_ids is non-empty, send DOCUMENT_ISSUED notifications. |
{- "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
}
}
], - "recipient_user_ids": [
- "string"
], - "notify": true
}{- "_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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string"
}Retrieve a generated virtual document.
| document_id required | string (Document Id) |
| include_data_snapshot | boolean (Include Data Snapshot) Default: false |
| include_generation_inputs | boolean (Include Generation Inputs) Default: true |
{- "_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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "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) | |
Array of Recipient User Ids (strings) or Recipient User Ids (null) (Recipient User Ids) Recipients for the new version. Only accepted when the patch creates a new version (APP-542). | |
| notify | boolean (Notify) Default: true If True and recipients are provided, dispatch DOCUMENT_ISSUED notifications. |
{- "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
}
}
], - "recipient_user_ids": [
- "string"
], - "notify": true
}{- "_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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string"
}Soft-delete a generated virtual document (APP-816).
Sets is_deleted=True, deleted_at and deleted_by on the document
row, mirroring the soft-delete behaviour of uploaded documents and reports.
Auth: the document's creator or an org admin of the owning organization.
| document_id required | string (Document Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "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,
- "is_edited": false
}
]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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string"
}
], - "total": 0
}Fetch the historical snapshot of a specific version, looked up by its own document_id.
Use this variant when version_number is not guaranteed unique across template revisions. Returns the version row as it was stored at generation time (no re-rendering).
| document_id required | string (Document Id) |
| prior_document_id required | string (Prior Document Id) |
| include_data_snapshot | boolean (Include Data Snapshot) Default: false |
| include_generation_inputs | boolean (Include Generation Inputs) Default: true |
{- "_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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string"
}Fetch the historical snapshot of a specific version of a virtual document.
Returns the version row as it was stored at generation time. Content is byte-identical to what was rendered at generation; no re-rendering against current templates/data is performed.
RBAC mirrors GET /documents/{document_id}: viewer of the current document can view history.
| document_id required | string (Document Id) |
| version_number required | integer (Version Number) |
| include_data_snapshot | boolean (Include Data Snapshot) Default: false |
| include_generation_inputs | boolean (Include Generation Inputs) Default: true |
{- "_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",
- "field_changes": [
- {
- "path": "string",
- "operation": "added",
- "summary": "string",
- "old": { },
- "new": { }
}
], - "summary_for_humans": "string",
- "old_value": "string",
- "new_value": "string"
}
], - "agentcon_document_id": "string",
- "metadata": { },
- "generation_inputs": { },
- "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",
- "recipients": [
- {
- "user_id": "string",
- "added_by": "string",
- "added_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "notified_at": "2019-08-24T14:15:22Z",
- "first_viewed_at": "2019-08-24T14:15:22Z",
- "last_viewed_at": "2019-08-24T14:15:22Z",
- "notification_id": "string",
- "reviewed_at": "2019-08-24T14:15:22Z",
- "review_duration_ms": 0
}
], - "issued_at": "2019-08-24T14:15:22Z",
- "issued_by": "string",
- "is_edited": false,
- "edited_by": "string",
- "edited_at": "2019-08-24T14:15:22Z",
- "is_deleted": false,
- "deleted_at": "2019-08-24T14:15:22Z",
- "deleted_by": "string"
}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. | |
| create_project_document | boolean (Create Project Document) Default: true If true, create a project document record and queue processing. Set to false for preview-only PDF downloads that skip analysis. |
{- "purpose": "manual_export",
- "upload_to_agentcon": false,
- "filename": "string",
- "agentcon_metadata": { },
- "create_project_document": true
}{- "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": { }
}Return the resolved selections that would seed a regenerate request.
Lets the FE prefill the regenerate panel before submission.
| document_id required | string (Document Id) |
{- "document_id": "string",
- "template_id": "string",
- "project_id": "string",
- "title": "string",
- "version_number": 0,
- "generation_inputs": { },
- "reconstructed": false
}Regenerate a document, seeding from the prior version's persisted selections.
By default this runs synchronously and returns the new VirtualDocument
(a freshly-superseding version of the source). Pass queue=true to fall
back to the legacy enqueue behaviour.
| document_id required | string (Document Id) |
User Inputs (object) or User Inputs (null) (User Inputs) Overrides merged over the prior document's generation_inputs. | |
Title (string) or Title (null) (Title) Optional new title; defaults to the prior document's title. | |
| queue | boolean (Queue) Default: false If True, enqueue a RegenerationJob (legacy behaviour) instead of generating synchronously. The job will still seed from the prior document's generation_inputs. |
{- "user_inputs": { },
- "title": "string",
- "queue": false
}{ }Issue a previously-saved version to recipients (APP-542 §6.3).
| document_id required | string (Document Id) |
| version_id required | string (Version Id) |
| property name* additional property | any |
{ }nullAdd recipients to the latest version (older versions are frozen).
| document_id required | string (Document Id) |
| version_id required | string (Version Id) |
| property name* additional property | any |
{ }nullRecord that the current user viewed this version and track review dwell time.
Actions (request body action):
open (default) - stamps first_viewed_at/last_viewed_at and marks the
recipient VIEWED; emits the existing VIEWED activity on first view.heartbeat - periodic ping while actively viewing; extends the coarse, capped
active-review duration.close - finalises the review, persists reviewed_at and emits the
server-side document_reviewed analytics event (compliance evidence).| document_id required | string (Document Id) |
| version_id required | string (Version Id) |
| action | string (Action) Default: "open" Enum: "open" "heartbeat" "close" |
{- "action": "open"
}{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}Return the user_ids issued on the most recent prior issued version.
Used by the FE to pre-fill the recipient picker on regenerate / edit-flow.
| document_id required | string (Document Id) |
nullRestore (un-delete) a soft-deleted generated virtual document (APP-819).
Clears is_deleted, deleted_at and deleted_by. Org-admin only —
restricted to admins of the document's owning organization.
| document_id required | string (Document Id) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}