> ## Documentation Index
> Fetch the complete documentation index at: https://docs.derive.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# private/get_room_messages

> Returns a chat room's history, newest first, without messages removed by moderators. Each message shows its sender's username, never a wallet address. The caller must be allowed to join the room (see private/get_chat_rooms): a banned wallet gets chat_banned (15000), a wallet whose account is disabled gets account_disabled (16001), and a wallet without a fee tier gets chat_room_not_allowed (15001) for fee_tier. from_timestamp and to_timestamp (ms, both inclusive) bound the creation time, and page_size (default 100, at most 1000) caps the page. Without from_timestamp, the window is the 30 days before to_timestamp, or before now. To page back, pass the oldest creation_timestamp received as to_timestamp and de-duplicate by message_id. To look back more than 30 days from to_timestamp, also pass from_timestamp. Messages are deleted 90 days after they are sent.



## OpenAPI

````yaml /openapi.json post /private/get_room_messages
openapi: 3.1.0
info:
  title: Derive v3 API
  version: 0.2.0
  description: JSON-RPC 2.0 methods, served over WebSocket and HTTP POST.
servers:
  - url: https://api.derive.xyz/v3
    description: Production (HTTP POST base)
  - url: https://testnet.api.derive.xyz/v3
    description: Testnet (HTTP POST base)
security: []
tags:
  - name: Subaccounts
    description: >-
      List, inspect, and label subaccounts, portfolios, positions, and
      collateral.
  - name: Session Keys
    description: Register, edit, and list delegated signing keys.
  - name: Account
    description: Wallet-level account information and settings.
  - name: Orderbook
    description: Place, replace, cancel, and query orders, trigger orders, and algos.
  - name: RFQ
    description: 'Request-for-quote: send RFQs, quote, and execute block trades.'
  - name: Liquidations
    description: >-
      Open a Dutch auction against a breaching subaccount, quote the auctions
      running right now, bid on them, and review past ones.
  - name: Vault Shareholders
    description: >-
      Deposit into and withdraw from vaults, and track shares, requests, and
      performance.
  - name: Vault Curators
    description: >-
      Create and operate curated vaults: settle deposit and withdrawal requests,
      and manage vault metadata.
  - name: History
    description: >-
      Per-account historical records: orders, trades, transfers, and
      settlements.
  - name: Market Maker Protection
    description: Configure, read, and reset market-maker protection.
  - name: Transfers & Withdrawals
    description: Move collateral between subaccounts, to other wallets, and on-chain.
  - name: Onchain Actions
    description: >-
      L1 onchain actions submitted via OnchainActionManager: register deposit
      addresses, list pending deposits, and inspect onchain action history.
  - name: System
    description: Rate limits, transaction lookups, and live incidents.
  - name: Market Data
    description: Instruments, currencies, tickers, and market-wide feeds.
  - name: Maker Scoring
    description: Maker programs, score breakdowns, and detailed scoring snapshots.
  - name: Referrals
    description: Referral codes and program performance.
  - name: Chat
    description: Anonymous chat rooms and conversations with the concierge.
  - name: Other
    description: Uncategorized.
paths:
  /private/get_room_messages:
    post:
      tags:
        - Chat
      summary: private/get_room_messages
      description: >-
        Returns a chat room's history, newest first, without messages removed by
        moderators. Each message shows its sender's username, never a wallet
        address. The caller must be allowed to join the room (see
        private/get_chat_rooms): a banned wallet gets chat_banned (15000), a
        wallet whose account is disabled gets account_disabled (16001), and a
        wallet without a fee tier gets chat_room_not_allowed (15001) for
        fee_tier. from_timestamp and to_timestamp (ms, both inclusive) bound the
        creation time, and page_size (default 100, at most 1000) caps the page.
        Without from_timestamp, the window is the 30 days before to_timestamp,
        or before now. To page back, pass the oldest creation_timestamp received
        as to_timestamp and de-duplicate by message_id. To look back more than
        30 days from to_timestamp, also pass from_timestamp. Messages are
        deleted 90 days after they are sent.
      operationId: private_get_room_messages
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetRoomMessagesParams'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRoomMessagesResponse'
        default:
          description: JSON-RPC error (see Error Codes)
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    $ref: '#/components/schemas/RPCError'
      security:
        - DeriveWallet: []
          DeriveTimestamp: []
          DeriveSignature: []
components:
  schemas:
    GetRoomMessagesParams:
      type: object
      required:
        - room
        - wallet
      properties:
        from_timestamp:
          description: >-
            Oldest creation timestamp to include, in ms. Defaults to 30 days
            before the earlier of `to_timestamp` and now. Messages are deleted
            90 days after they are sent.
          default: null
          type:
            - integer
            - 'null'
          format: int64
        page_size:
          description: 'Messages to return, newest first: 1 to 1000.'
          default: 100
          type: integer
          format: uint
          minimum: 0
        room:
          $ref: '#/components/schemas/ChatRoom'
        to_timestamp:
          description: Newest creation timestamp to include, in ms.
          default: 9223372036854776000
          type: integer
          format: int64
        wallet:
          description: The session's wallet.
          type: string
    GetRoomMessagesResponse:
      type: object
      required:
        - messages
      properties:
        messages:
          description: Newest first.
          type: array
          items:
            $ref: '#/components/schemas/RoomMessage'
    RPCError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int64
        data:
          type:
            - string
            - 'null'
        message:
          type: string
    ChatRoom:
      description: >-
        Every wallet not banned from chat may join `general`; `fee_tier` also
        needs a fee tier.
      type: string
      enum:
        - general
        - fee_tier
    RoomMessage:
      type: object
      required:
        - creation_timestamp
        - message_id
        - room
        - text
        - username
      properties:
        creation_timestamp:
          type: integer
          format: int64
        message_id:
          description: UUID v4 string
          type: string
          format: uuid
        room:
          $ref: '#/components/schemas/ChatRoom'
        text:
          type: string
        username:
          type: string
  securitySchemes:
    DeriveWallet:
      type: apiKey
      in: header
      name: X-DeriveWallet
      description: The wallet the request acts for.
    DeriveTimestamp:
      type: apiKey
      in: header
      name: X-DeriveTimestamp
      description: The current time in milliseconds, as a decimal string.
    DeriveSignature:
      type: apiKey
      in: header
      name: X-DeriveSignature
      description: >-
        EIP-191 signature of the timestamp, by the wallet or one of its session
        keys.

````

## Related topics

- [Changelog](https://docs.derive.xyz/changelog.md)
- [Error Codes](https://docs.derive.xyz/error-codes.md)
- [private/send_room_message](https://docs.derive.xyz/api-reference/chat/privatesend_room_message.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.