Purpose
/messages/searchSearch Telegram with its native server-side message search.
Omitting `chat_id runs one messages.searchGlobal request across every accessible dialog, so broad discovery costs a single call rather than a history fetch per chat. Author filters are the exception: searchGlobal has no sender field, so they require chat_id`.
Authentication
Send a tenant API key as Authorization: Bearer <key> or X-API-Key: <key>. Keep keys server-side and use the account slug for the connected Telegram account.
Parameters
Request example
Replace the tenant, account, and resource placeholders before running this read-only request.
curl --fail-with-body \
-H "Authorization: Bearer ${DATAZ_API_KEY}" \
"https://dataz.md/gateway/v1/{tenant_slug}/accounts/{account_slug}/messages/search?limit=100"
Response schema
Response example
Representative JSON shape. The live response can include additional documented fields.
{
"results": [
{
"id": "7600000001",
"content": "Example matching message",
"type": 0,
"timestamp": "2026-05-26T18:00:00+00:00",
"channelId": "7200000001",
"chat_id": "7200000001",
"chat_name": "dataz.md Mock Group",
"matched_field": "content",
"matched_text": "Example matching message",
"matched_hidden_metadata": false,
"author": {
"id": "7400000001",
"username": "avery_mock",
"name": "Avery Mock"
}
}
],
"authors": [
{
"id": "7400000001",
"username": "avery_mock",
"name": "Avery Mock"
}
],
"scope": "chat",
"searched": [
"7200000001"
],
"coverage": {
"mode": "single_chat",
"searched_chat_count": 1,
"matched_chat_count": 1,
"skipped_chat_count": 0
},
"skipped": [],
"cursor": null,
"cursor_field": null,
"partial": false
}
Errors
Limits and pagination
- Use
limitto bound each response; it defaults to 50 and accepts 1–100. - Use
beforeto continue toward older records orafterfor incremental reads; store source IDs as cursors. - Provider or demo limits can return HTTP 429. Wait for the
Retry-Afterinterval before retrying.
Related tutorials
Read-only notes
This reference page documents a public GET endpoint. Setup/token, AI, dev, internal, and mutating routes are excluded from static reference generation.