POST/repos/{owner}/{repo}/stacks

Create a pull request stack

Creates a stack from an ordered list of pull request numbers. Provide the pull request numbers from the bottom of the stack to the top. Each pull request's base ref must match the previous pull request's head ref.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 1 body field
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
pull_requestsarray<integer>required
An ordered list of pull request numbers forming the stack from bottom to top.

3 status codes
201Response
idintegerrequired
numberintegerrequired
node_idstringrequired
urlstringrequired
baseobjectrequired
openbooleanrequired
Whether the stack has any open pull request. False when all pull requests are merged or closed.
created_atstringrequired
pull_requestsarray<PullRequestStackPullRequest>required
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed. Returned when the request references pull requests that don't exist in the repository, or when the pull requests can't form a valid stack.

One documented failure

  • missingpull_requests

    One or more pull request numbers don't exist in the repository

messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 404 is returned: Resource not found. A 422 is returned: Validation failed. Returned when the request references pull requests that don't exist in the repository, or when the pull requests can't form a valid stack.

Was this helpful?