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

Remove pull requests from a pull request stack

Removes the unmerged pull requests from a stack. Pull requests that cannot be unstacked (for example, those that are queued for merge) are left in place. When pull requests remain in the stack, the updated stack is returned with a 200. When no pull requests remain, the stack is dissolved and a 204 is returned.

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

3 parameters
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.
stack_numberintegerrequired
The number that identifies the pull request stack.

5 status codes
200Response
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
204A header with no content is returned.
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
409Conflict. Returned when the stack is being modified by another request.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed. Returned when the stack can't be unstacked because every pull request in it is locked and cannot be removed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 404 is returned: Resource not found. A 409 is returned: Conflict. Returned when the stack is being modified by another request. A 422 is returned: Validation failed. Returned when the stack can't be unstacked because every pull request in it is locked and cannot be removed.

Was this helpful?