Stacks
Stacks endpoints for the Mergify API.
Get adoption summary metrics for Stacks
/repos/{owner}/stacks/summary
Returns counts, score, period delta, sparklines, top authors, and weekly trend for Mergify Stacks across the org's repositories over a time window (default 30 days, max 90).
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
Currently open stacks across the org
Total PRs that belong to a stack in the window
Repositories with at least one stack in the window
Percent of merged PRs in the window that came from a stack
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
}
],
"score": {
"total": 0,
"coverage": 0,
"authors": 0,
"repos": 0
},
"delta_vs_prior_period": {
"active_stacks": 0,
"stack_prs": 0,
"repos_with_stacks": 0,
"percent_merged_from_stack_pp": 0,
"score_total": 0
},
"sparklines": {
"active_stacks": [
0
],
"stack_prs": [
0
],
"repos_with_stacks": [
0
],
"percent_merged_from_stack": [
0
]
},
"top_authors": [
{
"login": "string",
"avatar_url": "string",
"stack_pr_count": 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
/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.
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
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>"
Compare stack PRs vs non-stack PRs
/repos/{owner}/stacks/impact
Returns median time-to-merge, PR size, time-to-first-review, and review-thread count for stack PRs vs all other merged PRs in the window. Bots and Mergify merge-queue PRs are excluded from the 'other' cohort to keep the comparison honest.
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
Example Response
{
"time_to_merge_hours": {
"stack": 0,
"other": 0,
"delta_percent": 0
},
"pr_size_lines": {
"stack": 0,
"other": 0,
"delta_percent": 0
},
"time_to_first_review_hours": {
"stack": 0,
"other": 0,
"delta_percent": 0
},
"review_threads": {
"stack": 0,
"other": 0,
"delta_percent": 0
},
"stack_pr_count": 0,
"other_pr_count": 0
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/stacks/impact" \
-H "Authorization: Bearer <token>"
Was this page helpful?
Thanks for your feedback!