---
title: "Get on-chain status"
method: GET
path: "/on-chain/status/{agent_id}"
tags: ["On-Chain"]
---

# Get on-chain status

`GET /on-chain/status/{agent_id}`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/on-chain/status/{agent_id}`
- Auth: none required

Get the current on-chain anchoring status for an agent. Returns the most recent anchor, pending publications, and overall on-chain coverage statistics.

## Path parameters

- `agent_id` string, required

## Response `200`

On-chain status for the agent, as assembled by the get_on_chain_status RPC (migrations 057/058): the agent's latest score publication, the latest confirmed anchor, and the agent's current Merkle-tree summary. Each of the three nested objects is `null` when no matching row exists.

- object
  - `agent_id` string, required
  - `latest_score_publication` object, nullable: The agent's most recent row in score_publications, or `null` when the agent has never been published.
    - `id` string
    - `score` integer
    - `grade` string
    - `tx_hash` string, nullable
    - `block_number` integer, nullable
    - `chain` 'base-sepolia' | 'base'
    - `status` 'pending' | 'confirmed' | 'failed'
    - `published_at` string, date-time
  - `latest_anchor` OnChainAnchorResult: An on-chain Merkle-root anchoring record — a row from the `on_chain_anchors` table (migration 057). Returned by GET /on-chain/history (raw row, all columns) and embedded as `latest_anchor` in GET /on-chain/status (subset via the get_on_chain_status RPC, which omits gas_used/created_at).
    - `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).
  - `merkle_tree` object, nullable: Summary of the agent's current Merkle tree (from agent_merkle_trees), or `null` when the agent has no tree.
    - `merkle_root` string, nullable
    - `leaf_count` integer, nullable
    - `tree_depth` integer, nullable
    - `updated_at` string, date-time, nullable

## 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)
