POST /v1/documents
Use this endpoint when you already have structured findings and impression and want to format them as a Word document. It fills an owned, saved template using the report text you provide. It does not transcribe audio or generate a Technique section for you.
Read your template to obtain template_id and template_revision. Send these with a report object containing ordered findings and impression arrays. Include an active API key and a new Idempotency-Key. The successful response is a .docx attachment, not a JSON object.
Fill the optional fields
Optional top-level patient_name, date_of_birth, referring_physician, patient_id, and date_of_study fields override the matching values from report for this Word document only. If omitted, the values from report are used. Optional technique, exam_title, clinical_history, and comparison fields fill their matching placeholders. Pass the Technique result’s technique text when you have generated it separately. Include review_flags from your source report so they remain visible in the document.
The saved template revision supplies the document layout and Findings/Impression formatting controls. List items become Word paragraphs, and the rest of the template retains its formatting. The API preserves review flags even if the template has no designated placeholder for them.
Save the response and handle retries
Save a successful response body directly as a Word file, up to 4,000,000 bytes. Check the status and Content-Type first so an error JSON response is not saved as a .docx. Identical retries with the same API key and Idempotency-Key can download the saved document for 24 hours after completion, even if the template has since changed or been deleted.
Changing any input requires a new request key. After the recovery window, the original key cannot start another generation. Request status with operation=documents.render reports state only; it does not return the Word file.
Working with Word templates
Requests, retries, and downloads
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.
Parameters
| Name | Type | Required | Constraints | Description |
|---|
| Idempotency-Key | header: string | Yes | — | — |
Request
application/json
| Name | Type | Required | Constraints | Description |
|---|
| template_id | string | Yes | pattern="^[a-f0-9]{32}$" | ID of a Word template owned by your workspace, returned by upload or listing. |
| template_revision | integer | Yes | minimum=1.0 | Saved template revision to use. Read the template to obtain its current revision. |
| report | DocumentReport | Yes | — | The structured findings, impression, and review flags to place into the Word document. |
| technique | string | No | maxLength=20000; default="" | Optional Technique text to fill the matching placeholder; this endpoint does not generate it. |
| patient_name | string | null | No | — | Optional override for the patient name in this Word document. When omitted, uses report.patient_name. |
| date_of_birth | string | null | No | — | Optional override for the date of birth in this Word document. When omitted, uses report.date_of_birth. |
| referring_physician | string | null | No | — | Optional override for the referring physician in this Word document. When omitted, uses report.referring_physician. |
| patient_id | string | null | No | — | Optional override for the patient ID in this Word document. When omitted, uses report.patient_id. |
| date_of_study | string | null | No | — | Optional override for the date of study in this Word document. When omitted, uses report.date_of_study. |
| exam_title | string | No | maxLength=20000; default="" | Optional examination title for the Exam title placeholder. |
| clinical_history | string | No | maxLength=20000; default="" | Optional supplied clinical history for the matching placeholder. |
| comparison | string | No | maxLength=20000; default="" | Optional supplied comparison wording for the matching placeholder. |
Request examples
{
"exam_title": "Example exam",
"report": {
"findings": [
"Example finding."
],
"impression": [
"Example impression."
]
},
"template_id": "00000000000000000000000000000000",
"template_revision": 1
}
Example
BASE_URL=https://radiologydictation.com
curl --request POST "$BASE_URL/v1/documents" \
--header "Authorization: Bearer $API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--header "Content-Type: application/json" \
--data '{"exam_title": "Example exam", "report": {"findings": ["Example finding."], "impression": ["Example impression."]}, "template_id": "00000000000000000000000000000000", "template_revision": 1}' \
--output report.docx
Responses
| Status | Description | Type |
|---|
| 200 | Successful Response | string (binary) · application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| 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 |
| 404 | Template not found. | object · application/json |
| 409 | This idempotency key was already used for different input. | object · application/json |
| 413 | Word template exceeds the configured limits. | object · application/json |
| 422 | Invalid Word template. | object · application/json |
| 400 | Idempotency-Key header required | object · application/json |
| 415 | JSON request required. | object · application/json |
| 500 | Document generation failed. | object · application/json |
| 502 | Document generation failed. | object · application/json |
| Header | Type | Description |
|---|
| Content-Disposition | string | — |
| X-Request-Id | string | — |
| X-Template-Version | string | — |
| X-Template-Hash | string | — |
| X-Review-Flags | string | — |
| Header | Type | Description |
|---|
| Retry-After | string | — |
| Header | Type | Description |
|---|
| X-Request-Id | string | Server request identifier for support. |
| X-Request-Status | string | Request outcome status. |
Schemas
DocumentReport
| Name | Type | Required | Constraints | Description |
|---|
| schema_version | string | No | default="1.2" | — |
| standard_id | string | null | No | — | — |
| technique | string | No | maxLength=20000; default="Not provided." | — |
| patient_name | string | No | maxLength=20000; default="Not provided." | — |
| date_of_birth | string | No | maxLength=20000; default="Not provided." | — |
| referring_physician | string | No | maxLength=20000; default="Not provided." | — |
| patient_id | string | No | maxLength=20000; default="Not provided." | — |
| date_of_study | string | No | maxLength=20000; default="Not provided." | — |
| findings | array<string> | Yes | maxItems=200 | — |
| impression | array<string> | Yes | maxItems=100 | — |
| review_flags | array<ReviewFlag> | No | maxItems=100 | — |
| transcription | TimestampedTranscript | null | No | — | — |
DocumentRequest
| Name | Type | Required | Constraints | Description |
|---|
| template_id | string | Yes | pattern="^[a-f0-9]{32}$" | ID of a Word template owned by your workspace, returned by upload or listing. |
| template_revision | integer | Yes | minimum=1.0 | Saved template revision to use. Read the template to obtain its current revision. |
| report | DocumentReport | Yes | — | The structured findings, impression, and review flags to place into the Word document. |
| technique | string | No | maxLength=20000; default="" | Optional Technique text to fill the matching placeholder; this endpoint does not generate it. |
| patient_name | string | null | No | — | Optional override for the patient name in this Word document. When omitted, uses report.patient_name. |
| date_of_birth | string | null | No | — | Optional override for the date of birth in this Word document. When omitted, uses report.date_of_birth. |
| referring_physician | string | null | No | — | Optional override for the referring physician in this Word document. When omitted, uses report.referring_physician. |
| patient_id | string | null | No | — | Optional override for the patient ID in this Word document. When omitted, uses report.patient_id. |
| date_of_study | string | null | No | — | Optional override for the date of study in this Word document. When omitted, uses report.date_of_study. |
| exam_title | string | No | maxLength=20000; default="" | Optional examination title for the Exam title placeholder. |
| clinical_history | string | No | maxLength=20000; default="" | Optional supplied clinical history for the matching placeholder. |
| comparison | string | No | maxLength=20000; default="" | Optional supplied comparison wording for the matching placeholder. |
ReviewFlag
| Name | Type | Required | Constraints | Description |
|---|
| issue | string | Yes | — | What needs review. |
| transcript_excerpt | string | Yes | — | Relevant source transcript text. |
| audio_start_seconds | number | null | No | — | Start time in seconds, when available. |
| audio_end_seconds | number | null | No | — | End time in seconds, when available. |
TimestampedTranscript
| Name | Type | Required | Constraints | Description |
|---|
| text | string | Yes | — | — |
| words | array<TranscriptWord> | Yes | — | Word timestamps in seconds from the beginning of the audio. |
TranscriptWord
| Name | Type | Required | Constraints | Description |
|---|
| word | string | Yes | — | — |
| start | number | Yes | minimum=0.0 | Word start time in seconds from the beginning of the audio. |
| end | number | Yes | exclusiveMinimum=0.0 | Word end time in seconds from the beginning of the audio. |