Engineering
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
GET | |
GET | |
GET | |
GET | |
GET | |
POST | |
GET | |
GET |
Retrieve engineering analytics ci failure
The thinned CI failure logs for a pull request, grouped by failed job. Resolves the PR to its workflow runs via the pull_requests association (all of the PR's pushes, not just the latest commit), then reads the Logs product joined on run_id. Returns failed jobs only (the worker fetches logs for failures); logs_available is false when CI hasn't failed, the logs aged out of the short Logs retention, or a fork PR has no run association. Each line carries its original 1-based line number in the full pre-thinning log; lines are the failure region (errors plus surrounding context, with omission markers), capped per job and overall.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /ci_failure_logsExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Retrieve engineering analytics ci failure
The thinned CI failure logs for a pull request, grouped by failed job. Resolves the PR to its workflow runs via the pull_requests association (all of the PR's pushes, not just the latest commit), then reads the Logs product joined on run_id. Returns failed jobs only (the worker fetches logs for failures); logs_available is false when CI hasn't failed, the logs aged out of the short Logs retention, or a fork PR has no run association. Each line carries its original 1-based line number in the full pre-thinning log; lines are the failure region (errors plus surrounding context, with omission markers), capped per job and overall.
Required API key scopes
engineering_analytics:readQuery parameters
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /ci_failure_logsExample response
Status 200
Status 400 Missing pr_number/repo, or invalid repo or source_id.
Retrieve engineering analytics ci timing
How long a selected workflow, matrix, job or step usually takes: compares it with runs of the same workflow on the repository's default branch over the last 7 days, from stored data only. A run counts only when it ran the same jobs on the same runner tiers, so the answer never mixes in a different workflow, job or runner. Pull request runs and merge queue runs are left out. At most the newest 40 default-branch runs are checked, and sampled is true when more existed. average_seconds and sample_count cover successful samples only, and recent lists the newest three matches of any status. average_seconds is null when no comparable run exists. unavailable_reason says why no comparison was made. Answers are cached for 5 minutes.
Required API key scopes
engineering_analytics:readQuery parameters
- ci_enginestringOne of:
"github_actions""depot_ci" - job_idsstring
- kindstringOne of:
"workflow""matrix""job""step" - repostring
- run_attemptinteger
- run_idinteger
- source_idstring
- step_numberinteger
Response
Example request
GET /api /projects /:project_id /engineering_analytics /ci_timing_contextExample response
Status 200
Status 400 Missing or invalid parameters, a run the source does not hold, a job id that is not in the run attempt, or a step number the job does not have.
Retrieve engineering analytics ci timing
How long a selected workflow, matrix, job or step usually takes: compares it with runs of the same workflow on the repository's default branch over the last 7 days, from stored data only. A run counts only when it ran the same jobs on the same runner tiers, so the answer never mixes in a different workflow, job or runner. Pull request runs and merge queue runs are left out. At most the newest 40 default-branch runs are checked, and sampled is true when more existed. average_seconds and sample_count cover successful samples only, and recent lists the newest three matches of any status. average_seconds is null when no comparable run exists. unavailable_reason says why no comparison was made. Answers are cached for 5 minutes.
Required API key scopes
engineering_analytics:readQuery parameters
- ci_enginestringOne of:
"github_actions""depot_ci" - job_idsstring
- kindstringOne of:
"workflow""matrix""job""step" - repostring
- run_attemptinteger
- run_idinteger
- source_idstring
- step_numberinteger
Response
Example request
GET /api /projects /:project_id /engineering_analytics /ci_timing_contextExample response
Status 200
Status 400 Missing or invalid parameters, a run the source does not hold, a job id that is not in the run attempt, or a step number the job does not have.
Retrieve engineering analytics current branch
Current default-branch CI verdict over the fixed last-24-hours window. Counts every workflow whose latest completed run failed or timed out; failing workflow names are a bounded preview. The default branch is detected from the same window, independently of analytics date filters.
Required API key scopes
engineering_analytics:readQuery parameters
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /current_branch_healthExample response
Status 200
Status 400 Invalid source_id.
Retrieve engineering analytics current branch
Current default-branch CI verdict over the fixed last-24-hours window. Counts every workflow whose latest completed run failed or timed out; failing workflow names are a bounded preview. The default branch is detected from the same window, independently of analytics date filters.
Required API key scopes
engineering_analytics:readQuery parameters
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /current_branch_healthExample response
Status 200
Status 400 Invalid source_id.
Retrieve engineering analytics delivery
One author's median ready to merged time, split at the first approval, next to the same medians for the author's own team and for the whole repository, over pull requests merged in the window (date_from default -30d). The team is picked from the author's GitHub teams that own code: a team that pr_number asked to review, else the team the author's pull requests asked to review most often, else every team. Bots and drafts are excluded.
Required API key scopes
engineering_analytics:readQuery parameters
- authorstring
- date_fromstring
- date_tostring
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /delivery_comparisonExample response
Status 200
Status 400 Missing author, or invalid pr_number, date or source_id.
Retrieve engineering analytics delivery
One author's median ready to merged time, split at the first approval, next to the same medians for the author's own team and for the whole repository, over pull requests merged in the window (date_from default -30d). The team is picked from the author's GitHub teams that own code: a team that pr_number asked to review, else the team the author's pull requests asked to review most often, else every team. Bots and drafts are excluded.
Required API key scopes
engineering_analytics:readQuery parameters
- authorstring
- date_fromstring
- date_tostring
- pr_numberinteger
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /delivery_comparisonExample response
Status 200
Status 400 Missing author, or invalid pr_number, date or source_id.
Retrieve engineering analytics delivery
Delivery and CI friction for one author or one GitHub team over a window (date_from default -30d), each figure next to the same figure over the whole repository: CI spend per merged PR, ready to merged split at the first approval, pushes after approval, merge-queue attempts, and lead time to deploy. Bots and drafts are excluded. Figures whose optional source isn't synced are null and flagged.
Required API key scopes
engineering_analytics:readQuery parameters
- authorstring
- date_fromstring
- date_tostring
- github_teamstring
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /delivery_summaryExample response
Status 200
Status 400 Not exactly one of author or github_team, or invalid date or source_id.
Retrieve engineering analytics delivery
Delivery and CI friction for one author or one GitHub team over a window (date_from default -30d), each figure next to the same figure over the whole repository: CI spend per merged PR, ready to merged split at the first approval, pushes after approval, merge-queue attempts, and lead time to deploy. Bots and drafts are excluded. Figures whose optional source isn't synced are null and flagged.
Required API key scopes
engineering_analytics:readQuery parameters
- authorstring
- date_fromstring
- date_tostring
- github_teamstring
- repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /delivery_summaryExample response
Status 200
Status 400 Not exactly one of author or github_team, or invalid date or source_id.
Retrieve engineering analytics depot ci
Depot CI run time and estimated cost over a window (default -7d), one entry per synced Depot source. Unlike the workflow and cost reads, it counts hand-off jobs, because Depot bills them. Empty when no Depot source is synced.
Required API key scopes
engineering_analytics:readQuery parameters
- date_fromstring
- date_tostring
Example request
GET /api /projects /:project_id /engineering_analytics /depot_ci_usageExample response
Status 200
Status 400 Invalid date_from or date_to, or a window over 366 days.
Retrieve engineering analytics depot ci
Depot CI run time and estimated cost over a window (default -7d), one entry per synced Depot source. Unlike the workflow and cost reads, it counts hand-off jobs, because Depot bills them. Empty when no Depot source is synced.
Required API key scopes
engineering_analytics:readQuery parameters
- date_fromstring
- date_tostring
Example request
GET /api /projects /:project_id /engineering_analytics /depot_ci_usageExample response
Status 200
Status 400 Invalid date_from or date_to, or a window over 366 days.
Retrieve engineering analytics
DORA-style deploy metrics over the GitHub deployments + deployment_statuses warehouse pair, each headline with its previous-window twin: deployment frequency, merge-to-deploy lead time (with a per-bucket box-plot series), and honest proxies for change failure rate and time to restore (deploy-status based: no incident data is linked). deploy_data_available is false when the deploy tables aren't synced.
Required API key scopes
engineering_analytics:readQuery parameters
- date_fromstring
- date_tostring
- environmentarray
- github_teamstring
- granularitystringOne of:
"day""hour""week" - repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /doraExample response
Status 200
Status 400 Invalid environment, date_from, date_to, granularity, or source_id.
Retrieve engineering analytics
DORA-style deploy metrics over the GitHub deployments + deployment_statuses warehouse pair, each headline with its previous-window twin: deployment frequency, merge-to-deploy lead time (with a per-bucket box-plot series), and honest proxies for change failure rate and time to restore (deploy-status based: no incident data is linked). deploy_data_available is false when the deploy tables aren't synced.
Required API key scopes
engineering_analytics:readQuery parameters
- date_fromstring
- date_tostring
- environmentarray
- github_teamstring
- granularitystringOne of:
"day""hour""week" - repostring
- source_idstring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /doraExample response
Status 200
Status 400 Invalid environment, date_from, date_to, granularity, or source_id.
Create engineering analytics
Enable engineering analytics for this project. Creates the project's managed warehouse views and opts it into the background work (view sync after each GitHub or Depot load, the daily test census, CI failure log collection). Safe to call again: an enabled project stays enabled.
Required API key scopes
engineering_analytics:writeExample request
POST /api /projects /:project_id /engineering_analytics /enableExample response
Status 204 No response body
Create engineering analytics
Enable engineering analytics for this project. Creates the project's managed warehouse views and opts it into the background work (view sync after each GitHub or Depot load, the daily test census, CI failure log collection). Safe to call again: an enabled project stays enabled.
Required API key scopes
engineering_analytics:writeExample request
POST /api /projects /:project_id /engineering_analytics /enableExample response
Status 204 No response body
Retrieve engineering analytics flaky
The active test-health queue: pytest and Jest tests worth acting on now, from the per-test CI spans, over a window (default -7d, maximum 30 days). Evidence is counted per CI run, never per span or run attempt. A test is a 'confirmed_flake' when one commit both failed and passed it (a 'Re-run failed jobs' attempt went green, or an in-job retry recovered it); 'quarantined' when a tolerated failure is recorded while it is masked; otherwise 'suspected_regression'. It qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs. Counts are absolute, never rates: CI emits every failure but omits ordinary passing spans, so there is no execution denominator. 'suspected_regression' means no recovery was recorded in this data, not that the test never flakes.
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- date_fromstring
- date_tostring
- limitinteger
- min_failed_prsinteger
- pr_numberinteger
- repostring
- runnerstringOne of:
"jest""pytest" - source_idstring
- teststring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /flaky_testsExample response
Status 200
Status 400 Invalid date, threshold, limit, runner, pr_number, or source_id, or a window longer than 30 days.
Retrieve engineering analytics flaky
The active test-health queue: pytest and Jest tests worth acting on now, from the per-test CI spans, over a window (default -7d, maximum 30 days). Evidence is counted per CI run, never per span or run attempt. A test is a 'confirmed_flake' when one commit both failed and passed it (a 'Re-run failed jobs' attempt went green, or an in-job retry recovered it); 'quarantined' when a tolerated failure is recorded while it is masked; otherwise 'suspected_regression'. It qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs. Counts are absolute, never rates: CI emits every failure but omits ordinary passing spans, so there is no execution denominator. 'suspected_regression' means no recovery was recorded in this data, not that the test never flakes.
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- date_fromstring
- date_tostring
- limitinteger
- min_failed_prsinteger
- pr_numberinteger
- repostring
- runnerstringOne of:
"jest""pytest" - source_idstring
- teststring
Response
Example request
GET /api /projects /:project_id /engineering_analytics /flaky_testsExample response
Status 200
Status 400 Invalid date, threshold, limit, runner, pr_number, or source_id, or a window longer than 30 days.
Retrieve engineering analytics job
Per-job aggregates for one workflow over a window (default -30d), one row per de-sharded job name (matrix shards aggregate together), busiest first: queue p50, duration p50/p95, failure rate, retry pressure, run share (below 1.0 = conditional job), and billable cost. Optionally scope to a single git branch via branch or one run group via run_scope. Jobs always need their run as context: this is the aggregate view; use workflow_jobs for one run's jobs. Empty when the job-level source isn't synced.
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- date_fromstring
- date_tostring
- repostring
- run_scopestringOne of:
"all""default_branch""merge_queue""pull_request" - source_idstring
- workflow_namestring
Example request
GET /api /projects /:project_id /engineering_analytics /job_aggregatesExample response
Status 200
Status 400 Missing workflow_name, or invalid date, run_scope, or source_id.
Retrieve engineering analytics job
Per-job aggregates for one workflow over a window (default -30d), one row per de-sharded job name (matrix shards aggregate together), busiest first: queue p50, duration p50/p95, failure rate, retry pressure, run share (below 1.0 = conditional job), and billable cost. Optionally scope to a single git branch via branch or one run group via run_scope. Jobs always need their run as context: this is the aggregate view; use workflow_jobs for one run's jobs. Empty when the job-level source isn't synced.
Required API key scopes
engineering_analytics:readQuery parameters
- branchstring
- date_fromstring
- date_tostring
- repostring
- run_scopestringOne of:
"all""default_branch""merge_queue""pull_request" - source_idstring
- workflow_namestring
Example request
GET /api /projects /:project_id /engineering_analytics /job_aggregates




