Engineering
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
GET | |
GET | |
GET | |
POST | |
GET | |
GET | |
GET | |
GET |
Retrieve engineering analytics pr
Estimated CI cost for a pull request, summed over the jobs of all its workflow runs. Billable self-hosted Linux runners only — provider-hosted (free GitHub-hosted) and non-Linux jobs are excluded. Every figure is zero/null with jobs_available false when the job-level source isn't synced yet. llm_spend carries the agent LLM token spend attributed to the PR by git branch, or null when no $ai_generation event matched.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /pr_costExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Retrieve engineering analytics pr
Estimated CI cost for a pull request, summed over the jobs of all its workflow runs. Billable self-hosted Linux runners only — provider-hosted (free GitHub-hosted) and non-Linux jobs are excluded. Every figure is zero/null with jobs_available false when the job-level source isn't synced yet. llm_spend carries the agent LLM token spend attributed to the PR by git branch, or null when no $ai_generation event matched.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /pr_costExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Retrieve engineering analytics pr
The timeline of a single pull request: header plus ordered events (opened, CI started/finished, merged or closed). Use this to answer 'where is this PR stuck and what happened to it'. This is a partial view: review and comment events are not yet available.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /pr_lifecycleExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Status 404 No pull request with that number in the warehouse.
Retrieve engineering analytics pr
The timeline of a single pull request: header plus ordered events (opened, CI started/finished, merged or closed). Use this to answer 'where is this PR stuck and what happened to it'. This is a partial view: review and comment events are not yet available.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /pr_lifecycleExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Status 404 No pull request with that number in the warehouse.
Retrieve engineering analytics pr
Every workflow run attributed to a pull request, across all its commits (grouped by head SHA client-side), newest first. Run-level only.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Example request
GET /api /projects /:project_id /engineering_analytics /pr_runsExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Retrieve engineering analytics pr
Every workflow run attributed to a pull request, across all its commits (grouped by head SHA client-side), newest first. Run-level only.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Example request
GET /api /projects /:project_id /engineering_analytics /pr_runsExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Retrieve engineering analytics pull
Open pull requests plus any merged or closed since date_from (default -30d), newest first, each with its head-SHA CI rollup. The list is capped; when more match, truncated is true and the ci_cards counts can exceed it. open_to_merge_seconds is coarse — it fuses draft and ready-for-review time; CI counts can lag until late completions settle.
Required API key scopes
engineering_analytics:readQuery parameters
- authorstring
- date_fromstring
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /pull_requestsExample response
Status 200
Status 400 Invalid date_from or source_id.
Retrieve engineering analytics pull
Open pull requests plus any merged or closed since date_from (default -30d), newest first, each with its head-SHA CI rollup. The list is capped; when more match, truncated is true and the ci_cards counts can exceed it. open_to_merge_seconds is coarse — it fuses draft and ready-for-review time; CI counts can lag until late completions settle.
Required API key scopes
engineering_analytics:readQuery parameters
- authorstring
- date_fromstring
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /pull_requestsExample response
Status 200
Status 400 Invalid date_from or source_id.
Retrieve engineering analytics
The repository's checked-in .test_quarantine.json: flaky tests temporarily quarantined with a hard expiry, classified by urgency (overdue, in grace, expiring soon, active). available is false when the repo has no quarantine file — that is not an error. Parsing is fail-open: malformed entries are reported in parse_errors while well-formed ones are kept.
Required API key scopes
engineering_analytics:readQuery parameters
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /quarantineExample response
Status 200
Status 400 Invalid repo or source_id.
Retrieve engineering analytics
The repository's checked-in .test_quarantine.json: flaky tests temporarily quarantined with a hard expiry, classified by urgency (overdue, in grace, expiring soon, active). available is false when the repo has no quarantine file — that is not an error. Parsing is fail-open: malformed entries are reported in parse_errors while well-formed ones are kept.
Required API key scopes
engineering_analytics:readQuery parameters
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /quarantineExample response
Status 200
Status 400 Invalid repo or source_id.
Create engineering analytics quarantine
Opens a pull request that edits the repository's checked-in .test_quarantine.json — and, for a new quarantine, a tracking issue the PR links but does not close. The file stays the source of truth that CI enforces; this never bypasses it. A quarantine only affects CI runs that start after the PR merges.
Required API key scopes
engineering_analytics:writeRequest parameters
- operation
- selectorstring
- repostringnull
- reasonstring
- ownerstring
- issuestring
- expiresstringnull
- mode
Response
Example request
POST /api /projects /:project_id /engineering_analytics /quarantine /requestExample response
Status 201 The opened pull request, plus the tracking issue for a new quarantine.
Status 400 Invalid input, or the write could not be completed (no GitHub App installed on the repo's org, a malformed quarantine file, or a GitHub failure). The detail message is safe to show.
Create engineering analytics quarantine
Opens a pull request that edits the repository's checked-in .test_quarantine.json — and, for a new quarantine, a tracking issue the PR links but does not close. The file stays the source of truth that CI enforces; this never bypasses it. A quarantine only affects CI runs that start after the PR merges.
Required API key scopes
engineering_analytics:writeRequest parameters
- operation
- selectorstring
- repostringnull
- reasonstring
- ownerstring
- issuestring
- expiresstringnull
- mode
Response
Example request
POST /api /projects /:project_id /engineering_analytics /quarantine /requestExample response
Status 201 The opened pull request, plus the tracking issue for a new quarantine.
Status 400 Invalid input, or the write could not be completed (no GitHub App installed on the repo's org, a malformed quarantine file, or a GitHub failure). The detail message is safe to show.
Retrieve engineering analytics repo
Repo-level headline aggregates over a window (default -30d): run count, success rate, re-run cycles, merged-PR count (bots included), median PR open-to-merge (bots and drafts excluded; coarse — draft and ready time fused), and billable minutes + estimated cost — each with its equal-length previous-window twin so a caller can render honest deltas. Also carries the detected default branch and its completed-run history series (skippable via include_series=false). Cost figures are null until the job-level source is synced.
Required API key scopes
engineering_analytics:readQuery parameters
- date_fromstring
- date_tostring
- include_seriesboolean
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /repo_overviewExample response
Status 200
Status 400 Invalid date_from, date_to, or source_id, or a window over 366 days.
Retrieve engineering analytics repo
Repo-level headline aggregates over a window (default -30d): run count, success rate, re-run cycles, merged-PR count (bots included), median PR open-to-merge (bots and drafts excluded; coarse — draft and ready time fused), and billable minutes + estimated cost — each with its equal-length previous-window twin so a caller can render honest deltas. Also carries the detected default branch and its completed-run history series (skippable via include_series=false). Cost figures are null until the job-level source is synced.
Required API key scopes
engineering_analytics:readQuery parameters
- date_fromstring
- date_tostring
- include_seriesboolean
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /repo_overviewExample response
Status 200
Status 400 Invalid date_from, date_to, or source_id, or a window over 366 days.
Retrieve engineering analytics repo run
Default-branch health as compact chart points over a window (default -30d), newest first, for the repo-hub run-activity chart. All of a commit's workflow runs are collapsed into ONE point per commit (head SHA): its earliest workflow start, wall-clock duration until the last workflow settled (null while any is still running), and an overall conclusion that is 'failure' if any workflow decisively failed, else 'success' when at least one passed, else 'neutral'. branch overrides the detected default branch. truncated is true when more commits matched than the cap, so the chart covers only the most recent commits.
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- date_fromstring
- date_tostring
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /repo_run_activityExample response
Status 200
Status 400 Invalid date_from, date_to, or source_id, or a window over 366 days.
Retrieve engineering analytics repo run
Default-branch health as compact chart points over a window (default -30d), newest first, for the repo-hub run-activity chart. All of a commit's workflow runs are collapsed into ONE point per commit (head SHA): its earliest workflow start, wall-clock duration until the last workflow settled (null while any is still running), and an overall conclusion that is 'failure' if any workflow decisively failed, else 'success' when at least one passed, else 'neutral'. branch overrides the detected default branch. truncated is true when more commits matched than the cap, so the chart covers only the most recent commits.
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- date_fromstring
- date_tostring
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /repo_run_activityExample response
Status 200
Status 400 Invalid date_from, date_to, or source_id, or a window over 366 days.
Retrieve engineering analytics resolve
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).
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- repostring
- source_idstring
- timestampstring
Example request
GET /api /projects /:project_id /engineering_analytics /resolve_branchExample response
Status 200
Status 400 Branch missing/empty, or invalid repo/timestamp/source_id.
Retrieve engineering analytics resolve
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).
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- repostring
- source_idstring
- timestampstring
Example request
GET /api /projects /:project_id /engineering_analytics /resolve_branchExample response
Status 200
Status 400 Branch missing/empty, or invalid repo/timestamp/source_id.
Retrieve engineering analytics run failure
The thinned CI failure logs of one workflow run, grouped by failed job — the run-scoped twin of ci_failure_logs for surfaces that aren't PR-scoped (default-branch failures, the run page). logs_available is false when the run didn't fail or its logs aged out of the short Logs retention.
Required API key scopes
engineering_analytics:readQuery parameters
- repostring
- run_idinteger
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /run_failure_logsExample response
Status 200
Status 400 Missing or non-integer run_id, or invalid source_id.
Retrieve engineering analytics run failure
The thinned CI failure logs of one workflow run, grouped by failed job — the run-scoped twin of ci_failure_logs for surfaces that aren't PR-scoped (default-branch failures, the run page). logs_available is false when the run didn't fail or its logs aged out of the short Logs retention.
Required API key scopes
engineering_analytics:readQuery parameters
- repostring
- run_idinteger
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /run_failure_logs