Error Reference
| HTTP Status | Cause | How to Fix |
|---|---|---|
| 400 | PDF URL is unreachable or returns a non-200 response | Verify the URL is publicly accessible without authentication |
| 400 | The documents list is empty | Pass at least one document object in the request |
| 400 | Highlight processing failed internally | Check that page numbers are valid integers and 0-indexed |
| 422 | Missing required fields (pdf_url or documents) | Ensure both fields are present in the request body |
| 500 | Unexpected internal error | Check the service logs or contact support |
Error Response Format
All4xx and 5xx responses return a JSON body with a single detail field describing what went wrong.
detail to get a human-readable explanation you can log or surface to your users.
Python Error Handling Example
Check the response status code before attempting to read the PDF content, and branch on the specific code to apply the right recovery logic.Debugging Common Problems
Chunks not highlighted
Chunks not highlighted
If the service returns a
200 response but the output PDF has no visible highlights, the most likely cause is that none of the chunk texts could be located on their specified pages. The service skips unmatched chunks silently rather than returning an error.Steps to diagnose:- Confirm page numbers are 0-indexed. Page 1 of the PDF is
"page": 0. A chunk with"page": 1will be searched on the second page of the document. - Check that chunks originate from the same PDF. Chunks retrieved from a different document will not match any text in the target PDF.
- Try shorter, more precise text. Very long chunks or chunks with OCR artifacts may fail fuzzy matching. Reduce
chunk_sizewhen splitting or use a passage that appears verbatim in the PDF.
PDF download fails (HTTP 400)
PDF download fails (HTTP 400)
A
400 response with a detail message containing “download” means the service could not fetch the PDF from the URL you provided.Common causes:- The URL requires authentication (cookies, API keys, OAuth). The service makes an unauthenticated GET request — the PDF must be publicly accessible.
- The server is behind a firewall or VPN that blocks requests from the service’s IP.
- The URL returns a redirect to a login page rather than a
4xxstatus, so the service downloads HTML instead of a PDF.
curl without any auth headers: curl -I https://example.com/document.pdf.422 Validation Error
422 Validation Error
A Read the
422 response means Pydantic rejected your request body before any processing started. The response body includes a detail array that pinpoints every field that failed validation.loc array to identify which field is missing or malformed. The most common causes are:- Omitting
pdf_urlordocumentsentirely from the request body. - Sending
documentsas a list of plain strings instead of objects withpage_contentandmetadatakeys. - Sending the request with
Content-Type: application/x-www-form-urlencodedinstead ofContent-Type: application/json.