DocInject can render any published or draft document as a formatted Word document (Documentation Index
Fetch the complete documentation index at: https://docs.docinject.com/llms.txt
Use this file to discover all available pages before exploring further.
.docx) or as plain Markdown. Word exports use a template you upload to control the visual styling — your branding, fonts, and layout are applied automatically. Markdown exports return a clean text representation of the document hierarchy.
Export as Word (.docx)
.docx file. The response includes a Content-Disposition header with the filename.
You must supply a template_id. Retrieve available template IDs from the List templates endpoint.
Path parameters
The ID of the document to export.
Query parameters
The ID of the Word template to use for rendering. Get available IDs from
GET /templates.Example request
Response
Returns200 OK with the binary .docx content.
| Header | Value |
|---|---|
Content-Type | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
Content-Disposition | attachment; filename="<document-title>.docx" |
400 Bad Request if template_id is missing, or 404 Not Found if the document or template does not exist.
Export as Markdown
h1, sections become h2, steps become h3, and sub-steps become h4. Node content is converted from the rich text format to plain text paragraphs and bullet lists.
Path parameters
The ID of the document to export.
Example request
Response
Returns200 OK with the Markdown content as plain text.
| Header | Value |
|---|---|
Content-Type | text/markdown |
Content-Disposition | attachment; filename="<document-title>.md" |
List templates
Example request
Response
Returns200 OK with an array of template objects.
Unique template identifier. Use this as
template_id in the export endpoint.ID of the organization that owns this template.
User ID of the member who uploaded the template.
Display name for the template.
Indentation width in inches used for nested content inside the template.
ISO 8601 timestamp of when the template was uploaded.
ISO 8601 timestamp of the last update.
200
Upload a template
.docx) to your organization. The template controls the visual styling of exported documents — formatting, branding, and layout are derived from the uploaded file. Only .docx files are accepted.
Send the request as multipart/form-data.
Request body
A display name for the template, for example
"Q3 Brand Template".The
.docx template file. Must be a valid Word document.Indentation width in inches for nested content within the exported document. Defaults to
0.5.Example request
Response
Returns201 Created with the new template object.
201
400 Bad Request if name or file is missing, or if the uploaded file is not a .docx.
Delete a template
Path parameters
The ID of the template to delete.
Example request
curl
Response
Returns204 No Content on success. Returns 403 Forbidden if you are not the template creator or an organization admin, or 404 Not Found if the template does not exist.