---
title: "[INDEXER] Get a range of BlockEvents"
method: POST
path: "/events/blocks"
tags: ["Events"]
---

# [INDEXER] Get a range of BlockEvents

`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 — unresolved $ref
  - `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. — unresolved $ref

## Other responses

- `500` — unexpected error

## Changes

> 50 revisions in range; 1 could not be searched.

- **2020-11-05** `5d33ccb594bc` — 3 breaking, 4 info
  - added the new required request property `network_identifier`
  - the request's body type/format changed from ``/`` to `object`/``
  - the response's body type/format changed from ``/`` to `object`/`` for status `200`
  - added the new optional request property `limit`
  - …3 more
- **2020-11-05** `648a09a5adbb` — 1 info
  - endpoint added
- **2020-08-07** `97f3c6540212` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/coinbase/apis/rosetta/changes/events/blocks/post.md)

---

[API](https://skmtc.dev/coinbase/apis/rosetta.md) · [All operations](https://skmtc.dev/coinbase/apis/rosetta/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coinbase/rosetta/revisions/758497aacc08/schema)
