---
title: "BatchQuery containing a set of queries to be processed"
method: POST
path: "/message/v1/batch-query"
tags: ["MessageApi"]
---

# BatchQuery containing a set of queries to be processed

`POST /message/v1/batch-query`

## Request body

- V1BatchQueryRequest
  - `requests` V1QueryRequest[]
    - `contentTopics` string[]
    - `startTimeNs` string, uint64
    - `endTimeNs` string, uint64
    - `pagingInfo` XmtpmessageApiv1PagingInfo
      - `limit` integer
      - `cursor` MessageApiv1Cursor
        - `index` V1IndexCursor
          - `digest` string, byte
          - `senderTimeNs` string, uint64
      - `direction` 'SORT_DIRECTION_UNSPECIFIED' | 'SORT_DIRECTION_ASCENDING' | 'SORT_DIRECTION_DESCENDING'

## Response `200`

A successful response.

- V1BatchQueryResponse
  - `responses` V1QueryResponse[]
    - `envelopes` V1Envelope[]
      - `contentTopic` string — The topic the message belongs to, If the message includes the topic as well it MUST be the same as the topic in the envelope.
      - `timestampNs` string, uint64 — Message creation timestamp If the message includes the timestamp as well it MUST be equivalent to the timestamp in the envelope.
      - `message` string, byte
    - `pagingInfo` XmtpmessageApiv1PagingInfo
      - `limit` integer
      - `cursor` MessageApiv1Cursor
        - `index` V1IndexCursor
          - `digest` string, byte
          - `senderTimeNs` string, uint64
      - `direction` 'SORT_DIRECTION_UNSPECIFIED' | 'SORT_DIRECTION_ASCENDING' | 'SORT_DIRECTION_DESCENDING'

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/xmtp/apis/messageapi.md) · [All operations](https://skmtc.net/xmtp/apis/messageapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xmtp/messageapi/revisions/6c9485070908/schema)
