---
title: "Blocks queries the blocks for the given user, if provided. Otherwise, it queries all the stored blocks."
method: GET
path: "/desmos/relationships/v1/blocks"
tags: ["Query"]
---

# Blocks queries the blocks for the given user, if provided. Otherwise, it queries all the stored blocks.

`GET /desmos/relationships/v1/blocks`

## Request

- The document declares no server URL.
- Auth: none declared

## Query parameters

- `subspace_id` string, uint64
- `blocker` string
- `blocked` string
- `pagination.key` string, byte
- `pagination.offset` string, uint64
- `pagination.limit` string, uint64
- `pagination.count_total` boolean
- `pagination.reverse` boolean

## Response `200`

A successful response.

- object: QueryBlocksResponse is the response type for the Query/Blocks RPC method.
  - `blocks` object[]
    - `blocker` string
    - `blocked` string
    - `reason` string: Reason represents the optional reason the user has been blocked for.
    - `subspace_id` string, uint64
  - `pagination` object: PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest. message SomeResponse { repeated Bar results = 1; PageResponse page = 2; }
    - `next_key` string, byte: next_key is the key to be passed to PageRequest.key to query the next page most efficiently. It will be empty if there are no more results.
    - `total` string, uint64

## Other responses

- `default`: An unexpected error response.

## Changes

- **2022-03-15** `019f36a11119`: 1 info
  - endpoint added
- **2021-05-26** `15d942913861`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/desmos-labs/apis/desmos-rest-and-grpc-gateway-docs/changes/desmos/relationships/v1/blocks/get.md)

---

[API](https://skmtc.dev/desmos-labs/apis/desmos-rest-and-grpc-gateway-docs.md) - [All operations](https://skmtc.dev/desmos-labs/apis/desmos-rest-and-grpc-gateway-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/desmos-labs/apis/desmos-rest-and-grpc-gateway-docs/revisions/054f23b65d20?raw)
