---
title: "ResourceShark API: Holds"
description: "Place a hold, list holds, get a hold, extend a hold, commit a hold, release a hold, cancel a committed hold, or reschedule a hold, with the ResourceShark API."
url: "https://agentpost.tools/docs/resourceshark/reference/holds"
kind: reference
---

# Holds

Reserve supply until a hold expires. Extend or release a hold, commit what it reserves, or cancel or reschedule lines where allowed.

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

## Place a hold

`POST /holds`

Sets each line aside, all or nothing, until the hold is committed, released, or runs out at expiresAt. Several lines may name a resource counted in buckets, with disjoint spans in each scope, or a resource with identity: instance, each naming a different unit in scope.instanceId. A refusal names each short line and how much is available for it, and is assignment\_infeasible when a unit a line names isn’t free. Send the hold length in ttl, such as “1h”. A line on a resource held per holder names its holder in scope.holderRef. A repeat under a sourceKey already used in the project answers with the same hold, for ever.

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

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `lines` | `object[]` | Yes | 1–50 items. |
| `lines[].resourceId` | `string` | Yes | 1–256 characters. |
| `lines[].scope` | `object` | No |  |
| `lines[].scope.placeId` | `string` | No |  |
| `lines[].scope.condition` | `string` | No | 1–64 characters. |
| `lines[].scope.holderRef` | `string` | No | 1–256 characters. |
| `lines[].scope.instanceId` | `string` | No |  |
| `lines[].quantity` | `number` | Yes |  |
| `lines[].from` | `object` | No |  |
| `lines[].from.batchId` | `string` | No | 1–256 characters. |
| `lines[].from.supplyId` | `string` | No | 1–256 characters. |
| `lines[].span` | `object` | No |  |
| `lines[].span.start` | `string` | Yes | An ISO 8601 date and time. |
| `lines[].span.end` | `string` | Yes | An ISO 8601 date and time. |
| `ttl` | `string` | Yes | A duration, such as “10m” or “7d”. |
| `label` | `string` | No | 1–200 characters. |
| `holderRef` | `string` | No | 1–256 characters. |
| `reference` | `object` | No |  |
| `reference.kind` | `string` | Yes | 1–256 characters. |
| `reference.ref` | `string` | Yes | 1–256 characters. |
| `sourceKey` | `string` | Yes | 1–200 characters. |

### Response

`201 Created`, with [`HoldResponse`](/docs/resourceshark/reference/holds.md#the-holdresponse-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)
-   [`insufficient_supply`](/docs/resourceshark/errors.md#insufficient_supply) (409)
-   [`exhausted_until_supply`](/docs/resourceshark/errors.md#exhausted_until_supply) (409)
-   [`assignment_infeasible`](/docs/resourceshark/errors.md#assignment_infeasible) (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/holds \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: hold-coffee-109" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      {
        "resourceId": "res_01M83PPH000000000000000001",
        "scope": {
          "placeId": "plc_01M83PPH000000000000000001"
        },
        "quantity": 500,
        "from": {
          "batchId": "bat_01M83PPH000000000000000001"
        }
      }
    ],
    "ttl": "15m",
    "holderRef": "principal:external:u_maya",
    "label": "coffee-pickup",
    "reference": {
      "kind": "checkout",
      "ref": "checkout_109"
    },
    "sourceKey": "checkout:109:hold"
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { hold } = await client.holds.create(
  {
    lines: [
      {
        resourceId: 'res_01M83PPH000000000000000001',
        scope: { placeId: 'plc_01M83PPH000000000000000001' },
        quantity: 500,
        from: { batchId: 'bat_01M83PPH000000000000000001' },
      },
    ],
    ttl: '15m',
    holderRef: 'principal:external:u_maya',
    label: 'coffee-pickup',
    reference: { kind: 'checkout', ref: 'checkout_109' },
    sourceKey: 'checkout:109:hold',
  },
  { idempotencyKey: 'hold-coffee-109' },
);
```

```json title="Response"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000001",
    "holderRef": "principal:external:u_maya",
    "label": "coffee-pickup",
    "reference": {
      "kind": "checkout",
      "ref": "checkout_109"
    },
    "expiresAt": "2026-11-23T10:15:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000003",
        "resourceId": "res_01M83PPH000000000000000001",
        "scope": {
          "placeId": "plc_01M83PPH000000000000000001"
        },
        "quantity": 500,
        "status": "held",
        "pegs": [
          {
            "supplyId": "sup_01M83PPH000000000000000002",
            "quantity": 500
          }
        ]
      }
    ],
    "status": "open",
    "sourceKey": "checkout:109:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T10:00:00.000Z",
    "updatedAt": "2026-11-23T10:00:00.000Z"
  }
}
```

## List holds

`GET /holds`

Lists holds, optionally filtered by holder, label, and status. A caller constrained to one holder lists only its own. A hold whose detail retention removed is not listed.

-   **Who may call:** Your server, with your project’s secret key or a signed-in principal, with a user token for their own `principal:<principal>` holder.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.holds.list(query)`
-   **Pages:** `limit`, 1 to 500, default 100, with `next` and `after`. [Lists](/docs/platform/api-basics.md#lists) has the rule.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `holderRef` | `string` | No | 1–256 characters. |
| `label` | `string` | No | 1–200 characters. |
| `status` | `string` | No | One of `"open"`, `"committed"`, `"partially_committed"`, `"released"`, `"expired"`, or `"cancelled"`. |
| `after` | `string` | No | 1–200 characters. |
| `limit` | `integer` | No | 1–500; default `100`. |

### Response

`200 OK`, with [`HoldsPage`](/docs/resourceshark/reference/holds.md#the-holdspage-object).

### Errors

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

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/holds?holderRef=principal%3Aexternal%3Au_maya&label=coffee-pickup&status=open&limit=20' \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { holds } = await client.holds.list({
  holderRef: 'principal:external:u_maya',
  label: 'coffee-pickup',
  status: 'open',
  limit: 20,
});
```

```json title="Response"
{
  "holds": [
    {
      "id": "hld_01M83PPH000000000000000001",
      "holderRef": "principal:external:u_maya",
      "label": "coffee-pickup",
      "reference": {
        "kind": "checkout",
        "ref": "checkout_109"
      },
      "expiresAt": "2026-11-23T10:15:00.000Z",
      "lines": [
        {
          "claimId": "clm_01M83PPH000000000000000003",
          "resourceId": "res_01M83PPH000000000000000001",
          "scope": {
            "placeId": "plc_01M83PPH000000000000000001"
          },
          "quantity": 500,
          "status": "held",
          "pegs": [
            {
              "supplyId": "sup_01M83PPH000000000000000002",
              "quantity": 500
            }
          ]
        }
      ],
      "status": "open",
      "sourceKey": "checkout:109:hold",
      "actor": {
        "id": "key:juniper-backend"
      },
      "createdAt": "2026-11-23T10:00:00.000Z",
      "updatedAt": "2026-11-23T10:00:00.000Z"
    }
  ]
}
```

## Get a hold

`GET /holds/:id`

Reads a hold with its lines. A caller constrained to one holder reads only its own. Once retention has removed a hold’s detail, it reads as its RetainedHold, and only to a caller constrained to no holder.

-   **Who may call:** Your server, with your project’s secret key or a signed-in principal, with a user token for their own `principal:<principal>` holder.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.holds.get(id)`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Hold ID, `hld_…`. The `id` of a [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object). |

