---
title: "ResourceShark API: Movements"
description: "List movements or get a movement, with the ResourceShark API."
url: "https://agentpost.tools/docs/resourceshark/reference/movements"
kind: reference
---

# Movements

Read the movements that record changes to balances.

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

## List movements

`GET /movements`

Lists movements in sequence, oldest first by default or newest first with `order=desc`. Filter by resource, place, holder, batch, or unit to read its history.

-   **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.movements.list(query)`
-   **Pages:** `limit`, 1 to 500, default 100. A feed: every answer has `next`, to send as `after`. [Lists](/docs/platform/api-basics.md#lists) has the rule.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceId` | `string` | No | 1–256 characters. |
| `placeId` | `string` | No | 1–256 characters. |
| `holderRef` | `string` | No | 1–256 characters. |
| `batchId` | `string` | No | 1–256 characters. |
| `instanceId` | `string` | No | 1–256 characters. |
| `order` | `"asc"` or `"desc"` | No | `asc` is oldest first by default. `desc` is newest first. |
| `after` | `integer` | No | Pass `next` from a page with the same order and filters. Use `0` to start; at least 0; default `0`. |
| `limit` | `integer` | No | 1–500; default `100`. |

### Response

`200 OK`, with [`MovementsPage`](/docs/resourceshark/reference/movements.md#the-movementspage-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/movements?resourceId=res_01M83PPH000000000000000003&holderRef=principal%3Aexternal%3Au_maya&after=3&limit=4' \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { movements, next } = await client.movements.list({
  resourceId: 'res_01M83PPH000000000000000003',
  holderRef: 'principal:external:u_maya',
  after: 3,
  limit: 4,
});
```

```json title="Response"
{
  "movements": [
    {
      "id": "mov_01M83PPH000000000000000004",
      "seq": 4,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "add",
      "supplyId": "sup_01M83PPH000000000000000003",
      "evidence": {
        "kind": "credit_pack",
        "ref": "pack_1042"
      },
      "at": "2026-11-23T09:25:00.000Z",
      "quantity": 12,
      "before": 0,
      "after": 12,
      "actor": {
        "id": "key:juniper-backend"
      }
    },
    {
      "id": "mov_01M83PPH000000000000000005",
      "seq": 5,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "use",
      "claimId": "clm_01M83PPH000000000000000002",
      "supplyId": "sup_01M83PPH000000000000000003",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000003",
          "quantity": 3
        }
      ],
      "evidence": {
        "kind": "tasting",
        "ref": "tasting_1042"
      },
      "at": "2026-11-23T09:30:00.000Z",
      "quantity": -3,
      "before": 12,
      "after": 9,
      "actor": {
        "id": "key:juniper-backend"
      }
    },
    {
      "id": "mov_01M83PPH000000000000000006",
      "seq": 6,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "settle",
      "claimId": "clm_01M83PPH000000000000000002",
      "supplyId": "sup_01M83PPH000000000000000003",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000003",
          "quantity": 1
        }
      ],
      "evidence": {
        "kind": "attendance",
        "ref": "tasting_1042"
      },
      "at": "2026-11-23T09:40:00.000Z",
      "quantity": 1,
      "before": 9,
      "after": 10,
      "actor": {
        "id": "key:juniper-backend"
      }
    },
    {
      "id": "mov_01M83PPH000000000000000007",
      "seq": 7,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "reversal",
      "supplyId": "sup_01M83PPH000000000000000003",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000003",
          "quantity": 2
        }
      ],
      "evidence": {
        "kind": "refund",
        "ref": "refund_1042"
      },
      "at": "2026-11-23T09:45:00.000Z",
      "quantity": -2,
      "before": 10,
      "after": 8,
      "actor": {
        "id": "key:juniper-backend"
      }
    }
  ],
  "next": 7
}
```

## Get a movement

`GET /movements/:id`

Reads a movement. A caller constrained to one holder reads only its own.

-   **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.movements.get(id)`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Movement ID, `mov_…`. The `id` of a [`Movement`](/docs/resourceshark/reference/supply.md#the-movement-object). |

### Response

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

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

const client = createClient({ token: 'sk_test_…' });
const { movement } = await client.movements.get(
  'mov_01M83PPH000000000000000005',
);
```

```json title="Response"
{
  "movement": {
    "id": "mov_01M83PPH000000000000000005",
    "seq": 5,
    "resourceId": "res_01M83PPH000000000000000003",
    "scope": {
      "holderRef": "principal:external:u_maya"
    },
    "reason": "use",
    "claimId": "clm_01M83PPH000000000000000002",
    "supplyId": "sup_01M83PPH000000000000000003",
    "pegs": [
      {
        "supplyId": "sup_01M83PPH000000000000000003",
        "quantity": 3
      }
    ],
    "evidence": {
      "kind": "tasting",
      "ref": "tasting_1042"
    },
    "at": "2026-11-23T09:30:00.000Z",
    "quantity": -3,
    "before": 12,
    "after": 9,
    "actor": {
      "id": "key:juniper-backend"
    }
  }
}
```

## The MovementsPage object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `movements` | [`Movement`](/docs/resourceshark/reference/supply.md#the-movement-object) array | Always |  |
| `next` | `number` | Always | Pass as `after` to continue. The last movement’s seq, or `after` on an empty page. |

```json title="The MovementsPage object"
{
  "movements": [
    {
      "id": "mov_01M83PPH000000000000000004",
      "seq": 4,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "add",
      "supplyId": "sup_01M83PPH000000000000000003",
      "evidence": {
        "kind": "credit_pack",
        "ref": "pack_1042"
      },
      "at": "2026-11-23T09:25:00.000Z",
      "quantity": 12,
      "before": 0,
      "after": 12,
      "actor": {
        "id": "key:juniper-backend"
      }
    },
    {
      "id": "mov_01M83PPH000000000000000005",
      "seq": 5,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "use",
      "claimId": "clm_01M83PPH000000000000000002",
      "supplyId": "sup_01M83PPH000000000000000003",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000003",
          "quantity": 3
        }
      ],
      "evidence": {
        "kind": "tasting",
        "ref": "tasting_1042"
      },
      "at": "2026-11-23T09:30:00.000Z",
      "quantity": -3,
      "before": 12,
      "after": 9,
      "actor": {
        "id": "key:juniper-backend"
      }
    },
    {
      "id": "mov_01M83PPH000000000000000006",
      "seq": 6,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "settle",
      "claimId": "clm_01M83PPH000000000000000002",
      "supplyId": "sup_01M83PPH000000000000000003",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000003",
          "quantity": 1
        }
      ],
      "evidence": {
        "kind": "attendance",
        "ref": "tasting_1042"
      },
      "at": "2026-11-23T09:40:00.000Z",
      "quantity": 1,
      "before": 9,
      "after": 10,
      "actor": {
        "id": "key:juniper-backend"
      }
    },
    {
      "id": "mov_01M83PPH000000000000000007",
      "seq": 7,
      "resourceId": "res_01M83PPH000000000000000003",
      "scope": {
        "holderRef": "principal:external:u_maya"
      },
      "reason": "reversal",
      "supplyId": "sup_01M83PPH000000000000000003",
      "pegs": [
        {
          "supplyId": "sup_01M83PPH000000000000000003",
          "quantity": 2
        }
      ],
      "evidence": {
        "kind": "refund",
        "ref": "refund_1042"
      },
      "at": "2026-11-23T09:45:00.000Z",
      "quantity": -2,
      "before": 10,
      "after": 8,
      "actor": {
        "id": "key:juniper-backend"
      }
    }
  ],
  "next": 7
}
```

## The MovementResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `movement` | [`Movement`](/docs/resourceshark/reference/supply.md#the-movement-object) | Always |  |

```json title="The MovementResponse object"
{
  "movement": {
    "id": "mov_01M83PPH000000000000000005",
    "seq": 5,
    "resourceId": "res_01M83PPH000000000000000003",
    "scope": {
      "holderRef": "principal:external:u_maya"
    },
    "reason": "use",
    "claimId": "clm_01M83PPH000000000000000002",
    "supplyId": "sup_01M83PPH000000000000000003",
    "pegs": [
      {
        "supplyId": "sup_01M83PPH000000000000000003",
        "quantity": 3
      }
    ],
    "evidence": {
      "kind": "tasting",
      "ref": "tasting_1042"
    },
    "at": "2026-11-23T09:30:00.000Z",
    "quantity": -3,
    "before": 12,
    "after": 9,
    "actor": {
      "id": "key:juniper-backend"
    }
  }
}
```
