Upload a Word template

Markdown
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
NameTypeRequiredConstraintsDescription
documentstringYes—Word document (.docx) to reuse as a template, including an existing completed report.
namestringYesminLength=1; maxLength=80A 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

StatusDescriptionType
200Successful ResponseTemplateDetail · application/json
401Invalid or missing API keyobject · application/json
429Too many attempts. Please try again later.object · application/json
503Service is unavailable. Please try again.object · application/json
413Word template exceeds the configured limits.object · application/json
422Invalid Word template.object · application/json
415Check the required fields and their lengths.object · application/json

Response headers · 429

HeaderTypeDescription
Retry-Afterstring—

Schemas

Body_upload_template_v1_document_templates_post

NameTypeRequiredConstraintsDescription
documentstringYes—Word document (.docx) to reuse as a template, including an existing completed report.
namestringYesminLength=1; maxLength=80A readable name for choosing this template later.

Paragraph

NameTypeRequiredConstraintsDescription
idstringYes——
textstringYes——
editablebooleanYes——
deletablebooleanNodefault=false—
move_groupstring | nullNo——
markersarray<ParagraphMarker>No——

ParagraphMarker

NameTypeRequiredConstraintsDescription
kindstringYesenum=["page_break", "page_break_before", "column_break", "section_break", "image", "field", "anchor", "table_cell", "protected_structure"]—
positionstringYesenum=["before", "within", "after"]—
offsetinteger | nullNo——
section_typestring | nullNo——

ReportFormatting

NameTypeRequiredConstraintsDescription
findings_blank_paragraphbooleanNodefault=false—
impression_blank_paragraphbooleanNodefault=false—
findings_bulletedboolean | nullNo——
impression_bulletedboolean | nullNo——
findings_boldboolean | nullNo——
findings_underlineboolean | nullNo——
findings_italicboolean | nullNo——
impression_boldboolean | nullNo——
impression_underlineboolean | nullNo——
impression_italicboolean | nullNo——

TemplateDetail

NameTypeRequiredConstraintsDescription
idstringYes——
namestringYes——
revisionintegerYes——
created_atstring (date-time)Yes——
updated_atstring (date-time)Yes——
paragraphsarray<Paragraph>Yes——
placeholdersarray<string>Yes——
spacingReportFormattingNo——
bulleted_placeholdersarray<string>No——
placeholder_formattingobjectNo——

TextFormatting

NameTypeRequiredConstraintsDescription
boldbooleanNodefault=false—
underlinebooleanNodefault=false—
italicbooleanNodefault=false—

Select and copy