HighlightRequest
TheHighlightRequest schema defines the JSON body accepted by POST /highlight. Both fields are required.
The fully qualified URL of the PDF to download and annotate. The service performs an HTTP GET against this URL at request time. The URL must be reachable from the host running the service and must return a valid PDF file with a 200 status code.
A non-empty list of
DocumentPayload objects. Each object represents one text chunk that the service will locate and highlight in the PDF. Passing an empty array results in a 400 Bad Request response.Success Response
When highlighting succeeds, the API returns the annotated PDF as a binary stream.| Property | Value |
|---|---|
| HTTP status | 200 OK |
Content-Type | application/pdf |
Content-Disposition | attachment; filename="highlighted.pdf" |
| Body | Raw binary PDF data |
.pdf file. Do not attempt to parse it as JSON.
Error Response
All error responses —400, 422, and 500 — share the same outer shape: a JSON object with a single detail key.
422 Unprocessable Entity errors, detail is an array of Pydantic validation error objects rather than a plain string:
A human-readable description of the error. For
400 and 500 errors this is a plain string. For 422 validation errors this is an array of objects, each containing:loc(array): the location of the invalid field, e.g.["body", "pdf_url"]msg(string): a description of the validation failuretype(string): a Pydantic error type identifier, e.g."value_error.missing"