Skip to content

Reference

API notes

The HTTP API behind the Forseti dashboard: how it authenticates, how errors look, and the routes for repos, policies, reviews, spend and team.

Everything the dashboard does goes through a JSON API on the same origin, under /api. These notes are for teams who want to script against it or understand what the app sends.

Conventions

  • JSON in and out. Sign-in, sessions and sign-out live under /api/auth/*.
  • Every request acts on your active workspace, taken from your membership on the server, never from the request. Switch with POST /api/me/active-org.
  • Roles: owner and admin manage repos, policies, settings, team and the audit log; billing (with owners and admins) manages caps and top-ups; members can read, trigger reviews and give feedback on findings.
  • Every change is written to the audit log.

Errors

StatusBodyMeaning
400{ error: "invalid_input", field, message }A field failed validation
401{ error: "unauthorized" }No valid session
403{ error: "forbidden", need: [...] }Your role cannot do this; need lists the roles that can
409{ error: "no_workspace" }You are not in a workspace yet
429Rate limited; slow down and retry

You and your workspace

MethodPathDoesRole
GET/api/meYou, your workspaces, the active one, and your GitHub installationsSigned in
POST/api/me/active-orgSwitch the active workspaceSigned in
GET/api/github/install-urlLink to install the GitHub AppSigned in
POST/api/github/claimLink an installation you can reach to a workspaceSigned in
POST/api/github/resyncRe-read repositories from GitHubOwner, admin
POST/api/workspaces/:id/joinJoin a workspace your GitHub organisation usesSigned in
DELETE/api/workspaces/:idDelete a workspace (confirm by name)Owner

Repositories, policies and estimates

MethodPathDoesRole
GET/api/reposRepos with enabled state, branch targeting, depth per branch, config source and 30-day spendAny member
PATCH/api/repos/:idEnable, branch mode, branches, depth per branch, dimensionsOwner, admin
POST/api/repos/bulkThe same for many repos, or all of themOwner, admin
GET/api/repos/:id/branchesLive branch list from GitHubAny member
GET/api/policiesWorkspace defaults, locks and policy rulesAny member
PUT/api/policiesReplace defaults, locks and rulesOwner, admin
POST/api/policies/previewMonthly impact of proposed policies, from the last 30 days of PRsOwner, admin
POST/api/estimatePrice and time estimate for a depth, dimensions and PR sizeAny member
GET/api/packsBuilt-in and custom domain packsAny member
POST/api/packs/customCreate a custom packOwner, admin
DELETE/api/packs/custom/:nameDelete a custom packOwner, admin
POST /api/estimate
{ "depth": "deep", "lines": 420, "files": 9 }

→ { "creditsP50": …, "creditsP90": …, "gbpP50": …, "etaSecondsP50": … }

Reviews and findings

MethodPathDoesRole
GET/api/reviewsReview feed; filter by repo, status, depth and verdict; cursor pagingAny member
GET/api/reviews/:idOne review: files, findings with evidence, timeline per stage, coverage, costAny member
POST/api/reviewsStart a review of a PR at a depthAny member
POST/api/reviews/:id/postPost a review that was held for your approvalAny member
POST/api/findings/:id/feedbackDismiss, accept or reopen a finding, with a reasonAny member
POST/api/reviews/:id/request-reviewAsk suggested people to review on GitHubAny member
POST/api/reviews/:id/askAsk a question about the PR; streamed answer with file:line citationsAny member
GET/api/reviews/:id/chatThe questions and answers so farAny member
GET/api/reviews/:id/streamLive events for one review (server-sent events)Any member
GET/api/eventsLive events for the workspace (server-sent events)Any member

Feedback reasons are not_useful, incorrect, wont_fix and other. “Not useful here” can teach Forseti to stop raising that category or that exact finding; “incorrect” credits back the finding's share of the cost. Review streams send stage, finding, posted and done events. A PR patch shown in a review is fetched from GitHub on request, never stored.

Asking about a PR is metered as a small charge, at least one credit per question, and limited to 20 questions per person per hour.

Team memory, quality and import

MethodPathDoesRole
GET/api/learningsTeam rules and suppressionsAny member
POST/api/learningsAdd a ruleOwner, admin
PATCH/api/learnings/:idSwitch on or off, editOwner, admin
DELETE/api/learnings/:idDeleteOwner, admin
GET/api/learnings/exportAs a ready .forseti/rules.md (format=md) or JSONAny member
GET/api/qualityPrecision by repo, category and author, noise per PR, trendAny member
GET/api/quality/noise-budgetCurrent noise budgetAny member
PUT/api/quality/noise-budgetChange the noise budgetOwner, admin
POST/api/import/previewMap pasted files, or scan repos, into a previewOwner, admin
POST/api/import/applyApply a preview, onceOwner, admin
GET/api/exportPolicies and rules as JSON, .forseti.yaml (format=yaml) or rules.md (format=rules)Any member

Spend, insights and team

MethodPathDoesRole
GET/api/spendBalance, month spend against cap, forecast, by repo and developer, ledgerAny member
PUT/api/spend/capsPer-PR, per-repo and workspace caps, and what happens at a capOwner, admin, billing
POST/api/spend/topupStart a top-up checkoutOwner, admin, billing
GET/api/spend/forecastForecast from recent history, per repoAny member
GET/api/spend/ceilingsMonthly ceilings per developer, team or repoAny member
POST/api/spend/ceilingsAdd a ceilingOwner, admin, billing
DELETE/api/spend/ceilings/:idRemove a ceilingOwner, admin, billing
GET/api/teamsTeams used for ceilingsAny member
GET/api/insightsAcceptance rate, time to first review, bugs caught, spend per merged PRAny member
GET/api/insights/roiCost per bug caughtAny member
GET/api/readinessMerge readiness of open PRsAny member
POST/api/release-notesDraft release notes for merged PRs between two refsAny member
GET/api/teamMembers and pending invitesAny member
POST/api/team/inviteCreate a single-use invite linkOwner, admin
PATCH/api/team/:userIdChange a member's roleOwner, admin
GET/api/settingsWorkspace settings and the GitHub permission checklistAny member
PATCH/api/settingsName, auto-enable new repos, snippet storage, retentionOwner, admin
GET/api/auditAudit log, pagedOwner, admin
GET/api/integrationsConnections and their statusAny member
PUT/api/integrations/:kindConnect or update an integrationOwner, admin
POST/api/integrations/:kind/testTest a connectionOwner, admin

Inbound webhooks

GitHub delivers events to POST /webhooks/github. The signature is checked on the raw body (401 if it fails), the delivery is recorded and queued in one transaction, and the endpoint answers 202 at once. The review runs on a worker, so a slow model never delays GitHub.

Payments use POST /api/stripe/webhook, also signature-checked; each checkout grants its credits once.