---
title: "ResourceShark API: Schedules"
description: "Save a schedule, get a schedule, create a schedule exception, list schedule exceptions, update a schedule exception, or delete a schedule exception, with the ResourceShark API."
url: "https://agentpost.tools/docs/resourceshark/reference/schedules"
kind: reference
---

# Schedules

Read or set a resource’s recurring capacity, and manage dated exceptions to it.

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

## Save a schedule

`PUT /resources/:id/schedule`

Saves a bucketed resource’s weekly schedule. Each pattern takes effect from a local date. A pattern that has taken effect stays as it is; to change the hours from a date, add a pattern that starts then, and patterns from tomorrow on can be changed or removed. The first save requires timeZone, which is fixed thereafter, and sends no If-Match. Once it has a schedule, send the version you read in If-Match. Reads and claims count the new capacity at once, and the nearest 1,000 buckets a claim has touched move to it in the save, with a capacity movement each. What is already held or taken stays as it is: overCapacity lists the buckets now over capacity, with the claims in each.

-   **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.schedules.put(resourceId, body)`
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.
-   **If-Match:** Send the version you read when replacing an existing schedule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Resource ID, `res_…`. The `id` of a [`Resource`](/docs/resourceshark/reference/resources.md#the-resource-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `timeZone` | `string` | No |  |
| `patterns` | `object[]` | Yes | 1–100 items. |
| `patterns[].from` | `string` | No |  |
| `patterns[].weekly` | `object[]` | Yes | Up to 100 items. |
| `patterns[].weekly[].day` | `integer` | Yes | 0–6. |
| `patterns[].weekly[].start` | `string` | Yes |  |
| `patterns[].weekly[].end` | `string` | Yes |  |
| `patterns[].weekly[].capacity` | `number` | No |  |

### Response

`200 OK`, with [`ScheduleSaveResponse`](/docs/resourceshark/reference/schedules.md#the-schedulesaveresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large) (413)
-   [`invalid_quantity`](/docs/resourceshark/errors.md#invalid_quantity) (422)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`stale_version`](/docs/resourceshark/errors.md#stale_version) (409)

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

```bash tab="curl"
curl -X PUT https://api.agentpost.tools/v1/resources/resources/res_01M83PPH000000000000000004/schedule \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "timeZone": "America/Los_Angeles",
    "patterns": [
      {
        "weekly": [
          {
            "day": 1,
            "start": "09:00",
            "end": "17:00"
          }
        ]
      }
    ]
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { schedule, overCapacity } = await client.schedules.put(
  'res_01M83PPH000000000000000004',
  {
    timeZone: 'America/Los_Angeles',
    patterns: [{ weekly: [{ day: 1, start: '09:00', end: '17:00' }] }],
  },
);
```

```json title="Response"
{
  "schedule": {
    "timeZone": "America/Los_Angeles",
    "patterns": [
      {
        "weekly": [
          {
            "day": 1,
            "start": "09:00",
            "end": "17:00"
          }
        ]
      }
    ],
    "resourceId": "res_01M83PPH000000000000000004",
    "version": 1,
    "updatedAt": "2026-11-23T08:30:00.000Z"
  },
  "overCapacity": {
    "buckets": [],
    "more": false
  }
}
```

## Get a schedule

`GET /resources/:id/schedule`

Reads a resource’s schedule and its version.

-   **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.schedules.get(resourceId)`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Resource ID, `res_…`. The `id` of a [`Resource`](/docs/resourceshark/reference/resources.md#the-resource-object). |

### Response

`200 OK`, with [`ScheduleResponse`](/docs/resourceshark/reference/schedules.md#the-scheduleresponse-object).

### Errors

-   [`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/resources/res_01M83PPH000000000000000004/schedule \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { schedule } = await client.schedules.get(
  'res_01M83PPH000000000000000004',
);
```

```json title="Response"
{
  "schedule": {
    "timeZone": "America/Los_Angeles",
    "patterns": [
      {
        "weekly": [
          {
            "day": 1,
            "start": "09:00",
            "end": "17:00"
          }
        ]
      }
    ],
    "resourceId": "res_01M83PPH000000000000000004",
    "version": 1,
    "updatedAt": "2026-11-23T08:30:00.000Z"
  }
}
```

## Create a schedule exception

`POST /resources/:id/exceptions`

Adds an exception to a bucketed resource: over its span, each bucket it overlaps holds its capacity in place of the weekly pattern’s, and 0 makes it unavailable. Where exceptions overlap, the lowest capacity wins. What is already held or taken stays as it is: overCapacity lists the buckets now over capacity, with the claims in each. A resource has at most 500. A repeat under the same sourceKey answers with the first result.

-   **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.exceptions.create(resourceId, body, { idempotencyKey })`
-   **Idempotency-Key:** required. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Resource ID, `res_…`. The `id` of a [`Resource`](/docs/resourceshark/reference/resources.md#the-resource-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `span` | `object` | Yes |  |
| `span.start` | `string` | Yes | An ISO 8601 date and time. |
| `span.end` | `string` | Yes | An ISO 8601 date and time. |
| `capacity` | `number` | Yes |  |
| `reason` | `string` | No | 1–200 characters. |
| `sourceKey` | `string` | Yes | 1–200 characters. |

### Response

`201 Created`, with [`ExceptionCreateResponse`](/docs/resourceshark/reference/schedules.md#the-exceptioncreateresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large) (413)
-   [`invalid_quantity`](/docs/resourceshark/errors.md#invalid_quantity) (422)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`duplicate_source`](/docs/resourceshark/errors.md#duplicate_source) (409)

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

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/resources/resources/res_01M83PPH000000000000000004/exceptions \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: close-courts-23" \
  -H "Content-Type: application/json" \
  -d '{
    "span": {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z"
    },
    "capacity": 0,
    "reason": "Court resurfacing",
    "sourceKey": "courts:resurfacing:23"
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { exception, overCapacity } = await client.exceptions.create(
  'res_01M83PPH000000000000000004',
  {
    span: {
      start: '2026-11-23T18:00:00.000Z',
      end: '2026-11-23T19:00:00.000Z',
    },
    capacity: 0,
    reason: 'Court resurfacing',
    sourceKey: 'courts:resurfacing:23',
  },
  { idempotencyKey: 'close-courts-23' },
);
```

```json title="Response"
{
  "exception": {
    "id": "exc_01M83PPH000000000000000001",
    "resourceId": "res_01M83PPH000000000000000004",
    "span": {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z"
    },
    "capacity": 0,
    "reason": "Court resurfacing",
    "version": 1,
    "createdAt": "2026-11-23T11:22:00.000Z",
    "updatedAt": "2026-11-23T11:22:00.000Z"
  },
  "overCapacity": {
    "buckets": [
      {
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        },
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "capacity": 0,
        "taken": 1,
        "held": 0,
        "claims": [
          {
            "id": "clm_01M83PPH000000000000000004",
            "kind": "booking",
            "status": "committed",
            "quantity": 1,
            "holdId": "hld_01M83PPH000000000000000002",
            "holderRef": "principal:external:u_maya"
          }
        ]
      }
    ],
    "more": false
  }
}
```

## List schedule exceptions

`GET /resources/:id/exceptions`

Lists a resource’s exceptions that overlap \[from, to), or all of them, by start.

-   **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.exceptions.list(resourceId, query)`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Resource ID, `res_…`. The `id` of a [`Resource`](/docs/resourceshark/reference/resources.md#the-resource-object). |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `string` | No | An ISO 8601 date and time. |
| `to` | `string` | No | An ISO 8601 date and time. |

### Response

`200 OK`, with [`ExceptionsList`](/docs/resourceshark/reference/schedules.md#the-exceptionslist-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/resources/res_01M83PPH000000000000000004/exceptions?from=2026-11-23T17%3A00%3A00.000Z&to=2026-11-23T21%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 { exceptions } = await client.exceptions.list(
  'res_01M83PPH000000000000000004',
  { from: '2026-11-23T17:00:00.000Z', to: '2026-11-23T21:00:00.000Z' },
);
```

```json title="Response"
{
  "exceptions": [
    {
      "id": "exc_01M83PPH000000000000000001",
      "resourceId": "res_01M83PPH000000000000000004",
      "span": {
        "start": "2026-11-23T18:00:00.000Z",
        "end": "2026-11-23T19:00:00.000Z"
      },
      "capacity": 0,
      "reason": "Court resurfacing",
      "version": 1,
      "createdAt": "2026-11-23T11:22:00.000Z",
      "updatedAt": "2026-11-23T11:22:00.000Z"
    }
  ]
}
```

## Update a schedule exception

`PATCH /resources/:id/exceptions/:eid`

Moves an exception’s span or changes its capacity, at the version in If-Match. overCapacity lists the buckets now over capacity, with the claims in each.

-   **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.exceptions.patch(resourceId, eid, body, { ifMatch })`
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.
-   **If-Match:** Required. Send the version you read.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Resource ID, `res_…`. The `id` of a [`Resource`](/docs/resourceshark/reference/resources.md#the-resource-object). |
| `eid` | `string` | Yes | Exception ID, `exc_…`. The `id` of a [`ScheduleException`](/docs/resourceshark/reference/schedules.md#the-scheduleexception-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `span` | `object` | No |  |
| `span.start` | `string` | Yes | An ISO 8601 date and time. |
| `span.end` | `string` | Yes | An ISO 8601 date and time. |
| `capacity` | `number` | No |  |
| `reason` | `string` or `null` | No |  |

### Response

`200 OK`, with [`ExceptionResponse`](/docs/resourceshark/reference/schedules.md#the-exceptionresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large) (413)
-   [`invalid_quantity`](/docs/resourceshark/errors.md#invalid_quantity) (422)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`stale_version`](/docs/resourceshark/errors.md#stale_version) (409)

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

```bash tab="curl"
curl -X PATCH https://api.agentpost.tools/v1/resources/resources/res_01M83PPH000000000000000004/exceptions/exc_01M83PPH000000000000000001 \
  -H "Authorization: Bearer sk_test_…" \
  -H "If-Match: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "span": {
      "start": "2026-11-23T19:00:00.000Z",
      "end": "2026-11-23T20:00:00.000Z"
    }
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { exception, overCapacity } = await client.exceptions.patch(
  'res_01M83PPH000000000000000004',
  'exc_01M83PPH000000000000000001',
  {
    span: {
      start: '2026-11-23T19:00:00.000Z',
      end: '2026-11-23T20:00:00.000Z',
    },
  },
  { ifMatch: 1 },
);
```

```json title="Response"
{
  "exception": {
    "id": "exc_01M83PPH000000000000000001",
    "resourceId": "res_01M83PPH000000000000000004",
    "span": {
      "start": "2026-11-23T19:00:00.000Z",
      "end": "2026-11-23T20:00:00.000Z"
    },
    "capacity": 0,
    "reason": "Court resurfacing",
    "version": 2,
    "createdAt": "2026-11-23T11:22:00.000Z",
    "updatedAt": "2026-11-23T11:25:00.000Z"
  },
  "overCapacity": {
    "buckets": [],
    "more": false
  }
}
```

## Delete a schedule exception

`DELETE /resources/:id/exceptions/:eid`

Removes an exception, so its span takes the weekly pattern’s capacity again: removing a closure reopens it. overCapacity lists the buckets now over capacity, with the claims in each.

-   **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.exceptions.delete(resourceId, eid)`
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Resource ID, `res_…`. The `id` of a [`Resource`](/docs/resourceshark/reference/resources.md#the-resource-object). |
| `eid` | `string` | Yes | Exception ID, `exc_…`. The `id` of a [`ScheduleException`](/docs/resourceshark/reference/schedules.md#the-scheduleexception-object). |

### Response

`200 OK`, with [`ExceptionDeleteResponse`](/docs/resourceshark/reference/schedules.md#the-exceptiondeleteresponse-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 -X DELETE https://api.agentpost.tools/v1/resources/resources/res_01M83PPH000000000000000004/exceptions/exc_01M83PPH000000000000000001 \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { overCapacity } = await client.exceptions.delete(
  'res_01M83PPH000000000000000004',
  'exc_01M83PPH000000000000000001',
);
```

```json title="Response"
{
  "overCapacity": {
    "buckets": [],
    "more": false
  }
}
```

## The ScheduleSaveResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `schedule` | [`Schedule`](/docs/resourceshark/reference/schedules.md#the-schedule-object) | Always |  |
| `overCapacity` | [`OverCapacity`](/docs/resourceshark/reference/resources.md#the-overcapacity-object) | Always |  |

```json title="The ScheduleSaveResponse object"
{
  "schedule": {
    "timeZone": "America/Los_Angeles",
    "patterns": [
      {
        "weekly": [
          {
            "day": 1,
            "start": "09:00",
            "end": "17:00"
          }
        ]
      }
    ],
    "resourceId": "res_01M83PPH000000000000000004",
    "version": 1,
    "updatedAt": "2026-11-23T08:30:00.000Z"
  },
  "overCapacity": {
    "buckets": [],
    "more": false
  }
}
```

## The ScheduleResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `schedule` | [`Schedule`](/docs/resourceshark/reference/schedules.md#the-schedule-object) | Always |  |

```json title="The ScheduleResponse object"
{
  "schedule": {
    "timeZone": "America/Los_Angeles",
    "patterns": [
      {
        "weekly": [
          {
            "day": 1,
            "start": "09:00",
            "end": "17:00"
          }
        ]
      }
    ],
    "resourceId": "res_01M83PPH000000000000000004",
    "version": 1,
    "updatedAt": "2026-11-23T08:30:00.000Z"
  }
}
```

## The ExceptionCreateResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `exception` | [`ScheduleException`](/docs/resourceshark/reference/schedules.md#the-scheduleexception-object) | Always |  |
| `overCapacity` | [`OverCapacity`](/docs/resourceshark/reference/resources.md#the-overcapacity-object) | Always |  |
| `duplicate` | `true` | When set | Set when the source key already named this request. |

```json title="The ExceptionCreateResponse object"
{
  "exception": {
    "id": "exc_01M83PPH000000000000000001",
    "resourceId": "res_01M83PPH000000000000000004",
    "span": {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z"
    },
    "capacity": 0,
    "reason": "Court resurfacing",
    "version": 1,
    "createdAt": "2026-11-23T11:22:00.000Z",
    "updatedAt": "2026-11-23T11:22:00.000Z"
  },
  "overCapacity": {
    "buckets": [
      {
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        },
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "capacity": 0,
        "taken": 1,
        "held": 0,
        "claims": [
          {
            "id": "clm_01M83PPH000000000000000004",
            "kind": "booking",
            "status": "committed",
            "quantity": 1,
            "holdId": "hld_01M83PPH000000000000000002",
            "holderRef": "principal:external:u_maya"
          }
        ]
      }
    ],
    "more": false
  }
}
```

## The ExceptionsList object

At most `MAX_EXCEPTIONS`, so one answer holds them all, by start.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `exceptions` | [`ScheduleException`](/docs/resourceshark/reference/schedules.md#the-scheduleexception-object) array | Always |  |

```json title="The ExceptionsList object"
{
  "exceptions": [
    {
      "id": "exc_01M83PPH000000000000000001",
      "resourceId": "res_01M83PPH000000000000000004",
      "span": {
        "start": "2026-11-23T18:00:00.000Z",
        "end": "2026-11-23T19:00:00.000Z"
      },
      "capacity": 0,
      "reason": "Court resurfacing",
      "version": 1,
      "createdAt": "2026-11-23T11:22:00.000Z",
      "updatedAt": "2026-11-23T11:22:00.000Z"
    }
  ]
}
```

## The ExceptionResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `exception` | [`ScheduleException`](/docs/resourceshark/reference/schedules.md#the-scheduleexception-object) | Always |  |
| `overCapacity` | [`OverCapacity`](/docs/resourceshark/reference/resources.md#the-overcapacity-object) | Always |  |

```json title="The ExceptionResponse object"
{
  "exception": {
    "id": "exc_01M83PPH000000000000000001",
    "resourceId": "res_01M83PPH000000000000000004",
    "span": {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z"
    },
    "capacity": 0,
    "reason": "Court resurfacing",
    "version": 1,
    "createdAt": "2026-11-23T11:22:00.000Z",
    "updatedAt": "2026-11-23T11:22:00.000Z"
  },
  "overCapacity": {
    "buckets": [
      {
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        },
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "capacity": 0,
        "taken": 1,
        "held": 0,
        "claims": [
          {
            "id": "clm_01M83PPH000000000000000004",
            "kind": "booking",
            "status": "committed",
            "quantity": 1,
            "holdId": "hld_01M83PPH000000000000000002",
            "holderRef": "principal:external:u_maya"
          }
        ]
      }
    ],
    "more": false
  }
}
```

## The ExceptionDeleteResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `overCapacity` | [`OverCapacity`](/docs/resourceshark/reference/resources.md#the-overcapacity-object) | Always |  |

```json title="The ExceptionDeleteResponse object"
{
  "overCapacity": {
    "buckets": [],
    "more": false
  }
}
```

## The Schedule object

A resource’s normal week. A bucket takes the pattern in effect on the local date it starts on, in the schedule’s time zone. Inside that pattern’s hours a bucket holds its window’s `capacity`, else the resource’s `capacity`, else as many of the resource’s active instances as are not unavailable for any part of it, else 0; outside them it holds nothing. A pattern with no windows puts no limit on the hours. A step bucket is inside the hours when one window holds all of it. A day is inside them when a window falls on its weekday, and holds the largest capacity that day’s windows give. A month is longer than any window, so patterns don’t apply to it: it holds the resource’s own capacity. An exception then replaces what the pattern gives (`ScheduleException`). A pattern that has taken effect, `from` today or earlier, stays as it is: a save changes, adds, or removes only patterns from tomorrow on.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `resourceId` | `string` | Always | Resource ID, `res_…`. |
| `timeZone` | `string` | Always |  |
| `patterns` | [`WeeklyPattern`](/docs/resourceshark/reference/schedules.md#the-weeklypattern-object) array | Always |  |
| `version` | `number` | Always | Moves with every save; send it in `If-Match` to save again. |
| `updatedAt` | `string` | Always | An ISO 8601 date and time. |

```json title="The Schedule object"
{
  "timeZone": "America/Los_Angeles",
  "patterns": [
    {
      "weekly": [
        {
          "day": 1,
          "start": "09:00",
          "end": "17:00"
        }
      ]
    }
  ],
  "resourceId": "res_01M83PPH000000000000000004",
  "version": 1,
  "updatedAt": "2026-11-23T08:30:00.000Z"
}
```

## The ScheduleException object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `id` | `string` | Always | Exception ID, `exc_…`. |
| `resourceId` | `string` | Always | Resource ID, `res_…`. |
| `span` | [`FiniteSpan`](/docs/resourceshark/reference/schedules.md#the-finitespan-object) | Always |  |
| `capacity` | `number` | Always | An integer in the resource’s base unit at its precision, as money is in cents: grams at precision 0, meters at precision 2, so 1 is 1 cm. A quantity with a fraction is refused with `invalid_quantity`. |
| `reason` | `string` | When set |  |
| `version` | `number` | Always | Moves with every change; send it in `If-Match` to change it. |
| `createdAt` | `string` | Always | An ISO 8601 date and time. |
| `updatedAt` | `string` | Always | An ISO 8601 date and time. |

```json title="The ScheduleException object"
{
  "id": "exc_01M83PPH000000000000000001",
  "resourceId": "res_01M83PPH000000000000000004",
  "span": {
    "start": "2026-11-23T18:00:00.000Z",
    "end": "2026-11-23T19:00:00.000Z"
  },
  "capacity": 0,
  "reason": "Court resurfacing",
  "version": 1,
  "createdAt": "2026-11-23T11:22:00.000Z",
  "updatedAt": "2026-11-23T11:22:00.000Z"
}
```

## The WeeklyPattern object

A normal week, in effect from `from` until the next pattern starts.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `from` | `string` | When set | `YYYY-MM-DD` in the schedule’s time zone. Missing on the first pattern. |
| `weekly` | [`WeeklyWindow`](/docs/resourceshark/reference/schedules.md#the-weeklywindow-object) array | Always |  |

```json title="The WeeklyPattern object"
{
  "weekly": [
    {
      "day": 1,
      "start": "09:00",
      "end": "17:00"
    }
  ]
}
```

## The FiniteSpan object

Half-open, `[start, end)`, in UTC, with an end.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `start` | `string` | Always | An ISO 8601 date and time. |
| `end` | `string` | Always | An ISO 8601 date and time. |

```json title="The FiniteSpan object"
{
  "start": "2026-11-23T17:00:00.000Z",
  "end": "2026-11-23T18:00:00.000Z"
}
```

## The WeeklyWindow object

One weekly window, in the schedule’s time zone.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `day` | `0`, `1`, `2`, `3`, `4`, `5`, or `6` | Always |  |
| `start` | `string` | Always | `HH:MM`. |
| `end` | `string` | Always | `HH:MM`, or `24:00` for the end of the day. |
| `capacity` | `number` | When set | An integer in the resource’s base unit at its precision, as money is in cents: grams at precision 0, meters at precision 2, so 1 is 1 cm. A quantity with a fraction is refused with `invalid_quantity`. |

```json title="The WeeklyWindow object"
{
  "day": 1,
  "start": "09:00",
  "end": "17:00"
}
```
