---
title: "Read the next free queue slot"
description: "PubNio API queues.slots.next: read the next free queue slot. 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.

# Read the next free queue slot

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

## Request

It returns the first free occurrence after `after`, or after now, up to `horizonEndsAt`; `occurrence` is `null` when none is free. An occurrence is skipped when it is blacked out or skipped, already taken by another post, at the queue's daily capacity, or too close to a neighbouring post.

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

## Response

- HTTP 200: `QueueNextSlot` with `queueId`, `occurrence`, `horizonEndsAt`.

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

## Examples

### TypeScript

```ts
const next = await workspace.queues.nextSlot(queueId);
```

### Python

```python
next = workspace.queues.next_slot(queue_id)
```

### cURL

```sh
curl "https://pubnio.com/api/v1/queues/$QUEUE_ID/next-slot?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
```

### CLI

```sh
pnio queues next-slot "$QUEUE_ID"
```

Also: `pnio schedule skip-to-next`.

### MCP execute

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