Annotate a PDF (highlights, notes)
zotero_annotateAdd or delete highlights, underlines, and notes in Zotero PDFs by quoting the passage—no page coordinates required.
Instructions
Add or delete Zotero PDF annotations (highlights, underlines, notes), the same objects you create in the Zotero PDF reader. action:"add" needs parent (a regular item key OR a PDF attachment key) and annotations: each with type (highlight|note|underline, default highlight), text (the exact passage to highlight), optional comment, color, page (0-based page index). You do not need page coordinates: give the passage in text and it is located in the PDF and anchored to the exact lines it occupies, so quoting a passage is enough to highlight it. Pass page to disambiguate a passage that repeats, or occurrence to pick among repeats; pass position ({"pageIndex":N,"rects":[[x1,y1,x2,y2],...]} in PDF points, bottom-left origin) only to place a highlight yourself. action:"delete" trashes the annotations in annotation_keys. Writes go to the running Zotero desktop app for your personal library (via its connector protocol, or its local-API writes where available), otherwise to the cloud Web API.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Default "add". | |
| parent | No | Item key or PDF attachment key to annotate. | |
| library_id | No | ||
| annotations | No | Annotations to add. | |
| library_type | No | ||
| annotation_keys | No | Annotation keys to trash (action:"delete"). |