# Chat API: page\_size parameter is ignored when direction=past

**URL:** https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984
**Category:** Bug
**Tags:** chat, rest-api
**Created:** [August 2, 2025, 9:50am UTC](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984 "2025-08-02T09:50:52Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Nima1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nima1/32/299628_2.png) [@Nima1](https://meta.discourse.org/u/Nima1)
#### Post date: [August 6, 2025, 10:41am UTC](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984/4 "2025-08-06T10:41:11Z")

</div>

Thanks for looking into this.

My apologies, I forgot to mention a crucial detail: this issue only occurs in channels with **threading enabled**. That’s likely why you couldn’t replicate it.

The `page_size` parameter is ignored when I fetch messages from a specific thread. For example, when I use this endpoint with `page_size=5`:

`/chat/api/channels/64/threads/1526/messages?target_message_id=19205&page_size=5`

The API returns the default 50 messages instead of the requested 5, even though plenty of messages are available in the thread. It seems the problem is specific to the threads API endpoint.

---

_[View the full topic](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984)._
