Agent context pack for a pull request
GET/api/repos/{owner}/{repo}/pulls/{number}/context
getPullRequestContext
Read-only, single-call assembly of what is needed to act on a pull request: the PR itself, its resolved head commit and checks roll-up, its PR-level review comments, its inline review threads **as anchors only** (the replies inside a thread are a separate subject and are not included yet), a per-file change summary (paths and line counts, NO patch text — call `/diff` for hunks), and the issues it links to. Authorizes exactly like `GET /api/repos/{owner}/{repo}/pulls/{number}` (deny folds to 404), so an anonymous caller gets exactly what the PR detail route gives one. Bounds are reported in `truncated`, never applied silently. Linked issues the caller cannot read are omitted rather than leaked.
Authentication is not described for this operation in the spec — that does not mean it is public. Check tokens and scopes.
curl
curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/pulls/NUMBER/context'fetch
fetch("https://neosource.dev/api/repos/OWNER/REPO/pulls/NUMBER/context", {
method: "GET",
});Path parameters
ownerrequiredRepository owner or organization slug.
reporequiredRepository name.
numberrequiredChange request number.
Responses
200Pull request context pack
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 403Forbidden — one of: forbidden
- 404Not Found — one of: not_found
- 423Locked — one of: busy
- 429Rate limited — retry after the interval in the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
DiffFileStatus
"added""modified""deleted"
IssueAssigneeResponse
One assignee, resolved to something renderable. This used to be a bare `account_id` string; a UUID is not a UI, and every consumer would otherwise have to fan out to the account store itself.
account_idrequireddisplay_namerequiredhandlerequired
AccountKind
Rust mirror of the Pg `account_kind` enum (`accounts.kind`). `Ghost` rows are imported-author placeholders (GitHub metadata import, plans/github-metadata-import.md §6): `handle = gh-<github-id>`, `personal_workspace_id` NULL, no password, no sessions. They must never flow through `get_account*` (`AccountRow::into_record` CorruptData-errors on the NULL workspace) — author rendering goes through `PgGithubImportStore::authors_projection`, and claim-by-proof later promotes or merges them.
"human""bot""service""runner""ghost"
LabelResponse
colorrequiredcreated_atrequireddescriptionrequiredlabel_idrequirednamerequiredrepo_idteam_id
IssuePriority
Linear-style priority. Stored as the `issue_priority` Postgres enum; surfaces as a domain enum so callers never juggle magic ints.
"none""urgent""high""medium""low"
IssueStatus
"backlog""todo""in_progress""in_review""done""cancelled""duplicate"
MergeMethod
How a pull request's commits land on its target branch. A repo carries two settings over this enum (`migrations/20260820120000_repo_merge_methods.sql`): the set it *permits* (`RepoRecord::allowed_merge_methods`, never empty) and the one the merge path reaches for when the request names none (`RepoRecord::default_merge_method`, always a member of that set — enforced by the settings route, which is the only place both columns are visible at once). `Default` is [`MergeMethod::Merge`] to match the column default, which is itself the pre-existing behaviour of every repo: before this setting existed, a merge always minted a two-parent commit. `Rebase` is deliberately absent rather than merely unimplemented — it replays N commits, can conflict per commit, and rewrites the SHAs the stacked-PR re-parent invariant leans on (`plans/archive/pr-merge-methods-2026-08.md` §"Not doing"). Adding it later is one `ALTER TYPE merge_method ADD VALUE` plus an arm here, which is why the stored shape is an enum array and not a pair of booleans.
"merge""squash"
MergedVia
How a pull request's merge was triggered — the companion to [`MergeMethod`], which says what the merge *minted*. The two are independent: a squash can land either by hand or by an armed auto-merge, and an imported mirror carries a trigger with no method at all.
"manual""auto""import"
PrOrigin
Provenance of a pull request. `Native` PRs are created in neosource and are fully mutable; `GithubMirror` PRs are read-only imports of GitHub pull requests (one-directional metadata sync). Store-level single-row lookups filter to `Native` so a fork mirror — which stores GitHub head-ref names like `main`/`patch-1` — can never mask a native PR nor be advanced by a native push.
"native""github_mirror"
PullRequestStatus
Lifecycle status of a pull request.
"open""merged""closed"
ThreadSide
Side of the diff a review thread anchors to. `Old` = the line was on the pre-image (red side); `New` = the line is on the post-image (green side). Identical encoding to GitHub's `RIGHT`/`LEFT` but spelled in our domain.
"old""new"