---
title: "MessageQueryInput"
description: "The input fields to query a list of messages."
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/storefront-api/message/inputs/message-query-input'
  md: 'https://developer.shopline.com/docs/storefront-api/message/inputs/message-query-input.md'
---
# MessageQueryInput

The input fields to query a list of messages.

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Input

## Input Fields

* `conversationId`

  [ID!](https://developer.shopline.com/docs/storefront-api/common/scalars/id.md)

  Conversation ID, which is returned by successfully calling the [conversationCreate](https://developer.shopline.com/docs/storefront-api/message/mutations/conversation-create.md) mutation.

* `pageSize`

  [Int](https://developer.shopline.com/docs/storefront-api/common/scalars/int.md)

  Page size.
  <br/>Default value: `10`

* `messageId`

  [ID](https://developer.shopline.com/docs/storefront-api/common/scalars/id.md)

  Message ID acting as a pagination cursor in conjunction with `createAt`. When `createAt` values are identical, this field is used to retrieve messages with IDs greater than or less than this value.

* `createAt`

  [Date](https://developer.shopline.com/docs/storefront-api/common/scalars/date.md)

  Message creation time. Format: [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html). If this field is not passed in, query is perfomed based on the current time.

* `direction`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Query direction. Valid values are:
  -  `up`: Queries messages whose IDs are greater than the current `messageId` or those created later than the current `createAt`.
  -  `down`: Queries messages whose IDs are less than the current `messageId` or those created earlier than the current `createAt`.

## Argument from

* [Query](https://developer.shopline.com/docs/storefront-api/message/queries/message-query.md).messageQuery

