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

# Queues

> Inspect and manage message and operation queues with the Python SDK

Use `client.queues` to monitor pending messages and operations for an instance.

Common fields on every call:

| Field            | Type     | Required | Description     |
| ---------------- | -------- | -------- | --------------- |
| `instance_id`    | `string` | Yes      | Instance ID.    |
| `instance_token` | `string` | Yes      | Instance token. |

## `client.queues.list_messages(...)`

Lists the pending message queue.

```python theme={null}
messages = client.queues.list_messages(
    instance_id="VZ...",
    instance_token="instance-token",
)
print(messages)
```

**Return:** envelope `{ code, success, data }` with `count` and `messages[]` (`id`, `type`, `status`, etc.).

## `client.queues.remove_message(...)`

Removes one specific message from the queue.

```python theme={null}
client.queues.remove_message(
    instance_id="VZ...",
    instance_token="instance-token",
    message_id="queue-message-id",
)
```

**Return:** envelope `{ code, success, data }` with `message_id`, `count`, `details`.

## `client.queues.purge_messages(...)`

<Warning>
  Removes all pending items from the message queue. Use only when you are sure.
</Warning>

```python theme={null}
client.queues.purge_messages(
    instance_id="VZ...",
    instance_token="instance-token",
)
```

**Return:** envelope `{ code, success, data }` with removed `count`.

## `client.queues.list_operations(...)`

Lists the pending operation queue.

```python theme={null}
operations = client.queues.list_operations(
    instance_id="VZ...",
    instance_token="instance-token",
)
print(operations)
```

**Return:** envelope `{ code, success, data }` with pending operations queue.

## `client.queues.remove_operation(...)`

Removes one specific operation from the queue.

```python theme={null}
client.queues.remove_operation(
    instance_id="VZ...",
    instance_token="instance-token",
    message_id="queue-operation-id",
)
```

**Return:** envelope `{ code, success, data }` with `message_id`, `count`, `details`.

## `client.queues.purge_operations(...)`

<Warning>
  Removes all pending items from the operation queue. Use only when you are sure.
</Warning>

```python theme={null}
client.queues.purge_operations(
    instance_id="VZ...",
    instance_token="instance-token",
)
```

**Return:** envelope `{ code, success, data }` with removed `count`.
