---
title: "Fetch a window of chatroom messages around one message id (for jump-to)."
method: POST
path: "/v1/get_chatroom_messages_around"
tags: ["Chatrooms"]
---

# Fetch a window of chatroom messages around one message id (for jump-to).

`POST /v1/get_chatroom_messages_around`

## Request

- Base URL: `https://partner.mindupload.app`
- URL: `https://partner.mindupload.app/v1/get_chatroom_messages_around`
- Auth: API key in header `X-Partner-Key`

Load a contiguous window of chatroom messages around `message_id` so a client can jump from a find hit into the live timeline. `before` and `after` cap how many neighbors are returned on each side of the anchor.

## Request body

- object
  - `preferred_language` string, nullable: BCP-47-ish language code (e.g. 'en', 'zh-cn') for localized messages.
  - `username` string, required: The end-user's username.
  - `password` string, required: The end-user's password on first sign-in. After login/register, send the returned session token (JWT) here instead — the field accepts either, and reusing the token keeps raw passwords out of your storage.
  - `chatroom_id` string, required: Chatroom id as returned by chatroom operations.
  - `message_id` string, required: Chatroom message id.
  - `before` integer: How many earlier neighbors to include around the anchor id.
  - `after` integer: How many later neighbors to include around the anchor id.

## Response `200`

Result envelope — check the success field.

- object
  - `success` boolean: Whether the call succeeded.
  - `error_message` string, nullable: Human-readable reason when success is false.
  - `error_code` string
  - `messages` object[], nullable: Chatroom messages returned by this operation.
  - `media_thumbnails` object, nullable: Mapping from an external media URL in a result to its preferred display URL (normally a retained thumbnail).
  - `media_fallbacks` object, nullable: Mapping from a provably expired signed image URL to a safe legacy display candidate.
  - `anchor_message_id` string, nullable: Echo of the chatroom message id the window is centered on.

## Other responses

- `400`: Invalid request payload.
- `401`: Missing or invalid partner key.
- `403`: Partner is not authorized for this operation.
- `404`: The anchor message is gone — deleted, or not part of this chatroom. Show the reader that the message no longer exists rather than retrying.
- `429`: Rate limit exceeded — retry later.
- `500`: Internal server error.

---

[API](https://skmtc.dev/mindupload/apis/mind-upload-partner-api.md) · [All operations](https://skmtc.dev/mindupload/apis/mind-upload-partner-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mindupload/apis/mind-upload-partner-api/revisions/0371bdf78533?raw)
