Stacks

Stacks endpoints for the Mergify API.


Get adoption summary metrics for Stacks

GET /repos/{owner}/stacks/summary

Returns counts and weekly trend for Mergify Stacks across the org's repositories over a time window (default 30 days, max 90).

GitHub Token Application Key
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

days integer

min: 1 · max: 90

200 Successful Response
active_stacksintegerrequired

Currently open stacks across the org

stack_prs_in_windowintegerrequired

Total PRs that belong to a stack in the window

repos_with_stacks_in_windowintegerrequired

Repositories with at least one stack in the window

percent_merged_from_stacknumberrequired

Percent of merged PRs in the window that came from a stack

weekly_bucketsWeeklyBucket[]required

Weekly counts of new stacks across the window

week_startstring <date>required

Monday of the bucket week (YYYY-MM-DD)

stacks_createdintegerrequired

Number of stacks whose root PR was created this week

Example Response

                          {
  "active_stacks": 0,
  "stack_prs_in_window": 0,
  "repos_with_stacks_in_window": 0,
  "percent_merged_from_stack": 0,
  "weekly_buckets": [
    {
      "week_start": "2024-01-15",
      "stacks_created": 0
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/stacks/summary" \
  -H "Authorization: Bearer <token>"

List recent stacks across the org's repositories

GET /repos/{owner}/stacks/recent

Returns clustered stacks for the org over a time window, newest first. Each entry includes the root PR plus all PRs in the stack with links to GitHub.

GitHub Token Application Key
owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

repo string[]
days integer

min: 1 · max: 90

per_page integer

min: 1 · max: 100

cursor integer

min: 0

200 Successful Response
stacksStackResponse[]required
repostringrequired

Repository full name (owner/repo)

root_prStackPRResponserequired
numberintegerrequired
titlestringrequired
statestringrequired
html_urlstringrequired
authorstring | nullrequired
pr_countintegerrequired
statestringrequired

Aggregate stack state: open, merged, or mixed

created_atstring <date-time>required
updated_atstring <date-time>required
prsStackPRResponse[]required
numberintegerrequired
titlestringrequired
statestringrequired
html_urlstringrequired
authorstring | nullrequired
next_cursorinteger | nullrequired

Offset of the next page (pass back as the `cursor` query param); null if there are no more pages.

Example Response

                          {
  "stacks": [
    {
      "repo": "string",
      "root_pr": {},
      "pr_count": 0,
      "state": "string",
      "created_at": "2024-01-15T09:00:00Z",
      "updated_at": "2024-01-15T09:00:00Z",
      "prs": null
    }
  ],
  "next_cursor": 0
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/stacks/recent" \
  -H "Authorization: Bearer <token>"

Was this page helpful?