POST /v1/document-templates
Upload a .docx document to create a template owned by your workspace. It can be an empty template or a completed report you want to reuse. Send multipart/form-data with the file in document and a readable template name in name.
The response includes the template id, revision, paragraph IDs, placeholders, and saved report formatting. Use these details to replace report-specific text with placeholders and remove leftover paragraphs. Uploaded formatting and images are preserved.
Turn an existing report into a reusable template
A completed report can be uploaded before its placeholders are ready. Replace the old findings and impression with {{ findings }} and {{ impression }}, then delete any remaining report-specific text. Both placeholders are required before downloading a sample or generating a report.
The compressed upload limit is 2,000,000 bytes. The API accepts ordinary .docx documents and rejects unsafe or unsupported content such as macros, embedded objects, external relationships, and tracked changes. Use Word to simplify a document if validation rejects its structure.
Working with Word templates
Update a Word template
Authentication
Create a named API key in your workspace’s API keys tab, then send it in the Authorization header on each API request. Your key connects the integration to that workspace’s saved settings and Word templates. Signing into the website does not replace this header in an API integration.
Authorization: Bearer <API_KEY>
Keep the key in your application’s server-side secret configuration. It is shown only once when created, so save it securely then. Do not place it in browser code, logs, version control, or a prompt sent to your coding agent. You can revoke an integration’s key from the workspace without changing the other keys.
Request
multipart/form-data
| Name | Type | Required | Constraints | Description |
|---|
| document | string | Yes | — | Word document (.docx) to reuse as a template, including an existing completed report. |
| name | string | Yes | minLength=1; maxLength=80 | A readable name for choosing this template later. |
Example
BASE_URL=https://radiologydictation.com
curl --request POST "$BASE_URL/v1/document-templates" \
--header "Authorization: Bearer $API_KEY" \
--form document=@report-template.docx \
--form name=Template
Responses
| Status | Description | Type |
|---|
| 200 | Successful Response | TemplateDetail · application/json |
| 401 | Invalid or missing API key | object · application/json |
| 429 | Too many attempts. Please try again later. | object · application/json |
| 503 | Service is unavailable. Please try again. | object · application/json |
| 413 | Word template exceeds the configured limits. | object · application/json |
| 422 | Invalid Word template. | object · application/json |
| 415 | Check the required fields and their lengths. | object · application/json |
| Header | Type | Description |
|---|
| Retry-After | string | — |
Schemas
Body_upload_template_v1_document_templates_post
| Name | Type | Required | Constraints | Description |
|---|
| document | string | Yes | — | Word document (.docx) to reuse as a template, including an existing completed report. |
| name | string | Yes | minLength=1; maxLength=80 | A readable name for choosing this template later. |
Paragraph
| Name | Type | Required | Constraints | Description |
|---|
| id | string | Yes | — | — |
| text | string | Yes | — | — |
| editable | boolean | Yes | — | — |
| deletable | boolean | No | default=false | — |
| move_group | string | null | No | — | — |
| markers | array<ParagraphMarker> | No | — | — |
ParagraphMarker
| Name | Type | Required | Constraints | Description |
|---|
| kind | string | Yes | enum=["page_break", "page_break_before", "column_break", "section_break", "image", "field", "anchor", "table_cell", "protected_structure"] | — |
| position | string | Yes | enum=["before", "within", "after"] | — |
| offset | integer | null | No | — | — |
| section_type | string | null | No | — | — |
| Name | Type | Required | Constraints | Description |
|---|
| findings_blank_paragraph | boolean | No | default=false | — |
| impression_blank_paragraph | boolean | No | default=false | — |
| findings_bulleted | boolean | null | No | — | — |
| impression_bulleted | boolean | null | No | — | — |
| findings_bold | boolean | null | No | — | — |
| findings_underline | boolean | null | No | — | — |
| findings_italic | boolean | null | No | — | — |
| impression_bold | boolean | null | No | — | — |
| impression_underline | boolean | null | No | — | — |
| impression_italic | boolean | null | No | — | — |
TemplateDetail
| Name | Type | Required | Constraints | Description |
|---|
| id | string | Yes | — | — |
| name | string | Yes | — | — |
| revision | integer | Yes | — | — |
| created_at | string (date-time) | Yes | — | — |
| updated_at | string (date-time) | Yes | — | — |
| paragraphs | array<Paragraph> | Yes | — | — |
| placeholders | array<string> | Yes | — | — |
| spacing | ReportFormatting | No | — | — |
| bulleted_placeholders | array<string> | No | — | — |
| placeholder_formatting | object | No | — | — |
TextFormatting
| Name | Type | Required | Constraints | Description |
|---|
| bold | boolean | No | default=false | — |
| underline | boolean | No | default=false | — |
| italic | boolean | No | default=false | — |