Document Details API
The Document Details API manages document-specific section and rule details, including nested extraction rules generated during document production.Update Document Details
Full replacement (PUT) of a document’s section and rule details. All existing sections are deleted and replaced.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
mrt_id | string | Yes | UUID of the document details record |
Request Body
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sections | array | Yes | Sections with nested rules (at least one required) |
docx_url | string | No | S3 URL of DOCX file |
endpoint_analysis | string | No | Analysis text |
output_name | string | No | Output file name |
connector_data_id | string | No | Data connector ID |
rule_type_to_table_like_status | object | No | Rule type mappings |
auto_increment_regeneration | boolean | No | Auto-increment regeneration count |
Section Parameters
Each section must include:| Parameter | Type | Required | Description |
|---|---|---|---|
order_index | integer | Yes | Position in document |
level | integer | Yes | Nesting level |
section_id | string | No | Section identifier |
title | string | No | Section title |
synopsis | string | No | Brief summary |
template_instructions | string | No | Instructions |
template_text | string | No | Template text |
additional_details | object | No | JSONB metadata |
relevant_chunk_ids | array | No | Referenced chunk IDs |
relevant_chunk_names | array | No | Referenced chunk names |
rules | array | No | Nested extraction rules |
Rule Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
confidence_score | number | No | Confidence level (0-1) |
rule_type | string | No | Type of rule |
rule_mode | string | No | Rule operation mode |
description | string | No | Rule description |
explanation | string | No | Explanation of results |
generated_content | string | No | Generated content |
rule_parameters | object | No | Rule-specific parameters |
Request Example
Python Example
Response
Status Codes
- 200 OK: Document details updated successfully
- 400 Bad Request: Invalid structure
- 401 Unauthorized: Missing or invalid Bearer token
- 403 Forbidden: User not authorized
- 404 Not Found: Document details or parent document not found
- 422 Unprocessable Entity: Request validation error
- 500 Internal Server Error: Database error
Get Document Details by Document ID
Retrieve the document details for a specific document.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
document_id | string | Yes | UUID of parent document |
Request Example
Response
Status Codes
- 200 OK: Document details retrieved successfully
- 401 Unauthorized: Missing or invalid Bearer token
- 403 Forbidden: User not authorized (document belongs to different organization)
- 404 Not Found: Document not found or no details record found for document
- 500 Internal Server Error: Database error
Features
- Auto-Sorted: Sections are automatically sorted by
order_index - Hierarchical: Supports multiple nesting levels via
levelparameter - Rule Nesting: Each section can contain multiple nested rules
- Organization-Scoped: Returns only records belonging to the authenticated user’s organization