Skip to main content
GET
Required token scopes: View all chats A filter is required - provide either botSessionId, or both beforeTime and beforeId:
  • Bot session - retrieve all messages from a specific bot session by providing botSessionId. You can obtain this ID via Search Chats or Get Chat by Chat ID - the chat object includes a botState field (and previousBotSession) where you can find the session id.
  • Before time & before ID - cursor pagination, both parameters together: the response includes messages with a timestamp up to and including beforeTime, excluding the message identified by beforeId. To page backwards through history, pass the timestamp and _id of the oldest message you already have.
All status values, type enums and the ID cheat sheet: Enums & Common Fields.

הרשאות

Authorization
string
header
נדרש

API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.

פרמטרי נתיב

chatId
string
נדרש

The unique identifier of the chat. You can obtain this value by using the Search Chats endpoint with the contact's phone number

פרמטרי שאילתה

limit
string

The maximum number of messages to return. Defaults to 50

Pattern: ^[0-9]+$
beforeTime
string

Return messages with a timestamp up to and including this value (Unix epoch milliseconds). Must be used together with beforeId

Pattern: ^[0-9]+$
beforeId
string

Message ID to exclude from the results (the cursor message). Must be used together with beforeTime

Pattern: ^[a-z0-9]+$
botSessionId
string

Return only messages within the specified bot session (the bot state ID)

Pattern: ^[a-z0-9]+$

תגובה

The matching messages plus the time range of the entire chat. Field-by-field reference: The Message object

messages
object[]
minTime

Timestamp (ms) of the first-ever message in the chat, or false if the chat has no messages

maxTime

Timestamp (ms) of the most recent message in the chat, or false if the chat has no messages