RealTimeX
Start For Free

RealTimeX

API Documentation

IntroductionAuthenticationBase URLHeadersError codes
Get profileUpdate profileChange passwordList conversationsConversation metadata keysGet conversationConversation messagesUpdate conversationDelete conversationBulk delete conversationsList messagesMessage metadata keysUpdate messageDelete messageBulk delete messagesList usersUser metadata keysGet userUpdate userDelete userBulk delete users
Sample requestsSample responsesStatus codesAppendixChangelog

API Reference

Get Profile

Overview

Retrieve the authenticated client's profile from the tenant database, including name, email, slug, and account status.

Call this endpoint whenever your application needs the current client's account details — for example on settings screens, after login, or when refreshing profile UI state.

When to use this endpoint?

Use Get Profile when:

  • You need to display the client's name, email, or slug in the UI.
  • You are loading an account or settings screen after authentication.
  • You want to confirm the active client identity for the current session.
  • You need to refresh profile data after an update without relying on stale local state.
GET{baseUrl}/api/{apiVersion}/client/profile

Authentication

Required (Bearer token)

Tenant-scoped

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

Request Headers

HeaderValueDescription
AuthorizationBearer <access_token>The Access Token for the authenticated client session.
is-tenanttrueTargets the tenant DB ("true", needs x-client-id) or the root DB ("false", e.g. client register/create).
x-client-id{{clientId}}Tenant (client) id. Required when is-tenant=true. Uses the {{clientId}} variable.

Success Response (HTTP 200 OK)

When the request succeeds, the API returns the client profile for the authenticated tenant.

json
{
  "success": true,
  "message": "Profile fetched successfully",
  "data": {
    "_id": "699fe1377846dcfb775c645c",
    "name": "client pro 1",
    "email": "cilentpro1@yoopmail.com",
    "slug": "client-pro-1",
    "isActive": true,
    "metadata": {
      "industry": "fintech"
    },
    "profileImage": "https://example.com/profile.jpg",
    "coverGradient": "brand-blue",
    "createdAt": "2026-02-26T05:59:19.339Z",
    "updatedAt": "2026-02-26T05:59:20.031Z"
  },
  "error": null
}

Status Codes

CodeMeaning
200Success

Common Errors

Profile fetch fails when authentication or tenant headers are missing or invalid.

CodeReason
400 Bad RequestRequired headers are missing or invalid.
401 UnauthorizedAccess Token is missing, invalid, or expired.
500 Internal Server ErrorAn unexpected error occurred while fetching the profile.

You’re ready to continue

Use the returned profile to populate account UI, or proceed to Client → Update Profile if the client needs to change their details.

Best Practices

  • Always send a valid Bearer Access Token with is-tenant: true and x-client-id.
  • Fetch the profile after login or page refresh so the UI reflects the latest account data.
  • Prefer this endpoint over caching profile fields indefinitely — especially after Update Profile.
  • If you receive 401 Unauthorized, refresh the Access Token or redirect to Auth → Login Client.
  • Never expose the Client ID or Access Token in client-side logs or public URLs.
PreviousLogout clientNextUpdate profile

On this page

OverviewWhen to use this endpoint?Request HeadersSuccess Response (HTTP 200 OK)Status CodesCommon ErrorsBest Practices