---
title: "Update, pause, or resume a queue"
description: "PubNio API queues.update: update, pause, or resume a queue. Request fields, examples in five clients, errors, and idempotency."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update, pause, or resume a queue

Update, pause, or resume a queue with [`PATCH /api/v1/queues/{queueId}`](https://pubnio.com/api/v1/docs#tag/queues/PATCH/api/v1/queues/{queueId}). Requires an API key with the `publish` scope or a signed-in workspace owner.

## Request

Send expectedVersion from the last queue read. Pausing blocks new assignments; scheduled attempts still publish.

| Parameter     | In    | Type | Required |
| ------------- | ----- | ---- | -------- |
| `queueId`     | path  | UUID | Yes      |
| `workspaceId` | query | UUID | Yes      |

| Body field        | Type            | Required |
| ----------------- | --------------- | -------- |
| `expectedVersion` | integer         | Yes      |
| `name`            | string          | No       |
| `timezone`        | string          | No       |
| `paused`          | boolean         | No       |
| `isDefault`       | boolean         | No       |
| `maxPerDay`       | integer or null | No       |
| `maxPending`      | integer         | No       |
| `minGapSeconds`   | integer         | No       |
| `horizonDays`     | integer         | No       |

## Response

- HTTP 200: `Queue` with `id`, `workspaceId`, `accountId`, `name`, `timezone`, `status`, `isDefault`, `limits`, `slots`, `version`, `pausedAt`, `archivedAt`, `createdAt`, `updatedAt`.
  - `status`: `active`, `paused`, `archived`

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const queue = await workspace.queues.update(queueId, {
  expectedVersion: 3,
  paused: true,
});
```

### Python

```python
queue = workspace.queues.update(queue_id, expected_version=3, paused=True)
```

### cURL

```sh
curl -X PATCH "https://pubnio.com/api/v1/queues/$QUEUE_ID?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expectedVersion":3,"paused":true}'
```

### CLI

```sh
pnio queues pause "$QUEUE_ID" --version 3
```

Also: `pnio queues resume`, `pnio queues update`.

### MCP execute

```js
async () => {
  const queueId = "<queueId>";
  const response = await codemode.request({
    method: "PATCH",
    path: `/api/v1/queues/${queueId}`,
    query: { workspaceId: codemode.workspaceId },
    body: { expectedVersion: 3, paused: true },
  });
  return response.data;
};
```

## Errors

It declares no problem of its own.

It declares the problems [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

No key. The required `expectedVersion` makes a stale retry fail instead of applying twice.

## Limits

- Field lengths and ranges are in the [OpenAPI document](https://pubnio.com/api/v1/openapi).

## Related

- [Queues operations](https://pubnio.com/docs/reference/#queues)
- [Publishing](https://pubnio.com/docs/publishing/)

Source: https://pubnio.com/docs/reference/queues-update/index.mdx
