---
title: "getEventsBlocks"
method: POST
path: "/events/blocks"
tags: ["Cardano - Rosetta"]
---

# getEventsBlocks

`POST /events/blocks`

`/events/blocks` allows the caller to query a sequence
of BlockEvents indicating which blocks were added and
removed from storage to reach the current state.
Following BlockEvents allows lightweight clients to update
their state without needing to implement their own syncing
logic (like finding the common parent in a reorg).

`/events/blocks` is considered an "indexer" endpoint
and Rosetta implementations are not required to complete it
to adhere to the Rosetta spec. However, any Rosetta "indexer"
MUST support this endpoint.

## Request body

- EventsBlocksRequest — EventsBlocksRequest is utilized to fetch a sequence of BlockEvents indicating which blocks were added and removed from storage to reach the current state.
  - `network_identifier` NetworkIdentifier, required — The network_identifier specifies which network a particular object is associated with.
    - `blockchain` string, required
    - `network` string, required — If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.
    - `sub_network_identifier` SubNetworkIdentifier — In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
      - `network` string, required
      - `metadata` object
  - `offset` integer — offset is the offset into the event stream to sync events from. If this field is not populated, we return the limit events backwards from tip. If this is set to 0, we start from the beginning.
  - `limit` integer — limit is the maximum number of events to fetch in one call. The implementation may return <= limit events.

## Response `200`

Expected response to a valid request

- EventsBlocksResponse — EventsBlocksResponse contains an ordered collection of BlockEvents and the max retrievable sequence.
  - `max_sequence` integer, required — max_sequence is the maximum available sequence number to fetch.
  - `events` BlockEvent[], required — events is an array of BlockEvents indicating the order to add and remove blocks to maintain a canonical view of blockchain state. Lightweight clients can use this event stream to update state without implementing their own block syncing logic.
    - `sequence` integer, required — sequence is the unique identifier of a BlockEvent within the context of a NetworkIdentifier.
    - `block_identifier` BlockIdentifier, required — The block_identifier uniquely identifies a block in a particular network.
      - `index` integer, required — This is also known as the block height.
      - `hash` string, required — This should be normalized according to the case specified in the block_hash_case network options.
    - `type` 'block_added' | 'block_removed', required — BlockEventType determines if a BlockEvent represents the addition or removal of a block.

## Other responses

- `500` — unexpected error

---

[API](https://skmtc.net/tatum/apis/blockchain-data.md) · [All operations](https://skmtc.net/tatum/apis/blockchain-data/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tatum/blockchain-data/versions/8622ee4b8fae/schema)
