---
title: "Preview upcoming queue slots"
description: "PubNio API queues.slots.preview: preview upcoming queue slots. 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.

# Preview upcoming queue slots

Preview upcoming queue slots with [`GET /api/v1/queues/{queueId}/slots/preview`](https://pubnio.com/api/v1/docs#tag/queues/GET/api/v1/queues/{queueId}/slots/preview). Requires an API key with the `read` scope or a signed-in workspace member.

## Request

Returns the next occurrences in ascending order. includeOccupied also returns assigned or unavailable occurrences marked unavailable.

| Parameter         | In    | Type                | Required |
| ----------------- | ----- | ------------------- | -------- |
| `queueId`         | path  | UUID                | Yes      |
| `workspaceId`     | query | UUID                | Yes      |
| `count`           | query | string              | Yes      |
| `after`           | query | string              | No       |
| `includeOccupied` | query | `"true"`, `"false"` | No       |

## Response

- HTTP 200: `QueueSlotPreview` with `queueId`, `timezone`, `horizonEndsAt`, `occurrences`.

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

## Examples

### TypeScript

```ts
const preview = await workspace.queues.previewSlots(queueId, { count: 5 });
```

### Python

```python
preview = workspace.queues.preview_slots(queue_id, count=5)
```

### cURL

```sh
curl "https://pubnio.com/api/v1/queues/$QUEUE_ID/slots/preview?workspaceId=$WORKSPACE_ID&count=5" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
```

### CLI

```sh
pnio queues preview "$QUEUE_ID" --count 5
```

### MCP execute

```js
async () => {
  const queueId = "<queueId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/queues/${queueId}/slots/preview`,
    query: { workspaceId: codemode.workspaceId, count: 5 },
  });
  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

None needed: a read is safe to retry.

## 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-slots-preview/index.mdx
