Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

ResourceShark API reference

Every operation ResourceShark serves, generated from its contract, so these pages match the API. Every request follows the API basics. Start with the ResourceShark quickstart if you are new, and use the SDK from TypeScript.

For tools that read OpenAPI, /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 explains each credential.

Retrying a write

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.

Source keys explains how a write also identifies the change it makes.

Conventions

What this API sets for every operation in this reference. API basics has the rules themselves, and its table compares the APIs.

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