> For the complete documentation index, see [llms.txt](https://docs.aviator.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aviator.co/mergequeue/how-to-guides/pause-unpause-queues-via-api.md).

# Pause / Unpause Queues via API

Get guidelines on how to pause / unpause queues via API for MergeQueue. Pausing allows you to control whether PRs are merged to a specific branch.

[<mark style="color:blue;">Pausing a queue</mark>](/mergequeue/concepts/paused-queues.md) allows you to control whether PRs should be merged to a certain branches.

### Pausing all queues in a repository

You can prevent all PRs from merging in a repository. A repository can be paused from the [<mark style="color:blue;">repositories page</mark>](https://app.aviator.co/repos) or using the API:

```bash
curl -X POST \
  -H "Authorization: Bearer <aviator_token>" \
  -H "Content-Type: application/json" \
  -d '{"org": "org_name", "name": "repo_name", "paused": true }' \
https://api.aviator.co/api/v1/repo/
```

### Pausing queues via the base branch

Pausing the queue associated with a base branch can be helpful if you want to stop all merges while a release is being prepared. In this case, PRs that target all other base branches will continue merging regularly but the PRs associated with the specific base branch will be paused. Base branch pausing capability is only supported via the API:

```bash
curl -X POST \
    -H "Authorization: Bearer <aviator_token>" \
    -H "Content-Type: application/json" \
    -d '{ "pattern": "release-*", "repository": {"org": "aviator", "name": "av-demo-release"}, "paused": true, "paused_message": "This release branch has been paused."}' \
https://api.aviator.co/api/v1/branches
```

The base branch API also takes an optional parameter called paused\_message that provides an additional message in the GitHub comments for a PR when a queue is paused.

### Checking if a queue is paused

You can also use a GET request to find the current pause status of all branches:

```bash
curl -H "Authorization: Bearer <aviator_token>" \
    -H "Content-Type: application/json" \
    -d '{ "repository": {"org": "aviator", "name": "av-demo-release"}}' \
https://api.aviator.co/api/v1/branches
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aviator.co/mergequeue/how-to-guides/pause-unpause-queues-via-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
