/document/redlineCompare Documents (Redline)
Upload an original DOCX (left_docx) and a revised DOCX (right_docx) as multipart/form-data. By default the response is a DOCX based on the revised document with differences represented as Microsoft Word tracked changes.
Set output_type to get a readable change list instead of, or as well as, the DOCX. Every output type costs the same number of credits. Page numbers in the change list come from Diffchecker's own layout of the redline and can differ from Word's, especially when a document uses fonts that are not available on the server.
Parameters
Diffchecker-VersionheaderstringAPI version to serve the request with. Defaults to the newest version, currently 1, when omitted. An unsupported version is rejected with 400 UNSUPPORTED_API_VERSION. See Versioning and Deprecation in the getting started guide.
Values: 1
Default: 1
emailquerystringYour email address. Required if not using an API key.
output_typequerystringSpecifies the type of output you receive in the response body.
- docx: The tracked-changes DOCX (Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document)
- markdown: A readable change list, with a stable ID for each change, followed by the full document text with the changes marked (Content-Type: text/markdown)
- json: Change counts, comment changes, the same Markdown, and the DOCX as a base64 data URL (Content-Type: application/json)
Values: docx, markdown, json
Default: docx
diff_levelquerystringSpecifies how finely changed text is compared. smart chooses between word and character changes. Default is smart.
Values: smart, word, character
Default: smart
compare_formattingquerystringWhether to report formatting changes. Default is true.
Values: true, false
Default: true
compare_tablesquerystringWhether to compare tables. When false, tables are taken from the revised document unchanged. Default is true.
Values: true, false
Default: true
compare_headersquerystringWhether to compare headers and footers. When false, they are taken from the revised document unchanged. Default is true.
Values: true, false
Default: true
compare_footnotesquerystringWhether to compare footnotes and endnotes. Default is true.
Values: true, false
Default: true
compare_textboxesquerystringWhether to compare text inside text boxes. When false, text boxes are taken from the revised document unchanged. Default is true.
Values: true, false
Default: true
compare_fieldsquerystringWhether to compare field codes such as cross-references and page numbers. When false, field codes are taken from the revised document, and their displayed text is still compared as plain text. Default is true.
Values: true, false
Default: true
compare_commentsquerystringWhether to compare Word comments. When false, comments are taken from the revised document unchanged and no comment changes are reported. Default is true.
Values: true, false
Default: true
show_movesquerystringWhether to report relocated text as moves. When false, it is reported as a deletion and an insertion. Default is true.
Values: true, false
Default: true
pre_existing_revisionsquerystringHow to treat tracked changes already in the uploaded documents. accept applies them before comparing, and reject undoes them. When omitted, they stay in the documents and can appear in the output mixed with the changes this comparison finds, so setting a value is recommended for documents that may contain tracked changes.
Values: accept, reject
Request Bodyrequired
left_docxstring (binary)requiredOriginal Word document. The uploaded filename must end in .docx.
right_docxstring (binary)requiredRevised Word document. The uploaded filename must end in .docx.
Responses
Every response includes the X-Credits-Used header. In JSON responses, the same value is also available in the creditsUsed field.
The requested output. Usage has committed before delivery starts.
application/vnd.openxmlformats-officedocument.wordprocessingml.document
string (binary)text/markdown
stringapplication/json
creditsUsedintegerrequiredCredits charged for the diff request.
countsobjectrequiredNumber of changes found. total is the sum of the others.
totalintegerrequiredinsertionsintegerrequireddeletionsintegerrequiredmovesintegerrequiredformattingintegerrequiredcommentsintegerrequiredcommentChangesobject[]requiredAdded, removed and edited Word comments. Empty when compare_comments=false.
kindstringrequiredEnum: added, removed, edited
commentIdintegerrequiredThe comment's w:id in the returned DOCX. When anchorUnsupported is true, the comment is not in the returned DOCX and this is its w:id in the original document, which can match an unrelated comment's id in the returned DOCX.
parentCommentIdintegerThe w:id in the returned DOCX of the comment this one replies to, when that comment is in the returned DOCX.
durableIdstringWord's durable identifier for the comment, when the document has one.
authorstringrequiredinitialsstringdatestringThe date as written in the document.
dateUtcstringThe date in UTC, when the document records one.
textstringrequiredThe comment's text. For a removed comment, its text in the original document.
oldTextstringThe original text of an edited comment.
anchorTextstringThe document text the comment is attached to.
resolvedbooleanrequiredanchorScopestringThe part of the document the comment is attached to. Absent when no anchor was found.
Enum: body, footnote, endnote, header, footer
anchorApproximatebooleanPresent when the comment's position in the returned DOCX is approximate, because its original anchor has no exact place in the document body.
Enum:
anchorUnsupportedbooleanPresent when the comment is reported here but not included in the returned DOCX, because it is attached to a part of the document this request did not compare, such as footnotes with compare_footnotes=false.
Enum:
markdownstringrequiredThe same change list returned by output_type=markdown.
docxstringrequiredThe tracked-changes DOCX as a base64 data URL.
Example Request
curl -X POST \
"https://api.staging.diffchecker.com/public/document/redline?email=your@email.com&output_type=docx&diff_level=smart&compare_formatting=true&compare_tables=true&compare_headers=true&compare_footnotes=true&compare_textboxes=true&compare_fields=true&compare_comments=true&show_moves=true&pre_existing_revisions=accept" \
-F "left_docx=@/path/to/left_docx.docx" \
-F "right_docx=@/path/to/right_docx.docx" \
--output "redline.docx"Try It
Click or drag to upload
Click or drag to upload