Skip to main content
GET
/
api
/
messages
/
search
Search messages
curl --request GET \
  --url http://localhost:8080/api/messages/search \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": 123,
    "chat_id": 123,
    "bot_id": 123,
    "user_id": 123,
    "username": "<string>",
    "first_name": "<string>",
    "last_name": "<string>",
    "text": "<string>",
    "date": 123,
    "media_type": "<string>",
    "file_id": "<string>",
    "reply_to_message_id": 123
  }
]

Authorizations

Authorization
string
header
required

API key with bmx_ prefix. Obtain via /api/auth/api-keys.

Query Parameters

chat_id
integer
required

Chat ID to search in

q
string
required

Search query

Response

Matching messages

id
integer

Telegram message ID

chat_id
integer

Chat ID

bot_id
integer

Bot ID that received/sent this message

user_id
integer

Sender user ID

username
string

Sender username

first_name
string

Sender first name

last_name
string

Sender last name

text
string

Message text content

date
integer

Unix timestamp of the message

media_type
string

Media type if the message contains media (photo, video, animation, sticker, voice, audio, document, video_note)

file_id
string

Telegram file ID for media messages

reply_to_message_id
integer

ID of the message this is a reply to