engineering_analytics
engineering_analytics

Resolve a git branch to the pull request(s) it belongs to: the cross-product link seam so another product (the LLM analytics UI) can turn a git branch into a PR detail link. Matches the PR's head ref, open PRs first then most recently updated. Pass timestamp (the trace's capture time) to prefer the PR that was active at that moment when a branch name has been reused across PRs. branch is required. Returns a possibly-empty, possibly-multi list: an empty list is a valid 200 (the caller renders a plain chip).

get/api/projects/{project_id}/engineering_analytics/resolve_branch/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/resolve_branch/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

branchstring required

Git branch (the PR's head ref) to resolve. Open PRs are returned first, then most recently updated.

repostring

Optional 'owner/name' repository to narrow matching to a single repo.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.

timestampstring date-time

Optional ISO8601 timestamp, e.g. the trace's capture time. When a branch name has been reused across PRs over time, the PR whose lifetime window contains this moment is ranked first so the result matches the PR that was active when the trace was captured. A preference only, not a filter; omit to rank purely by open state then recency.

Response

repostring required

Repository the pull request belongs to, as 'owner/name'.

numberinteger required

Pull request number within the repository: pair with repo to link to it.

titlestring nullable required

Pull request title, or null when the snapshot carries no title.

statestring nullable required

Derived PR state ('open', 'closed', 'merged'), or null when the snapshot carries no state.

Changes

No recorded changes to this operation across all 1 revision of this API.