---
title: "ResourceShark API reference"
description: "Find every ResourceShark API operation, its request and response, and who may call it."
url: "https://agentpost.tools/docs/resourceshark/reference"
kind: reference
---

# ResourceShark API reference

Every operation ResourceShark serves, generated from its contract, so these pages match the API. Every request follows the [API basics](/docs/platform/api-basics.md). Start with the [ResourceShark quickstart](/docs/resourceshark/quickstart.md) if you are new, and use the [SDK](/docs/resourceshark/sdk.md) from TypeScript.

For tools that read OpenAPI, [/docs/resourceshark/openapi.json](/docs/resourceshark/openapi.json) describes every operation here as OpenAPI 3.1, with its credentials, schemas, examples, and error codes.

## Who may call

-   **Your server** sends the project’s secret key. It can call every operation.
-   **A signed-in principal** sends a user token and can read only their own `principal:<principal>` holder records on operations that list this caller.

[Platform credentials](/docs/platform/concepts/credentials.md) explains each credential.

## Retrying a write

[Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule every API follows. ResourceShark adds two rules of its own. An `Idempotency-Key` belongs to one caller and one operation. A retry repeats the first answer even when it was an error, except for the following codes, where ResourceShark checks the request again.

-   [`invalid_request`](/docs/resourceshark/errors.md#invalid_request)
-   [`payload_too_large`](/docs/resourceshark/errors.md#payload_too_large)
-   [`unauthenticated`](/docs/resourceshark/errors.md#unauthenticated)
-   [`forbidden`](/docs/resourceshark/errors.md#forbidden)
-   [`idempotency_mismatch`](/docs/resourceshark/errors.md#idempotency_mismatch)
-   [`conflict`](/docs/resourceshark/errors.md#conflict)
-   [`cursor_expired`](/docs/resourceshark/errors.md#cursor_expired)
-   [`duplicate_source`](/docs/resourceshark/errors.md#duplicate_source)
-   [`internal_error`](/docs/resourceshark/errors.md#internal_error)

[Source keys](/docs/resourceshark/concepts/source-keys.md) explains how a write also identifies the change it makes.

## Conventions

What this API sets for every operation in this reference. [API basics](/docs/platform/api-basics.md) has the rules themselves, and its table compares the APIs.

-   **Base URL:** every path here starts with `https://api.agentpost.tools/v1/resources`.
-   **Idempotency:** Every write (`POST`, `PUT`, `PATCH`, `DELETE`) takes `Idempotency-Key`, except [Check availability](/docs/resourceshark/reference/availability.md#check-availability), whose entries say why. A key’s first answer is kept for 24 hours. It is required on [Add supply](/docs/resourceshark/reference/supply.md#add-supply), [Reverse supply](/docs/resourceshark/reference/supply.md#reverse-supply), [Place a hold](/docs/resourceshark/reference/holds.md#place-a-hold), [Extend a hold](/docs/resourceshark/reference/holds.md#extend-a-hold), [Commit a hold](/docs/resourceshark/reference/holds.md#commit-a-hold), [Release a hold](/docs/resourceshark/reference/holds.md#release-a-hold), [Cancel a committed hold](/docs/resourceshark/reference/holds.md#cancel-a-committed-hold), [Reschedule a hold](/docs/resourceshark/reference/holds.md#reschedule-a-hold), [Consume supply](/docs/resourceshark/reference/claims.md#consume-supply), [Settle an estimated claim](/docs/resourceshark/reference/claims.md#settle-an-estimated-claim), [Create a schedule exception](/docs/resourceshark/reference/schedules.md#create-a-schedule-exception), [Transfer stock](/docs/resourceshark/reference/stock.md#transfer-stock), [Record a count](/docs/resourceshark/reference/stock.md#record-a-count), [Adjust stock](/docs/resourceshark/reference/stock.md#adjust-stock), [Record a conversion](/docs/resourceshark/reference/stock.md#record-a-conversion). [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule, with the codes [`idempotency_mismatch`](/docs/resourceshark/errors.md#idempotency_mismatch) and [`conflict`](/docs/resourceshark/errors.md#conflict) it answers with.
-   **Lists:** Every paginated list takes `limit`, 1 to 500, default 100. [List resources](/docs/resourceshark/reference/resources.md#list-resources), [List places](/docs/resourceshark/reference/places.md#list-places), [List instances](/docs/resourceshark/reference/instances.md#list-instances), [List free instances](/docs/resourceshark/reference/instances.md#list-free-instances), [List supply](/docs/resourceshark/reference/supply.md#list-supply), [List batches](/docs/resourceshark/reference/batches.md#list-batches), [List a holder’s balances](/docs/resourceshark/reference/availability.md#list-a-holders-balances), [List holds](/docs/resourceshark/reference/holds.md#list-holds), and [List claims](/docs/resourceshark/reference/claims.md#list-claims) page with `next` and `after`. [List movements](/docs/resourceshark/reference/movements.md#list-movements) and [Read events](/docs/resourceshark/reference/events.md#read-events) are feeds. [List schedule exceptions](/docs/resourceshark/reference/schedules.md#list-schedule-exceptions) and [List slots](/docs/resourceshark/reference/slots.md#list-slots) answer in one response. [Lists](/docs/platform/api-basics.md#lists) has the rule.
-   **IDs:** each ID starts with its kind’s prefix, as [IDs](#ids) lists.
-   **Errors:** An error’s `docs` link goes to its code’s entry on [ResourceShark errors](/docs/resourceshark/errors.md). Any operation can answer with [`unauthenticated`](/docs/resourceshark/errors.md#unauthenticated), [`forbidden`](/docs/resourceshark/errors.md#forbidden), or [`internal_error`](/docs/resourceshark/errors.md#internal_error); each operation lists the other codes it can answer with. [Errors](/docs/platform/api-basics.md#errors) describes the body.

## IDs

| Kind | Looks like |
| --- | --- |
| Place | `plc_…` |
| Instance | `ins_…` |
| Resource | `res_…` |
| Supply | `sup_…` |
| Claim | `clm_…` |
| Movement | `mov_…` |
| Transfer | `trf_…` |
| Hold | `hld_…` |
| Batch | `bat_…` |
| Transformation | `tfm_…` |
| Exception | `exc_…` |

## Resources

Each resource has its own page, with its operations, their examples, and the objects they answer with.

| Resource | What it holds |
| --- | --- |
| [Config](/docs/resourceshark/reference/config.md) | Read or replace the project’s versioned retention settings. |
| [Resources](/docs/resourceshark/reference/resources.md) | Define what you count, how it is measured, and which scopes hold it. Read, edit, or archive a resource. |
| [Places](/docs/resourceshark/reference/places.md) | Create, list, and edit the places where stock is kept. |
| [Instances](/docs/resourceshark/reference/instances.md) | Track individual units of a resource. Set when a unit is unavailable and find units that are free for a request. |
| [Supply](/docs/resourceshark/reference/supply.md) | Record, read, and take back supply that is on hand or due. |
| [Batches](/docs/resourceshark/reference/batches.md) | Group supply entries for a resource by batch and manage their expiry. |
| [Availability](/docs/resourceshark/reference/availability.md) | Check how much a request could take, or read balances by resource, scope, or holder. |
| [Holds](/docs/resourceshark/reference/holds.md) | Reserve supply until a hold expires. Extend or release a hold, commit what it reserves, or cancel or reschedule lines where allowed. |
| [Claims](/docs/resourceshark/reference/claims.md) | Take supply, settle an estimated quantity, or read claim records. |
| [Schedules](/docs/resourceshark/reference/schedules.md) | Read or set a resource’s recurring capacity, and manage dated exceptions to it. |
| [Slots](/docs/resourceshark/reference/slots.md) | See how much capacity is held, taken, or free in each time bucket for a resource. |
| [Stock](/docs/resourceshark/reference/stock.md) | Transfer, count, adjust, or convert stock. |
| [Movements](/docs/resourceshark/reference/movements.md) | Read the movements that record changes to balances. |
| [Reports](/docs/resourceshark/reference/reports.md) | Read balance totals and sum movements by reason over a period. |
| [Events](/docs/resourceshark/reference/events.md) | Read the project’s change feed in order from a cursor. |