### Response

`200 OK`, with [`HoldResponse`](/docs/resourceshark/reference/holds.md#the-holdresponse-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/holds/hld_01M83PPH000000000000000001 \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { hold } = await client.holds.get('hld_01M83PPH000000000000000001');
```

```json title="Response"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000001",
    "holderRef": "principal:external:u_maya",
    "label": "coffee-pickup",
    "reference": {
      "kind": "checkout",
      "ref": "checkout_109"
    },
    "expiresAt": "2026-11-23T10:15:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000003",
        "resourceId": "res_01M83PPH000000000000000001",
        "scope": {
          "placeId": "plc_01M83PPH000000000000000001"
        },
        "quantity": 500,
        "status": "held",
        "pegs": [
          {
            "supplyId": "sup_01M83PPH000000000000000002",
            "quantity": 500
          }
        ]
      }
    ],
    "status": "open",
    "sourceKey": "checkout:109:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T10:00:00.000Z",
    "updatedAt": "2026-11-23T10:00:00.000Z"
  }
}
```

## Extend a hold

`POST /holds/:id/extend`

Extends the hold from now by the required ttl, such as “15m”. The expiry can only move later.

-   **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.holds.extend(id, 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 | Hold ID, `hld_…`. The `id` of a [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `ttl` | `string` | Yes | A duration, such as “10m” or “7d”. |

### Response

`200 OK`, with [`HoldResponse`](/docs/resourceshark/reference/holds.md#the-holdresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large) (413)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`hold_expired`](/docs/resourceshark/errors.md#hold_expired) (409)
-   [`hold_resolved`](/docs/resourceshark/errors.md#hold_resolved) (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/holds/hld_01M83PPH000000000000000002/extend \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: extend-court-217" \
  -H "Content-Type: application/json" \
  -d '{
    "ttl": "15m"
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { hold } = await client.holds.extend(
  'hld_01M83PPH000000000000000002',
  { ttl: '15m' },
  { idempotencyKey: 'extend-court-217' },
);
```

```json title="Response"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000002",
    "holderRef": "principal:external:u_maya",
    "label": "court-booking",
    "reference": {
      "kind": "booking_request",
      "ref": "court_request_217"
    },
    "expiresAt": "2026-11-23T11:25:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "quantity": 1,
        "span": {
          "start": "2026-11-23T17:00:00.000Z",
          "end": "2026-11-23T18:00:00.000Z"
        },
        "status": "held"
      }
    ],
    "status": "open",
    "sourceKey": "court:217:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T11:00:00.000Z",
    "updatedAt": "2026-11-23T11:10:00.000Z"
  }
}
```

## Commit a hold

`POST /holds/:id/commit`

