Error envelope
Every non-2xx response has the same body. code is drawn from a closed vocabulary and
is what your code should branch on; message is human-readable and may change.
{
"error": {
"code": "UNSUPPORTED_FILE_TYPE",
"message": "original must be a .docx, .doc, or .pdf file",
"request_id": "01J..."
}
}Send an X-Request-Id header to correlate your logs with ours. If you don't, one is minted
and echoed back in the response.
Request errors
| Status | Code | Cause | Retry? |
|---|---|---|---|
| 400 | INVALID_REQUEST | Malformed request: a missing, empty, or unnamed file field, a merge with too few or too many revisions, or an unknown reference topic | No, fix the request |
| 400 | INVALID_AUTHORIZATION_CODE | POST /v1/api-keys: the code is unknown, expired or used, or its verifier or redirect does not match | No, sign in again |
| 400 | INVALID_EDIT | An edit was refused: a stale schema_version, a selector that matched nothing or too much, or an undefined combination | No, fix the edits |
| 400 | UNSUPPORTED_FILE_TYPE | Extension is not .docx, .doc, .pdf, .pptx or .xlsx, or a .pptx or .xlsx paired with anything but another of its kind | No |
| 400 | DOCUMENT_UNREADABLE | A submitted .docx is not a readable Word file: corrupt, or encrypted | No, check the file opens in Word |
| 400 | INVALID_COMPARISON_ID | The comparison id is malformed, or is a mrg_ merge id | No |
| 400 | INVALID_MERGE_ID | The merge id is malformed, or is a cmp_ comparison id | No |
| 400 | INVALID_EDIT_ID | The edit id is malformed | No |
| 400 | INVALID_CREATION_ID | The creation id is malformed | No |
| 400 | INVALID_FILE_ID, INVALID_DOCUMENT_ID, INVALID_VERSION_ID | A file, Document or version id is malformed | No |
| 400 | INVALID_PARENT_VERSION | A new version's parent names no version of the Document | No |
| 400 | INVALID_CURSOR | A Documents list cursor is malformed | No |
| 400 | ELEMENT_NOT_FOUND | An element lookup id is no element of the version's body, or more than one element carries it | No |
| 400 | UNSUPPORTED_FORMAT | A requested format is unknown, or not valid for this operation | No |
| 400 | PARAGRAPH_NOT_FOUND | A selective comparison names a paragraph index or id that is not in its file | No, read the file's listing again |
| 400 | RANGE_TOO_LARGE | A selective comparison's ranges are too large to compare in one request | No, compare smaller ranges |
| 400 | TRIAL_BATCH_TOO_LARGE | A trial organization's merge has more revisions than its per-minute allowance | No, send fewer revisions |
| 401 | INVALID_API_KEY | Missing, malformed, unknown, revoked, or expired key | No, check the credential |
| 402 | USAGE_LIMIT_REACHED | The organization's monthly upload allowance is exhausted | No, it's a billing state |
| 403 | API_KEY_ORG_MISMATCH | The key's service account no longer belongs to the key's organization | No, issue a new key |
| 403 | TRIAL_COMPARISON_LIMIT_REACHED | The organization's API trial allowance is used up | No, it's an account state |
| 403 | TRIAL_WORD_DOWNLOADS_EXCLUDED | docx was requested, and the API trial excludes Word downloads | No, ask for another format |
| 403 | ZERO_DAY_RETENTION_UNSUPPORTED | A Documents route, or a Document's version, was used by an organization with zero-day retention | No, it's an account setting |
| 404 | COMPARISON_NOT_FOUND | No such comparison, or it belongs to another organization | No |
| 404 | MERGE_NOT_FOUND | No such merge, or it belongs to another organization | No |
| 404 | EDIT_NOT_FOUND | No such edit, or it belongs to another organization | No |
| 404 | FILE_NOT_FOUND | No such file, or it belongs to another organization | No |
| 404 | CREATION_NOT_FOUND | No such creation, or it belongs to another organization | No |
| 404 | DOCUMENT_NOT_FOUND | No such Document, or it belongs to another organization | No |
| 404 | VERSION_NOT_FOUND | No such version in the Document | No |
| 409 | CONFLICT | An acknowledgment of work that is still processing, or that has no zero-day retention; an edit or selective comparison of a document still being prepared; or a file that is already a Document's version | Once it has finished processing; an edit or selective comparison after Retry-After |
| 409 | ELEMENT_MAP_PENDING | An element lookup needs a redline or listing that is still being made | Yes, after Retry-After |
| 409 | ELEMENT_MAP_UNAVAILABLE | An element lookup needs a map that does not exist and will not | No |
| 410 | CONTENT_DELETED | The work was deleted under zero-day retention | No |
| 413 | FILE_TOO_LARGE | A file exceeds the 100 MB limit | No |
| 429 | TRIAL_RATE_LIMITED | The API trial's per-minute rate is exceeded | Yes, after Retry-After seconds |
| 500 | INTERNAL_ERROR | Something went wrong on our side | Yes, with backoff |
The *_NOT_FOUND codes intentionally cover both "doesn't exist" and "not yours", so ids
cannot be probed for existence.
INTERNAL_ERROR is the only code worth retrying blindly. A response that carries Retry-After
tells you when to try again: TRIAL_RATE_LIMITED, ELEMENT_MAP_PENDING, and CONFLICT for work
still being made. Everything else in this table describes a request or account condition that will
produce the same result next time. The
trial codes are explained under API trials.
Comparison failures
A comparison that cannot be generated is not an HTTP error. The request succeeded — it
correctly reported that the work will not finish — so it returns 200 with
"status": "failed":
{
"comparison_id": "cmp_...",
"status": "failed",
"error": {
"code": "DOCUMENT_PROTECTED",
"upstream_code": "ONE_OR_MORE_DOCUMENTS_ARE_PROTECTED"
}
}error.code | Meaning | What to do |
|---|---|---|
DOCUMENT_PROTECTED | A source is password-protected or permission-restricted | Remove protection and resubmit |
DOCUMENT_UNREADABLE | A source could not be opened — corrupt or malformed | Check the file opens in Word |
DOCUMENT_CONVERSION_FAILED | A .doc, .pdf, or email source could not be converted to .docx | Convert it yourself and resubmit |
SOURCE_UPLOAD_FAILED | A source did not reach storage intact | Resubmit |
PDF_RENDER_FAILED | The redline generated but the PDF rendering did not | Request format=docx instead |
COMPARISON_FAILED | Catch-all — upstream_code carries the specific pipeline code | Inspect upstream_code; contact support if it recurs |
failed is terminal for that comparison. Waiting longer changes nothing; submit a new
comparison to retry.
A comparison whose redline succeeded but one of whose renderings did not (a PDF, say) also
reports failed, but with no error: what was produced is in file.downloads, and the
missing formats are named in file.failed_formats. A merge whose records can no longer produce a
document reports MERGE_UNUSABLE. Edits and created documents fail the same way, with
EDIT_FAILED and CREATION_FAILED; an amend whose change collides with a later version
reports CARRY_CONFLICT. The live text for every code is also served by
GET /v1/reference/errors.
DOCUMENT_UNREADABLE appears in both tables because a .docx is checked for readability
while the request is still open — an unopenable one is refused with 400 rather than
accepted and failed later. A .doc or .pdf source is opaque until its conversion step, so
the same condition surfaces there as a failed status instead.
Pipeline failure codes
upstream_code comes from the document pipeline and is more specific
than the public codes above. The ones you are most likely to see:
| Code | Meaning |
|---|---|
ONE_OR_MORE_DOCUMENTS_ARE_PROTECTED | A source is password-protected |
ONE_OR_MORE_DOCUMENTS_ARE_UNABLE_TO_BE_OPENED | A source could not be opened |
ONE_OR_MORE_DOCUMENTS_FAILED_TO_CONVERT_TO_DOCX | Conversion to .docx failed |
ONE_OR_MORE_DOCUMENTS_FAILED_TO_UPLOAD_TO_S3 | A source did not reach storage |
FAILED_TO_SAVE_REDLINE_AS_PDF | PDF rendering of the redline failed |
FAILED_TO_GENERATE_COMPARISON | The comparison itself failed |
OUT_OF_MEMORY | The documents exceeded the processing budget |
UNHANDLED_ERROR | Unclassified failure |
OUT_OF_MEMORY on very large or deeply nested documents is worth reporting to support —
it is usually a fixable characteristic of the specific file rather than a hard limit.