---
title: "Query message history"
method: POST
path: "/messages/history"
tags: ["product:chat"]
---

# Query message history

`POST /messages/history`

Queries history for one message

## Request body

- QueryMessageHistoryRequest, nullable
  - `filter` object, required — Filter to apply to the query
  - `limit` integer
  - `next` string
  - `prev` string
  - `sort` SortParamRequest[] — Array of sort parameters
    - `direction` integer — Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One of: -1, 1
    - `field` string — Name of field to sort by
    - `type` string — Type of field to sort by. Empty string or omitted means string type (default). One of: number, boolean

## Response `201`

Successful response

- QueryMessageHistoryResponse, nullable
  - `duration` string, required — Duration of the request in milliseconds
  - `message_history` MessageHistoryEntryResponse[], required — Message history entries
    - `attachments` Attachment[], required
      - `actions` Action[]
        - `name` string, required
        - `style` string
        - `text` string, required
        - `type` string, required
        - `value` string
      - `asset_url` string
      - `author_icon` string
      - `author_link` string
      - `author_name` string
      - `color` string
      - `custom` object, required
      - `fallback` string
      - `fields` Field[]
        - `short` boolean, required
        - `title` string, required
        - `value` string, required
      - `footer` string
      - `footer_icon` string
      - `giphy` Images
        - `fixed_height` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
        - `fixed_height_downsampled` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
        - `fixed_height_still` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
        - `fixed_width` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
        - `fixed_width_downsampled` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
        - `fixed_width_still` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
        - `original` ImageData, required
          - `frames` string, required
          - `height` string, required
          - `size` string, required
          - `url` string, required
          - `width` string, required
      - `image_url` string
      - `og_scrape_url` string
      - `original_height` integer
      - `original_width` integer
      - `pretext` string
      - `text` string
      - `thumb_url` string
      - `title` string
      - `title_link` string
      - `type` string — Attachment type (e.g. image, video, url)
    - `custom` object, required
    - `is_deleted` boolean, required
    - `message_id` string, required
    - `message_updated_at` string, date-time, required
    - `message_updated_by_id` string, required
    - `text` string, required
  - `next` string
  - `prev` string

## Other responses

- `400` — Bad request
- `429` — Too many requests

---

[API](https://skmtc.net/getstream/apis/stream-api.md) · [All operations](https://skmtc.net/getstream/apis/stream-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getstream/stream-api/versions/3dba86aaa0d8/schema)
