Skip to content

Extended CE: Comments API

saveli edited this page Nov 16, 2026 · 1 revision

Review Comments API

A small REST API for the review comments of a project. Scripts and AI coding agents that already work on a project through the Git integration can read other reviewers' comments left in the editor, reply to them, resolve or reopen them, and add their own comments anchored to a passage of text.

Comments created through the API appear live in open editors, under the name of the token's owner, just like comments made in the browser.

The full API reference (response formats, error codes) is served by every instance at https://<your-overleaf>/api/v1, no token needed. Point an agent at that URL and it can discover the API by itself.

Enabling

The API is enabled together with the Git integration, there is no separate setting:

GIT_BRIDGE_ENABLED=true

See Git Integration for the full setup.

Authentication

Requests are authenticated with the same personal access token that is used for git clone. Users create tokens in Account Settings → Git integration.

Authorization: Bearer olp_...

Rate limit: 60 requests per minute per client IP.

Routes

All routes live under /api/v1/project/<project_id>:

Method Path Purpose
GET /threads All comment threads and tracked changes, with file, line and quoted text
GET /threads?format=md Same as Markdown, ready to paste into a prompt
POST /comments New comment anchored to a text passage
POST /thread/<thread_id>/messages Reply to a thread
POST /doc/<doc_id>/thread/<thread_id>/resolve Resolve a thread
POST /doc/<doc_id>/thread/<thread_id>/reopen Reopen a thread
GET /ranges Raw ranges per document (debugging)

The API does not delete threads and does not accept or reject tracked changes; these stay in the editor.

Tracked changes are listed by GET /threads under changes, next to the comment threads. Edits pushed with Git follow the project's track changes setting: if track changes is on for the pushing user, every changed line of an existing file becomes a tracked change under that user's name, to be accepted or rejected in the editor. New and deleted files are never tracked.

Permissions

The API follows the same rules as the review panel in the editor:

Action Owner, editor Reviewer Read-only (invited) Read-only via sharing link
Read threads and tracked changes yes yes yes no
Add comments, reply yes yes yes no
Resolve, reopen yes only threads they started no no

Users who are not members of a project get 404, so the API does not reveal which projects exist. Site admins get no special access. Every request is logged with user, project, route and status.

Example

TOKEN=olp_...
P=https://overleaf.example.org/api/v1/project/<project_id>

# list open and resolved threads as Markdown
curl -sS -H "Authorization: Bearer $TOKEN" "$P/threads?format=md"

# comment on a passage
curl -sS -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"file":"sections/intro.tex","quote":"the text to comment on","content":"Please cite the survey here."}' \
  "$P/comments"

# reply, then resolve
curl -sS -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"content":"Done, see commit abc123."}' "$P/thread/<thread_id>/messages"
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
  "$P/doc/<doc_id>/thread/<thread_id>/resolve"

<thread_id> and <doc_id> come from GET /threads. On shared machines, keep the token off the command line, e.g. in a file passed with curl --config.

Clone this wiki locally