Engineering

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET

Retrieve engineering analytics workflow runner

A workflow's estimated CI cost broken down by runner tier over a window (date_from default -30d), highest spend first. Optionally scope to a single git branch via branch or one run group via run_scope. Returns an empty list when the job-level source isn't synced.

Required API key scopes

engineering_analytics:read

Query parameters

  • branch
    string
  • date_from
    string
  • date_to
    string
  • repo
    string
  • run_scope
    string
    One of: "all""default_branch""merge_queue""pull_request"
  • source_id
    string
  • workflow_name
    string

Example request

GET /api/projects/:project_id/engineering_analytics/workflow_runner_costs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/engineering_analytics/workflow_runner_costs/

Example response

Status 200
RESPONSE
{
"provider": "string",
"runner_label": "string",
"job_count": 0,
"billable_minutes": 0.1,
"estimated_cost_usd": 0
}
Status 400 Missing workflow_name/repo, or invalid date, run_scope, or source_id.

Retrieve engineering analytics workflow runner

A workflow's estimated CI cost broken down by runner tier over a window (date_from default -30d), highest spend first. Optionally scope to a single git branch via branch or one run group via run_scope. Returns an empty list when the job-level source isn't synced.

Required API key scopes

engineering_analytics:read

Query parameters

  • branch
    string
  • date_from
    string
  • date_to
    string
  • repo
    string
  • run_scope
    string
    One of: "all""default_branch""merge_queue""pull_request"
  • source_id
    string
  • workflow_name
    string

Example request

GET /api/projects/:project_id/engineering_analytics/workflow_runner_costs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/engineering_analytics/workflow_runner_costs/

Example response

Status 200
RESPONSE
{
"provider": "string",
"runner_label": "string",
"job_count": 0,
"billable_minutes": 0.1,
"estimated_cost_usd": 0
}
Status 400 Missing workflow_name/repo, or invalid date, run_scope, or source_id.

Retrieve engineering analytics workflow

Runs of a single workflow within a repo over a window (date_from default -30d), newest first. Optionally scope to a single git branch via branch or to one run group via run_scope. Each row is run-level: per-job and per-step detail are not tracked yet. Use this as the GitHub 'workflow' page between the workflow list and a single run.

Required API key scopes

engineering_analytics:read

Query parameters

  • branch
    string
  • date_from
    string
  • date_to
    string
  • repo
    string
  • run_scope
    string
    One of: "all""default_branch""merge_queue""pull_request"
  • source_id
    string
  • workflow_name
    string

Example request

GET /api/projects/:project_id/engineering_analytics/workflow_runs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/engineering_analytics/workflow_runs/

Example response

Status 200
RESPONSE
{
"repo": {
"provider": "string",
"owner": "string",
"name": "string"
},
"id": 0,
"workflow_name": "string",
"head_sha": "string",
"head_branch": "string",
"status": "string",
"conclusion": "string",
"run_started_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"duration_seconds": 0,
"run_attempt": 0,
"pr_number": 0,
"commit_pr_number": 0,
"is_merge_queue": true,
"ci_engine": "github_actions",
"native_run_id": "string",
"native_workflow_run_id": "string",
"workflow_id": 0,
"event": "string"
}
Status 400 Missing workflow_name/repo, or invalid date, run_scope, or source_id.

Retrieve engineering analytics workflow

Runs of a single workflow within a repo over a window (date_from default -30d), newest first. Optionally scope to a single git branch via branch or to one run group via run_scope. Each row is run-level: per-job and per-step detail are not tracked yet. Use this as the GitHub 'workflow' page between the workflow list and a single run.

Required API key scopes

engineering_analytics:read

Query parameters

  • branch
    string
  • date_from
    string
  • date_to
    string
  • repo
    string
  • run_scope
    string
    One of: "all""default_branch""merge_queue""pull_request"
  • source_id
    string
  • workflow_name
    string

Example request

GET /api/projects/:project_id/engineering_analytics/workflow_runs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/engineering_analytics/workflow_runs/

Example response

Status 200
RESPONSE
{
"repo": {
"provider": "string",
"owner": "string",
"name": "string"
},
"id": 0,
"workflow_name": "string",
"head_sha": "string",
"head_branch": "string",
"status": "string",
"conclusion": "string",
"run_started_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"duration_seconds": 0,
"run_attempt": 0,
"pr_number": 0,
"commit_pr_number": 0,
"is_merge_queue": true,
"ci_engine": "github_actions",
"native_run_id": "string",
"native_workflow_run_id": "string",
"workflow_id": 0,
"event": "string"
}
Status 400 Missing workflow_name/repo, or invalid date, run_scope, or source_id.