---
title: "Get on-chain history"
method: GET
path: "/on-chain/history"
tags: ["On-Chain"]
---

# Get on-chain history

`GET /on-chain/history`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/on-chain/history`
- Auth: none required

Retrieve the history of on-chain Merkle root anchoring events. Returns a paginated list of all anchors with their transaction details, included agents, and verification status.

## Query parameters

- `chain` 'base-sepolia' | 'base'
- `agent_id` string
- `from` string, date-time
- `to` string, date-time
- `limit` integer
- `offset` integer

## Response `200`

On-chain anchoring history: the page of anchor rows plus the effective `limit`/`offset` echoed back by the handler (handleGetAnchoringHistory in src/on-chain/handlers.ts).

- object
  - `anchors` OnChainAnchorResult[], required
    - `id` string: Anchor record identifier (`oca-<uuid>`).
    - `merkle_root` string: Hex-encoded Merkle root hash that was anchored
    - `tx_hash` string, nullable: Blockchain transaction hash. Null while the anchor is pending (recorded before the transaction is broadcast).
    - `block_number` integer, nullable: Block number in which the transaction was included. Null until the anchor is confirmed on-chain.
    - `leaf_count` integer: Number of leaves covered by this anchor.
    - `tree_depth` integer: Depth of the Merkle tree.
    - `gas_used` integer, nullable: Gas consumed by the anchoring transaction. Null until the transaction is broadcast/confirmed.
    - `chain` 'base-sepolia' | 'base': Blockchain network where the anchor was created. Matches the on_chain_anchors.chain CHECK constraint; defaults to `base-sepolia`.
    - `status` 'pending' | 'confirmed' | 'failed': Lifecycle status of the anchor record.
    - `anchored_at` string, date-time: Timestamp when the anchor was created
    - `created_at` string, date-time: Row creation timestamp (present on raw history rows).
  - `limit` integer: Effective page size applied to this response.
  - `offset` integer: Effective offset applied to this response.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
