Skip to main content

Permissions & events

ZAR requests the least privilege it needs to read diffs and post reviewable feedback. This page is the exact list, plus the HTTP endpoints a self-hosted instance exposes.

GitHub App permissions

PermissionLevelWhy
MetadataReadRequired for every GitHub App.
ContentsRead & writeRead code diffs and doc files; write is used only when auto-commit is enabled.
Pull requestsRead & writeList changed files; post review comments and docs PRs.
IssuesRead & writeReply to @docagent commands; post the welcome issue.
ChecksRead & writeCreate the docagent/ci-gate check run for the CI gate.
Commit statusesRead & writePost the zar/docs status on analyzed commits.
Contents: write is requested so that auto-commit can work when you turn it on. With auto-commit off (the default), ZAR reads contents but only ever writes via pull requests. See Safety & guarantees.

Webhook events

EventTriggerWhat ZAR does
pushCommits pushed to the watched branchAnalyze the diff; propose docs.
pull_requestopened, synchronize, ready_for_review, mergeAnalyze PR changes; comment / open docs PR; run the CI gate if enabled.
issue_commentcreatedRun @docagent / /docagent commands.
installationApp installed / removed / suspendedOnboarding and lifecycle.
installation_repositoriesRepo added to an existing installOnboarding for the new repo.
installation and installation_repositories are delivered to every GitHub App automatically — there’s no separate subscription checkbox. Events other than the above are acknowledged and ignored.

HTTP endpoints (self-hosted)

ZAR is a FastAPI app. The endpoints you’ll care about:
Method & pathPurpose
POST /github/webhookThe webhook URL GitHub must call. Set your GitHub App’s Webhook URL to https://YOUR_DOMAIN/github/webhook.
GET /healthJSON health/status (service, version, environment, write-commits flag).
GET /healthzMinimal liveness probe ({"ok": true}).
GET /dashboardThe dashboard UI (optionally password-protected).
GET /auth/github, GET /auth/callbackGitHub OAuth login for the dashboard.
GET /setup, GET /setup/installedGitHub App install wizard.
POST /webhooks/polarPolar billing webhook (only if billing is configured).
The webhook router is mounted under /github, so the full public path is /github/webhook — a common mistake is to configure just /webhook.
Admin and MCP routes exist behind their own secrets (DOCAGENT_ADMIN_TOKEN, ADMIN_SECRET, DOCAGENT_MCP_SECRET); see Environment variables.