RealTimeX
Start For Free

RealTimeX

API Documentation

IntroductionAuthenticationBase URLHeadersError codes
List usersLoginGet userUpdate userDelete userGet my profileUpdate my profileBlock / unblock
Sample requestsSample responsesStatus codesAppendixChangelog

API Reference

Get My Profile

Overview

Fetch the signed-in chat participant's own profile. The target is resolved from the Bearer token — no path id is required.

Use this to hydrate the chat shell (sidebar avatar, header name) and the in-app account / profile screen. Returns name, email, role, profile image, and online status.

When to use this endpoint?

Use Get My Profile when:

  • Showing the current participant's name and avatar in the chat UI shell.
  • Opening chat settings / “My profile” for the signed-in user.
  • Confirming the chat session still maps to a valid user after login.
  • You need your own record without passing a userId — prefer this over Get User.

Part of the Chat User APIs (not Platform client profile). Requires the chat user Bearer token and tenant headers.

Response Data

The data object typically includes:

FieldDescription
_idSigned-in user's unique id.
nameDisplay name.
emailAccount email.
roleTenant role slug for the signed-in user.
profileImageAvatar URL, or unset / null when none is stored.
isOnlineWhether the user is currently marked online.
createdAt / updatedAtISO timestamps for create and last update.
GET{baseUrl}/api/{apiVersion}/user/profile/me

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 messaging participant.
is-tenanttrueTargets the tenant DB ("true", needs x-client-id).
x-client-id{{clientId}}Tenant (client) id. Required when is-tenant=true.

Success Response (HTTP 200 OK)

On success, the API returns the signed-in user's profile.

json
{
  "success": true,
  "message": "Profile fetched successfully",
  "data": {
    "_id": "6a58...90d",
    "name": "Smith William",
    "email": "will.smith@example.com",
    "isActive": true,
    "role": "admin",
    "isOnline": false,
    "blockedUsers": [],
    "mutedUntil": null,
    "isBanned": false,
    "profileImage": "https://example.com/profile-image.png",
    "lastSeen": "2026-07-16T09:06:11.727Z",
    "createdAt": "2026-07-16T09:06:11.730Z",
    "updatedAt": "2026-07-16T09:06:12.069Z",
    "__v": 0
  },
  "error": null
}

Common Errors

Profile fetch fails when the token is missing, invalid, or expired.

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 the profile.

Best Practices

  • Call once after chat login and cache in client state; refresh after Update My Profile.
  • Fall back to initials in the chat header when profileImage is missing.
  • Do not pass a user id in the path — identity comes from the token.
  • Always send tenant headers with the chat user Bearer token over HTTPS.

Chat profile loaded

Bind name and avatar to the chat shell, then offer Update My Profile from chat settings for self edits.

PreviousDelete userNextUpdate my profile

On this page

OverviewWhen to use this endpoint?Response DataRequest HeadersSuccess ResponseCommon ErrorsBest Practices