engineering_analytics
engineering_analytics

Open pull requests plus any merged or closed since date_from (default -30d), newest first, each with its head-SHA CI rollup. Pass state to list one state only. The list is paged by limit and offset; 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. Cost and billable minutes can lag new CI by up to 5 minutes.

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

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/pull_requests/
  • 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

authorstring

Optional GitHub login to scope the list to one author's pull requests.

date_fromstring

Window start: relative ('-30d', '-8w') or ISO8601. Defaults to -30d.

date_tostring

Optional exclusive upper bound for merged_at / closed_at: relative or ISO8601. Defaults to now. Set a fixed value when you page, so new merges do not move rows between pages.

limitinteger

Page size, 1 to 1000. Defaults to 1000.

offsetinteger

Number of rows to skip. Defaults to 0. While truncated is true, add limit to offset to read the next page.

repostring

'owner/name' repository to scope to when the selected source syncs several repositories (from the sources list). Defaults to the source's first repository.

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.

state'closed' | 'merged' | 'open'

Optional state filter. 'merged' lists PRs merged in the window, newest merged_at first. 'closed' lists PRs closed without a merge in the window, newest closed_at first. 'open' lists all open PRs whatever their age, newest first. Omit it to get open PRs plus any merged or closed in the window.

Response

truncatedboolean required

True when more pull requests match after this page; call again with offset increased by limit to read them. The aggregate counts in ci_cards can exceed items.

limitinteger required

Maximum number of pull requests returned in items.

Changes

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