---
title: "ResourceShark API: Slots"
description: "List slots, with the ResourceShark API."
url: "https://agentpost.tools/docs/resourceshark/reference/slots"
kind: reference
---

# Slots

See how much capacity is held, taken, or free in each time bucket for a resource.

Paths are relative to `https://api.agentpost.tools/v1/resources`. [Who may call](/docs/resourceshark/reference.md#who-may-call) explains each credential.

## List slots

`GET /slots`

Lists the buckets that start in \[from, to) for one resource and have capacity or claims. Each gives its local time in the resource’s bucket time zone, its capacity, what is taken and held, and what is free, never below 0. Send placeId for a resource kept by place, and condition to select a label there. Omitting condition selects the unlabeled scope. On a resource with identity: instance, send the unit’s instanceId: each bucket holds the unit or nothing. A bucket over capacity is listed with its claims’ total above its capacity. A hold past its expiry no longer counts. At most 2,000 buckets per request.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.slots.list(query)`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceId` | `string` | Yes | 1–256 characters. |
| `placeId` | `string` | No | 1–256 characters. |
| `condition` | `string` | No | 1–64 characters. |
| `instanceId` | `string` | No | 1–256 characters. |
| `from` | `string` | Yes | An ISO 8601 date and time. |
| `to` | `string` | Yes | An ISO 8601 date and time. |

### Response

`200 OK`, with [`SlotsResponse`](/docs/resourceshark/reference/slots.md#the-slotsresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)

Any operation can also answer with the codes [Conventions](/docs/resourceshark/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/resources/slots?resourceId=res_01M83PPH000000000000000004&instanceId=ins_01M83PPH000000000000000001&from=2026-11-23T17%3A00%3A00.000Z&to=2026-11-23T19%3A00%3A00.000Z' \
  -H "Authorization: Bearer sk_test_…"
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/resourceshark-sdk';

const client = createClient({ token: 'sk_test_…' });
const { slots } = await client.slots.list({
  resourceId: 'res_01M83PPH000000000000000004',
  instanceId: 'ins_01M83PPH000000000000000001',
  from: '2026-11-23T17:00:00.000Z',
  to: '2026-11-23T19:00:00.000Z',
});
```

```json title="Response"
{
  "slots": [
    {
      "start": "2026-11-23T17:00:00.000Z",
      "end": "2026-11-23T18:00:00.000Z",
      "timeZone": "America/Los_Angeles",
      "local": {
        "date": "2026-11-23",
        "time": "09:00"
      },
      "capacity": 1,
      "taken": 1,
      "held": 0,
      "available": 0
    },
    {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z",
      "timeZone": "America/Los_Angeles",
      "local": {
        "date": "2026-11-23",
        "time": "10:00"
      },
      "capacity": 1,
      "taken": 0,
      "held": 0,
      "available": 1
    }
  ]
}
```

## The SlotsResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `slots` | [`Slot`](/docs/resourceshark/reference/slots.md#the-slot-object) array | Always |  |

```json title="The SlotsResponse object"
{
  "slots": [
    {
      "start": "2026-11-23T17:00:00.000Z",
      "end": "2026-11-23T18:00:00.000Z",
      "timeZone": "America/Los_Angeles",
      "local": {
        "date": "2026-11-23",
        "time": "09:00"
      },
      "capacity": 1,
      "taken": 1,
      "held": 0,
      "available": 0
    },
    {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z",
      "timeZone": "America/Los_Angeles",
      "local": {
        "date": "2026-11-23",
        "time": "10:00"
      },
      "capacity": 1,
      "taken": 0,
      "held": 0,
      "available": 1
    }
  ]
}
```

## The Slot object

One bucket a claim can take, or one over capacity, with what it holds and what is free. A bucket with no capacity is not a slot unless claims are still in it. Where a daylight-saving change repeats an hour, both of its buckets are slots with the same local time.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `start` | `string` | Always | An ISO 8601 date and time. |
| `end` | `string` | Always | An ISO 8601 date and time. |
| `timeZone` | `string` | Always | The resource’s bucket time zone. |
| `local` | `object` | Always | Where the slot starts, on the local calendar and clock. |
| `local.date` | `string` | Always |  |
| `local.time` | `string` | Always |  |
| `capacity` | `number` | Always | What the schedule gives the bucket. |
| `taken` | `number` | Always | What bookings took. |
| `held` | `number` | Always | What holds not past their expiry hold. |
| `available` | `number` | Always | Capacity less what is held and taken, and never below 0: the bucket is over capacity when `taken` and `held` come to more than `capacity`. |

```json title="The Slot object"
{
  "start": "2026-11-23T17:00:00.000Z",
  "end": "2026-11-23T18:00:00.000Z",
  "timeZone": "America/Los_Angeles",
  "local": {
    "date": "2026-11-23",
    "time": "09:00"
  },
  "capacity": 1,
  "taken": 1,
  "held": 0,
  "available": 0
}
```