Takes every line in full when lines is omitted or empty. A nonempty list names each line and the quantity to take, and the rest is released. An expired hold is refused with hold\_expired and the available quantity on each line the service still retains. Use POST /consume to make a separate purchase with the same lines. A repeat under a sourceKey that already committed the hold 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.holds.commit(id, 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 | Hold ID, `hld_…`. The `id` of a [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `evidence` | `object` | Yes |  |
| `evidence.kind` | `string` | Yes | 1–256 characters. |
| `evidence.ref` | `string` | Yes | 1–256 characters. |
| `sourceKey` | `string` | Yes | 1–200 characters. |
| `lines` | `object[]` | No | Up to 50 items. |
| `lines[].claimId` | `string` | Yes | 1–256 characters. |
| `lines[].quantity` | `number` | Yes |  |

### Response

`200 OK`, with [`HoldCommitResponse`](/docs/resourceshark/reference/holds.md#the-holdcommitresponse-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)
-   [`hold_expired`](/docs/resourceshark/errors.md#hold_expired) (409)
-   [`hold_resolved`](/docs/resourceshark/errors.md#hold_resolved) (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/holds/hld_01M83PPH000000000000000002/commit \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: commit-court-217" \
  -H "Content-Type: application/json" \
  -d '{
    "evidence": {
      "kind": "booking",
      "ref": "court_booking_217"
    },
    "sourceKey": "court:217:book",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "quantity": 1
      }
    ]
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { hold, movements } = await client.holds.commit(
  'hld_01M83PPH000000000000000002',
  {
    evidence: { kind: 'booking', ref: 'court_booking_217' },
    sourceKey: 'court:217:book',
    lines: [{ claimId: 'clm_01M83PPH000000000000000004', quantity: 1 }],
  },
  { idempotencyKey: 'commit-court-217' },
);
```

```json title="Response"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000002",
    "holderRef": "principal:external:u_maya",
    "label": "court-booking",
    "reference": {
      "kind": "booking_request",
      "ref": "court_request_217"
    },
    "expiresAt": "2026-11-23T11:25:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "quantity": 1,
        "span": {
          "start": "2026-11-23T17:00:00.000Z",
          "end": "2026-11-23T18:00:00.000Z"
        },
        "status": "committed",
        "committed": 1
      }
    ],
    "status": "committed",
    "sourceKey": "court:217:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T11:00:00.000Z",
    "updatedAt": "2026-11-23T11:15:00.000Z",
    "resolution": {
      "at": "2026-11-23T11:15:00.000Z",
      "evidence": {
        "kind": "booking",
        "ref": "court_booking_217"
      },
      "sourceKey": "court:217:book"
    }
  },
  "movements": [
    {
      "id": "mov_01M83PPH00000000000000000G",
      "seq": 16,
      "resourceId": "res_01M83PPH000000000000000004",
      "scope": {
        "instanceId": "ins_01M83PPH000000000000000001"
      },
      "bucketStart": "2026-11-23T17:00:00.000Z",
      "reason": "commit",
      "held": {
        "quantity": -1,
        "before": 1,
        "after": 0
      },
      "claimId": "clm_01M83PPH000000000000000004",
      "holdId": "hld_01M83PPH000000000000000002",
      "evidence": {
        "kind": "booking",
        "ref": "court_booking_217"
      },
      "at": "2026-11-23T11:15:00.000Z",
      "quantity": -1,
      "before": 1,
      "after": 0,
      "actor": {
        "id": "key:juniper-backend"
      }
    }
  ]
}
```

## Release a hold

`POST /holds/:id/release`

Lets go of everything the hold holds. A hold already released is returned as it is.

-   **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.holds.release(id, { 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 | Hold ID, `hld_…`. The `id` of a [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object). |

### Response

`200 OK`, with [`HoldResponse`](/docs/resourceshark/reference/holds.md#the-holdresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`hold_resolved`](/docs/resourceshark/errors.md#hold_resolved) (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/holds/hld_01M83PPH000000000000000001/release \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: release-coffee-109"
```

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

const client = createClient({ token: 'sk_test_…' });
const { hold } = await client.holds.release('hld_01M83PPH000000000000000001', {
  idempotencyKey: 'release-coffee-109',
});
```

```json title="Response"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000001",
    "holderRef": "principal:external:u_maya",
    "label": "coffee-pickup",
    "reference": {
      "kind": "checkout",
      "ref": "checkout_109"
    },
    "expiresAt": "2026-11-23T10:15:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000003",
        "resourceId": "res_01M83PPH000000000000000001",
        "scope": {
          "placeId": "plc_01M83PPH000000000000000001"
        },
        "quantity": 500,
        "status": "released",
        "pegs": [
          {
            "supplyId": "sup_01M83PPH000000000000000002",
            "quantity": 500
          }
        ]
      }
    ],
    "status": "released",
    "sourceKey": "checkout:109:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T10:00:00.000Z",
    "updatedAt": "2026-11-23T10:05:00.000Z",
    "resolution": {
      "at": "2026-11-23T10:05:00.000Z"
    }
  }
}
```

## Cancel a committed hold

`POST /holds/:id/cancel`

Gives back the committed lines it names, or all of them, all or nothing: a span’s buckets return, and what a used-up line took goes back where its pegs say. The hold reads cancelled once every line its commit took from is. A repeat under a sourceKey already used in the project 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.holds.cancel(id, 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 | Hold ID, `hld_…`. The `id` of a [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `lines` | `string[]` | No | 1–50 items. |
| `evidence` | `object` | No |  |
| `evidence.kind` | `string` | Yes | 1–256 characters. |
| `evidence.ref` | `string` | Yes | 1–256 characters. |
| `sourceKey` | `string` | Yes | 1–200 characters. |

### Response

`200 OK`, with [`HoldCancelResponse`](/docs/resourceshark/reference/holds.md#the-holdcancelresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large) (413)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`duplicate_source`](/docs/resourceshark/errors.md#duplicate_source) (409)
-   [`hold_resolved`](/docs/resourceshark/errors.md#hold_resolved) (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/holds/hld_01M83PPH000000000000000002/cancel \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: cancel-court-217" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      "clm_01M83PPH000000000000000004"
    ],
    "evidence": {
      "kind": "cancellation",
      "ref": "court_booking_217"
    },
    "sourceKey": "court:217:cancel"
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { hold, movements } = await client.holds.cancel(
  'hld_01M83PPH000000000000000002',
  {
    lines: ['clm_01M83PPH000000000000000004'],
    evidence: { kind: 'cancellation', ref: 'court_booking_217' },
    sourceKey: 'court:217:cancel',
  },
  { idempotencyKey: 'cancel-court-217' },
);
```

