Developers
Examples and workflows
End-to-end flows for reading notes, appending text safely and annotating a PDF.
Summarise notes with an assistant (read-only)
rooqi_request_read_access→approvalRequired. Approve the window in RooQi and choose the project.rooqi_request_read_accessagain →ready.rooqi_list_approved_documents→{ "<id>": "Lecture 3", … }rooqi_read_notewith{ "documentID": "<id>" }→ saved text and revision.
The assistant only sees saved text — not handwriting, images or PDF source text.
Append a summary safely
- Request write access and approve it.
- Read the note to learn its current
revision. - Generate fresh UUIDs for
operationIDand store them before calling. - Call
rooqi_append_text:
{
"operationID": "3B1F7A2C-9E44-4D51-A0C6-1E2F3A4B5C6D",
"documentID": "<id>",
"text": "Summary: …",
"expectedVersion": 7,
"provider": "example-assistant",
"model": "example-model-1",
"promptVersion": "summary-v1"
}- On
mutationUncertainor a timeout, call again with the same body. OnmutationRejected, read again and use a newoperationIDonly if you intend a new write.
Highlight a sentence in a PDF
rooqi_request_pdf_annotation_access, approve, call again.rooqi_list_pdf_targetswith the document → pick asurfaceIDand page fromavailableSourcePages.rooqi_read_pdf_pagewith a region, e.g. the top half of page 0:
{ "documentID": "<doc>", "surfaceID": "<surface>", "pageIndex": 0,
"rect": { "x": 0, "y": 0, "width": 1000000, "height": 500000 } }- Narrow
rectto the lines you want using the returnedlines[].rect, read again, then callrooqi_annotate_pdfwith the samequery, the returnedrevisionasexpectedVersion,sourceAssetIDand the three digests,kind: "highlight"and an emptycomment. - If the result is uncertain, call
rooqi_query_pdf_operationwith the sameoperationID.