RealTimeX
Start For Free

RealTimeX

API Documentation

IntroductionAuthenticationBase URLHeadersError codes
ListPinnedStarredMentionedSearchSearch contextReport
Sample requestsSample responsesStatus codesAppendixChangelog

API Reference

Mentioned Messages

Overview

Retrieve every message across the signed-in user's conversations where they were @mentioned— the data behind a "Mentions" inbox. Unlike Pinned or Starred (which are scoped to one conversation), this spans all conversations the user belongs to.

Results are newest-first and paginated. Each item includes the sender and a light conversation reference, so you can render an inbox row and jump into the thread.

When to use this endpoint?

Use Mentioned Messages when:

  • Opening a "Mentions" inbox from the app header.
  • Showing a badge/list of messages that @mention the signed-in user across all their groups and DMs.
  • Letting the user jump from a mention to the message in context.

Membership-guarded: only conversations the user participates in are searched, so a user never sees mentions from a conversation they aren't in. Mentions are resolved server-side from the message text on send.

Response Data

Each item in data.list includes:

FieldDescription
_idMessage id — use to scroll to the message in the thread.
conversationIdPopulated conversation reference (groupName, conversationType) — label the inbox row and route to the right thread.
contentMessage text (contains the inline @Name mention). Render with your mention highlighter.
senderWho wrote it — name and image.
mentionsArray of mentioned user ids (includes the signed-in user).
createdAtISO timestamp — used for the newest-first sort.
GET{baseUrl}/api/{apiVersion}/message/mentioned-messages?page=1&limit=20

Authentication

Required (Bearer token)

Tenant-scoped

Yes (tenant DB — requires x-client-id)

Request Headers

HeaderValueDescription
AuthorizationBearer <access_token>Chat user Access Token (Bearer) for the signed-in participant.
is-tenanttrueTargets the tenant DB ("true", needs x-client-id).
x-client-id{{clientId}}Tenant (client) id. Required when is-tenant=true.

Query Parameters

ParameterRequiredExampleDescription
pageOptional11-based page number. Default 1.
limitOptional20Page size. Default 20, max 50.

Success Response (HTTP 200 OK)

Returns a list of mentioned-message summaries plus paging info (page, limit, hasMore).

json
{
  "success": true,
  "message": "Mentioned messages fetched successfully",
  "data": {
    "list": [
      {
        "_id": "6a4f...b21c",
        "conversationId": {
          "_id": "69b12d08db7dd594ba013ebc",
          "groupName": "Dev Team",
          "conversationType": "group"
        },
        "content": "Hey @Alice can you review this?",
        "type": "text",
        "sender": {
          "_id": "69a91733afd8cb7180a63fb2",
          "name": "Bob",
          "image": null
        },
        "mentions": ["69a5546ff54a9af3316020c9"],
        "createdAt": "2026-07-20T09:04:09.578Z"
      }
    ],
    "page": 1,
    "limit": 20,
    "hasMore": false
  },
  "error": null
}

Common Errors

HTTP 401 Unauthorized — No token

json
{
  "success": false,
  "message": "No token, authorization denied",
  "data": null,
  "error": "Unauthorized"
}
CodeReason
401 UnauthorizedAccess Token is missing, invalid, or expired.
500 Internal Server ErrorAn unexpected error occurred while fetching mentions.

Best Practices

  • Load when the user opens the mentions inbox; paginate with hasMore rather than fetching everything at once.
  • Render the inline @Namewith your mention highlighter so the user's own mention stands out.
  • On row tap, route to conversationId and scroll to _id.
  • Pair with the mention push notification so a new mention both notifies the user and appears here.

Mentions inbox ready

Bind the list to your mentions inbox. A ticket/row selects a conversation and jumps to the mentioned message in the thread.

PreviousStarredNextSearch

On this page

OverviewWhen to use this endpoint?Response DataRequest HeadersQuery ParametersSuccess ResponseCommon ErrorsBest Practices