```json title="Response"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000002",
    "holderRef": "principal:external:u_maya",
    "label": "court-booking",
    "reference": {
      "kind": "booking_request",
      "ref": "court_request_217"
    },
    "expiresAt": "2026-11-23T11:25:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "quantity": 1,
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        },
        "status": "cancelled",
        "committed": 1
      }
    ],
    "status": "cancelled",
    "sourceKey": "court:217:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T11:00:00.000Z",
    "updatedAt": "2026-11-23T11:30:00.000Z",
    "resolution": {
      "at": "2026-11-23T11:15:00.000Z",
      "evidence": {
        "kind": "booking",
        "ref": "court_booking_217"
      },
      "sourceKey": "court:217:book"
    },
    "cancellations": [
      {
        "at": "2026-11-23T11:30:00.000Z",
        "claimIds": ["clm_01M83PPH000000000000000004"],
        "evidence": {
          "kind": "cancellation",
          "ref": "court_booking_217"
        },
        "sourceKey": "court:217:cancel"
      }
    ]
  },
  "movements": [
    {
      "id": "mov_01M83PPH00000000000000000P",
      "seq": 22,
      "resourceId": "res_01M83PPH000000000000000004",
      "scope": {
        "instanceId": "ins_01M83PPH000000000000000001"
      },
      "bucketStart": "2026-11-23T18:00:00.000Z",
      "reason": "cancel",
      "claimId": "clm_01M83PPH000000000000000004",
      "holdId": "hld_01M83PPH000000000000000002",
      "evidence": {
        "kind": "cancellation",
        "ref": "court_booking_217"
      },
      "at": "2026-11-23T11:30:00.000Z",
      "quantity": 1,
      "before": 0,
      "after": 1,
      "actor": {
        "id": "key:juniper-backend"
      }
    }
  ]
}
```

## Reschedule a hold

`POST /reschedule`

Moves hold lines on resources counted in buckets, from one hold or several, to another resource, another unit, another span, or any mix, in one write: every old position is given back and every new one taken, or nothing changes, so two bookings on two full resources can swap. Each line stays held or committed. A line that omits resourceId keeps its resource and scope. A line that names a resource gives its full scope there. If the destination differs from the original resource in unit code or precision, the API answers invalid\_request. A short move is refused with what each short line has available, and a unit that isn’t free with assignment\_infeasible. A line already where it is asked to be is left alone. The answer shows each hold a line belongs to in full, so authorize is asked about each claim, each resource a line names, and each hold. A repeat under a sourceKey already used in the project answers with the first result, with each hold as it now is.

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

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `lines` | `object[]` | Yes | 1–50 items. |
| `lines[].claimId` | `string` | Yes | 1–256 characters. |
| `lines[].resourceId` | `string` | No | 1–256 characters. |
| `lines[].scope` | `object` | No |  |
| `lines[].scope.placeId` | `string` | No |  |
| `lines[].scope.condition` | `string` | No | 1–64 characters. |
| `lines[].scope.holderRef` | `string` | No | 1–256 characters. |
| `lines[].scope.instanceId` | `string` | No |  |
| `lines[].span` | `object` | No |  |
| `lines[].span.start` | `string` | Yes | An ISO 8601 date and time. |
| `lines[].span.end` | `string` | Yes | An ISO 8601 date and time. |
| `evidence` | `object` | No |  |
| `evidence.kind` | `string` | Yes | 1–256 characters. |
| `evidence.ref` | `string` | Yes | 1–256 characters. |
| `sourceKey` | `string` | Yes | 1–200 characters. |

### Response

`200 OK`, with [`HoldRescheduleResponse`](/docs/resourceshark/reference/holds.md#the-holdrescheduleresponse-object).

### Errors

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large) (413)
-   [`not_found`](/docs/resourceshark/errors.md#not_found) (404)
-   [`duplicate_source`](/docs/resourceshark/errors.md#duplicate_source) (409)
-   [`insufficient_supply`](/docs/resourceshark/errors.md#insufficient_supply) (409)
-   [`exhausted_until_supply`](/docs/resourceshark/errors.md#exhausted_until_supply) (409)
-   [`assignment_infeasible`](/docs/resourceshark/errors.md#assignment_infeasible) (409)
-   [`hold_resolved`](/docs/resourceshark/errors.md#hold_resolved) (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/reschedule \
  -H "Authorization: Bearer sk_test_…" \
  -H "Idempotency-Key: reschedule-court-217" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        }
      }
    ],
    "evidence": {
      "kind": "booking",
      "ref": "court_booking_217"
    },
    "sourceKey": "court:217:reschedule"
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { holds, lines } = await client.holds.reschedule(
  {
    lines: [
      {
        claimId: 'clm_01M83PPH000000000000000004',
        span: {
          start: '2026-11-23T18:00:00.000Z',
          end: '2026-11-23T19:00:00.000Z',
        },
      },
    ],
    evidence: { kind: 'booking', ref: 'court_booking_217' },
    sourceKey: 'court:217:reschedule',
  },
  { idempotencyKey: 'reschedule-court-217' },
);
```

```json title="Response"
{
  "holds": [
    {
      "id": "hld_01M83PPH000000000000000002",
      "holderRef": "principal:external:u_maya",
      "label": "court-booking",
      "reference": {
        "kind": "booking_request",
        "ref": "court_request_217"
      },
      "expiresAt": "2026-11-23T11:25:00.000Z",
      "lines": [
        {
          "claimId": "clm_01M83PPH000000000000000004",
          "resourceId": "res_01M83PPH000000000000000004",
          "scope": {
            "instanceId": "ins_01M83PPH000000000000000001"
          },
          "quantity": 1,
          "span": {
            "start": "2026-11-23T18:00:00.000Z",
            "end": "2026-11-23T19:00:00.000Z"
          },
          "status": "committed",
          "committed": 1
        }
      ],
      "status": "committed",
      "sourceKey": "court:217:hold",
      "actor": {
        "id": "key:juniper-backend"
      },
      "createdAt": "2026-11-23T11:00:00.000Z",
      "updatedAt": "2026-11-23T11:20:00.000Z",
      "resolution": {
        "at": "2026-11-23T11:15:00.000Z",
        "evidence": {
          "kind": "booking",
          "ref": "court_booking_217"
        },
        "sourceKey": "court:217:book"
      }
    }
  ],
  "lines": [
    {
      "claimId": "clm_01M83PPH000000000000000004",
      "holdId": "hld_01M83PPH000000000000000002",
      "before": {
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "span": {
          "start": "2026-11-23T17:00:00.000Z",
          "end": "2026-11-23T18:00:00.000Z"
        }
      },
      "after": {
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        }
      }
    }
  ]
}
```

## The HoldResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `hold` | [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object) or [`RetainedHold`](/docs/resourceshark/reference/holds.md#the-retainedhold-object) | Always | A `RetainedHold`, with `retainedAt`, once retention has removed the hold’s detail. |
| `duplicate` | `true` | When set | Set when the `sourceKey` already named this request: nothing was held again. |

```json title="The HoldResponse object"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000001",
    "holderRef": "principal:external:u_maya",
    "label": "coffee-pickup",
    "reference": {
      "kind": "checkout",
      "ref": "checkout_109"
    },
    "expiresAt": "2026-11-23T10:15:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000003",
        "resourceId": "res_01M83PPH000000000000000001",
        "scope": {
          "placeId": "plc_01M83PPH000000000000000001"
        },
        "quantity": 500,
        "status": "held",
        "pegs": [
          {
            "supplyId": "sup_01M83PPH000000000000000002",
            "quantity": 500
          }
        ]
      }
    ],
    "status": "open",
    "sourceKey": "checkout:109:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T10:00:00.000Z",
    "updatedAt": "2026-11-23T10:00:00.000Z"
  }
}
```

## The HoldsPage object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `holds` | [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object) array | Always |  |
| `next` | `string` | When set |  |

```json title="The HoldsPage object"
{
  "holds": [
    {
      "id": "hld_01M83PPH000000000000000001",
      "holderRef": "principal:external:u_maya",
      "label": "coffee-pickup",
      "reference": {
        "kind": "checkout",
        "ref": "checkout_109"
      },
      "expiresAt": "2026-11-23T10:15:00.000Z",
      "lines": [
        {
          "claimId": "clm_01M83PPH000000000000000003",
          "resourceId": "res_01M83PPH000000000000000001",
          "scope": {
            "placeId": "plc_01M83PPH000000000000000001"
          },
          "quantity": 500,
          "status": "held",
          "pegs": [
            {
              "supplyId": "sup_01M83PPH000000000000000002",
              "quantity": 500
            }
          ]
        }
      ],
      "status": "open",
      "sourceKey": "checkout:109:hold",
      "actor": {
        "id": "key:juniper-backend"
      },
      "createdAt": "2026-11-23T10:00:00.000Z",
      "updatedAt": "2026-11-23T10:00:00.000Z"
    }
  ]
}
```

## The HoldCommitResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `hold` | [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object) or [`RetainedHold`](/docs/resourceshark/reference/holds.md#the-retainedhold-object) | Always | A `RetainedHold`, with `retainedAt`, when the commit is repeated after retention has removed the hold’s detail. |
| `movements` | [`Movement`](/docs/resourceshark/reference/supply.md#the-movement-object) array | Always | What the commit moved, in the order of the lines: one for each line it took from or let go. |
| `duplicate` | `true` | When set | Set when the `sourceKey` already named this commit: nothing was taken again. |

```json title="The HoldCommitResponse object"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000002",
    "holderRef": "principal:external:u_maya",
    "label": "court-booking",
    "reference": {
      "kind": "booking_request",
      "ref": "court_request_217"
    },
    "expiresAt": "2026-11-23T11:25:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "quantity": 1,
        "span": {
          "start": "2026-11-23T17:00:00.000Z",
          "end": "2026-11-23T18:00:00.000Z"
        },
        "status": "committed",
        "committed": 1
      }
    ],
    "status": "committed",
    "sourceKey": "court:217:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T11:00:00.000Z",
    "updatedAt": "2026-11-23T11:15:00.000Z",
    "resolution": {
      "at": "2026-11-23T11:15:00.000Z",
      "evidence": {
        "kind": "booking",
        "ref": "court_booking_217"
      },
      "sourceKey": "court:217:book"
    }
  },
  "movements": [
    {
      "id": "mov_01M83PPH00000000000000000G",
      "seq": 16,
      "resourceId": "res_01M83PPH000000000000000004",
      "scope": {
        "instanceId": "ins_01M83PPH000000000000000001"
      },
      "bucketStart": "2026-11-23T17:00:00.000Z",
      "reason": "commit",
      "held": {
        "quantity": -1,
        "before": 1,
        "after": 0
      },
      "claimId": "clm_01M83PPH000000000000000004",
      "holdId": "hld_01M83PPH000000000000000002",
      "evidence": {
        "kind": "booking",
        "ref": "court_booking_217"
      },
      "at": "2026-11-23T11:15:00.000Z",
      "quantity": -1,
      "before": 1,
      "after": 0,
      "actor": {
        "id": "key:juniper-backend"
      }
    }
  ]
}
```

## The HoldCancelResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `hold` | [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object) or [`RetainedHold`](/docs/resourceshark/reference/holds.md#the-retainedhold-object) | Always | A `RetainedHold`, with `retainedAt`, when the cancel is repeated after retention has removed the hold’s detail. |
| `movements` | [`Movement`](/docs/resourceshark/reference/supply.md#the-movement-object) array | Always | What the cancel gave back, one for each line, in the order the hold lists them: on buckets, its first bucket’s. |
| `duplicate` | `true` | When set | Set when the `sourceKey` already named this cancel: nothing was given back again. |

```json title="The HoldCancelResponse object"
{
  "hold": {
    "id": "hld_01M83PPH000000000000000002",
    "holderRef": "principal:external:u_maya",
    "label": "court-booking",
    "reference": {
      "kind": "booking_request",
      "ref": "court_request_217"
    },
    "expiresAt": "2026-11-23T11:25:00.000Z",
    "lines": [
      {
        "claimId": "clm_01M83PPH000000000000000004",
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "quantity": 1,
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        },
        "status": "cancelled",
        "committed": 1
      }
    ],
    "status": "cancelled",
    "sourceKey": "court:217:hold",
    "actor": {
      "id": "key:juniper-backend"
    },
    "createdAt": "2026-11-23T11:00:00.000Z",
    "updatedAt": "2026-11-23T11:30:00.000Z",
    "resolution": {
      "at": "2026-11-23T11:15:00.000Z",
      "evidence": {
        "kind": "booking",
        "ref": "court_booking_217"
      },
      "sourceKey": "court:217:book"
    },
    "cancellations": [
      {
        "at": "2026-11-23T11:30:00.000Z",
        "claimIds": ["clm_01M83PPH000000000000000004"],
        "evidence": {
          "kind": "cancellation",
          "ref": "court_booking_217"
        },
        "sourceKey": "court:217:cancel"
      }
    ]
  },
  "movements": [
    {
      "id": "mov_01M83PPH00000000000000000P",
      "seq": 22,
      "resourceId": "res_01M83PPH000000000000000004",
      "scope": {
        "instanceId": "ins_01M83PPH000000000000000001"
      },
      "bucketStart": "2026-11-23T18:00:00.000Z",
      "reason": "cancel",
      "claimId": "clm_01M83PPH000000000000000004",
      "holdId": "hld_01M83PPH000000000000000002",
      "evidence": {
        "kind": "cancellation",
        "ref": "court_booking_217"
      },
      "at": "2026-11-23T11:30:00.000Z",
      "quantity": 1,
      "before": 0,
      "after": 1,
      "actor": {
        "id": "key:juniper-backend"
      }
    }
  ]
}
```

## The HoldRescheduleResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `holds` | array of [`Hold`](/docs/resourceshark/reference/holds.md#the-hold-object) or [`RetainedHold`](/docs/resourceshark/reference/holds.md#the-retainedhold-object) | Always | Each hold a line belongs to, in the order first named, in full and as it now is, which the caller is asked to be allowed to reschedule as a whole. A repeat under the `sourceKey` shows each as it is at the repeat, after any later change, and a `RetainedHold` once retention has removed its detail. |
| `lines` | [`RescheduledLine`](/docs/resourceshark/reference/holds.md#the-rescheduledline-object) array | Always | The lines that moved, in request order, as they moved then, a repeat included; a line already where it was asked to be isn’t listed. |
| `duplicate` | `true` | When set | Set when the `sourceKey` already named this reschedule: nothing moved again. |

```json title="The HoldRescheduleResponse object"
{
  "holds": [
    {
      "id": "hld_01M83PPH000000000000000002",
      "holderRef": "principal:external:u_maya",
      "label": "court-booking",
      "reference": {
        "kind": "booking_request",
        "ref": "court_request_217"
      },
      "expiresAt": "2026-11-23T11:25:00.000Z",
      "lines": [
        {
          "claimId": "clm_01M83PPH000000000000000004",
          "resourceId": "res_01M83PPH000000000000000004",
          "scope": {
            "instanceId": "ins_01M83PPH000000000000000001"
          },
          "quantity": 1,
          "span": {
            "start": "2026-11-23T18:00:00.000Z",
            "end": "2026-11-23T19:00:00.000Z"
          },
          "status": "committed",
          "committed": 1
        }
      ],
      "status": "committed",
      "sourceKey": "court:217:hold",
      "actor": {
        "id": "key:juniper-backend"
      },
      "createdAt": "2026-11-23T11:00:00.000Z",
      "updatedAt": "2026-11-23T11:20:00.000Z",
      "resolution": {
        "at": "2026-11-23T11:15:00.000Z",
        "evidence": {
          "kind": "booking",
          "ref": "court_booking_217"
        },
        "sourceKey": "court:217:book"
      }
    }
  ],
  "lines": [
    {
      "claimId": "clm_01M83PPH000000000000000004",
      "holdId": "hld_01M83PPH000000000000000002",
      "before": {
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "span": {
          "start": "2026-11-23T17:00:00.000Z",
          "end": "2026-11-23T18:00:00.000Z"
        }
      },
      "after": {
        "resourceId": "res_01M83PPH000000000000000004",
        "scope": {
          "instanceId": "ins_01M83PPH000000000000000001"
        },
        "span": {
          "start": "2026-11-23T18:00:00.000Z",
          "end": "2026-11-23T19:00:00.000Z"
        }
      }
    }
  ]
}
```

## The Hold object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `id` | `string` | Always | Hold ID, `hld_…`. |
| `label` | `string` | When set | A label supplied by the app for grouping holds. |
| `expiresAt` | `string` | Always | When it runs out, set by the server. |
| `holderRef` | `string` | When set | Whom it holds for. |
| `reference` | [`Evidence`](/docs/resourceshark/reference/supply.md#the-evidence-object) | When set | What it was placed for, such as the checkout or the order. |
| `lines` | [`HoldLine`](/docs/resourceshark/reference/holds.md#the-holdline-object) array | Always | One per line asked for, in the same order. |
| `status` | `string` | Always | `expired` from `expiresAt` on if the hold was still open. One of `"open"`, `"committed"`, `"partially_committed"`, `"released"`, `"expired"`, or `"cancelled"`. |
| `resolution` | [`HoldResolution`](/docs/resourceshark/reference/holds.md#the-holdresolution-object) | When set | Set once the hold is no longer open. |
| `cancellations` | [`HoldCancellation`](/docs/resourceshark/reference/holds.md#the-holdcancellation-object) array | When set | Each cancel of the committed hold, in order. |
| `sourceKey` | `string` | Always |  |
| `actor` | [`PrincipalRef`](/docs/resourceshark/reference/supply.md#the-principalref-object) | Always | The principal that placed it with its own credential. |
| `onBehalfOf` | [`PrincipalRef`](/docs/resourceshark/reference/supply.md#the-principalref-object) | When set |  |
| `createdAt` | `string` | Always | An ISO 8601 date and time. |
| `updatedAt` | `string` | Always | An ISO 8601 date and time. |

```json title="The Hold object"
{
  "id": "hld_01M83PPH000000000000000001",
  "holderRef": "principal:external:u_maya",
  "label": "coffee-pickup",
  "reference": {
    "kind": "checkout",
    "ref": "checkout_109"
  },
  "expiresAt": "2026-11-23T10:15:00.000Z",
  "lines": [
    {
      "claimId": "clm_01M83PPH000000000000000003",
      "resourceId": "res_01M83PPH000000000000000001",
      "scope": {
        "placeId": "plc_01M83PPH000000000000000001"
      },
      "quantity": 500,
      "status": "held",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000002",
          "quantity": 500
        }
      ]
    }
  ],
  "status": "open",
  "sourceKey": "checkout:109:hold",
  "actor": {
    "id": "key:juniper-backend"
  },
  "createdAt": "2026-11-23T10:00:00.000Z",
  "updatedAt": "2026-11-23T10:00:00.000Z"
}
```

## The RetainedHold object

A resolved hold once retention has removed its detail: what its `sourceKey` and its commit’s still answer with. Its lines are the ones a commit took from, which stay as the record of what was taken.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `id` | `string` | Always | Hold ID, `hld_…`. |
| `status` | `string` | Always | How it ended. One of `"committed"`, `"partially_committed"`, `"released"`, `"expired"`, or `"cancelled"`. |
| `resolution` | [`HoldResolution`](/docs/resourceshark/reference/holds.md#the-holdresolution-object) | Always |  |
| `sourceKey` | `string` | Always |  |
| `lines` | [`HoldLine`](/docs/resourceshark/reference/holds.md#the-holdline-object) array | Always |  |
| `retainedAt` | `string` | Always | When retention removed the rest, including the label, holder, and lines that took nothing. |

```json title="The RetainedHold object"
{
  "id": "hld_01M83PPH000000000000000001",
  "status": "released",
  "resolution": {
    "at": "2026-11-23T10:05:00.000Z"
  },
  "sourceKey": "checkout:109:hold",
  "lines": [],
  "retainedAt": "2026-11-26T10:05:00.000Z"
}
```

## The RescheduledLine object

One line a reschedule moved: its hold, and where it sat before and after.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `claimId` | `string` | Always | Claim ID, `clm_…`. |
| `holdId` | `string` | Always | Hold ID, `hld_…`. |
| `before` | [`LinePosition`](/docs/resourceshark/reference/holds.md#the-lineposition-object) | Always |  |
| `after` | [`LinePosition`](/docs/resourceshark/reference/holds.md#the-lineposition-object) | Always |  |

```json title="The RescheduledLine object"
{
  "claimId": "clm_01M83PPH000000000000000004",
  "holdId": "hld_01M83PPH000000000000000002",
  "before": {
    "resourceId": "res_01M83PPH000000000000000004",
    "scope": {
      "instanceId": "ins_01M83PPH000000000000000001"
    },
    "span": {
      "start": "2026-11-23T17:00:00.000Z",
      "end": "2026-11-23T18:00:00.000Z"
    }
  },
  "after": {
    "resourceId": "res_01M83PPH000000000000000004",
    "scope": {
      "instanceId": "ins_01M83PPH000000000000000001"
    },
    "span": {
      "start": "2026-11-23T18:00:00.000Z",
      "end": "2026-11-23T19:00:00.000Z"
    }
  }
}
```

## The HoldLine object

One line of a hold, as its claim stands.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `claimId` | `string` | Always | Claim ID, `clm_…`. |
| `resourceId` | `string` | Always | Resource ID, `res_…`. |
| `scope` | [`Scope`](/docs/resourceshark/reference/supply.md#the-scope-object) | Always | The scope it holds from. |
| `span` | [`FiniteSpan`](/docs/resourceshark/reference/schedules.md#the-finitespan-object) | When set | On a resource counted in buckets: the time the line holds, `[start, end)`. |
| `quantity` | `number` | Always | What the line holds, or held until the hold was resolved. |
| `status` | `string` | Always | `cancelled` once a cancel gave back what its commit took. One of `"held"`, `"committed"`, `"released"`, `"expired"`, or `"cancelled"`. |
| `committed` | `number` | When set | What the commit took for good; the rest of `quantity` was released. |
| `pegs` | [`Peg`](/docs/resourceshark/reference/supply.md#the-peg-object) array | When set | The supply entries the line holds from, or took from once committed, on a resource whose supply is told apart. |

```json title="The HoldLine object"
{
  "claimId": "clm_01M83PPH000000000000000003",
  "resourceId": "res_01M83PPH000000000000000001",
  "scope": {
    "placeId": "plc_01M83PPH000000000000000001"
  },
  "quantity": 500,
  "status": "held",
  "pegs": [
    {
      "supplyId": "sup_01M83PPH000000000000000002",
      "quantity": 500
    }
  ]
}
```

## The HoldResolution object

How a hold ended.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `at` | `string` | Always | When: the commit or the release, or, for an expiry, the `expiresAt` it ran out at. |
| `evidence` | [`Evidence`](/docs/resourceshark/reference/supply.md#the-evidence-object) | When set | What a commit was made for, such as the order. |
| `sourceKey` | `string` | When set | The commit’s `sourceKey`. |

```json title="The HoldResolution object"
{
  "at": "2026-11-23T11:15:00.000Z",
  "evidence": {
    "kind": "booking",
    "ref": "court_booking_217"
  },
  "sourceKey": "court:217:book"
}
```

## The HoldCancellation object

One cancel of a committed hold: the lines it gave back.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `at` | `string` | Always | An ISO 8601 date and time. |
| `claimIds` | `string[]` | Always |  |
| `evidence` | [`Evidence`](/docs/resourceshark/reference/supply.md#the-evidence-object) | When set |  |
| `sourceKey` | `string` | Always |  |

```json title="The HoldCancellation object"
{
  "at": "2026-11-23T11:30:00.000Z",
  "claimIds": ["clm_01M83PPH000000000000000004"],
  "evidence": {
    "kind": "cancellation",
    "ref": "court_booking_217"
  },
  "sourceKey": "court:217:cancel"
}
```

## The LinePosition object

Where a hold line sits: its resource, its scope there, and its span.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `resourceId` | `string` | Always | Resource ID, `res_…`. |
| `scope` | [`Scope`](/docs/resourceshark/reference/supply.md#the-scope-object) | Always |  |
| `span` | [`FiniteSpan`](/docs/resourceshark/reference/schedules.md#the-finitespan-object) | Always |  |

```json title="The LinePosition object"
{
  "resourceId": "res_01M83PPH000000000000000004",
  "scope": {
    "instanceId": "ins_01M83PPH000000000000000001"
  },
  "span": {
    "start": "2026-11-23T18:00:00.000Z",
    "end": "2026-11-23T19:00:00.000Z"
  }
}
```
