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:
| Field | Description |
|---|---|
| _id | Signed-in user's unique id. |
| name | Display name. |
| Account email. | |
| role | Tenant role slug for the signed-in user. |
| profileImage | Avatar URL, or unset / null when none is stored. |
| isOnline | Whether the user is currently marked online. |
| createdAt / updatedAt | ISO timestamps for create and last update. |
{baseUrl}/api/{apiVersion}/user/profile/meAuthentication
Required (Bearer token)
Tenant-scoped
Yes (tenant DB — requires x-client-id)
Request Headers
| Header | Value | Description |
|---|---|---|
| Authorization | Bearer <access_token> | Chat user Access Token (Bearer) for the signed-in messaging participant. |
| is-tenant | true | Targets 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.
{
"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
{
"success": false,
"message": "No token, authorization denied",
"data": null,
"error": "Unauthorized"
}| Code | Reason |
|---|---|
| 401 Unauthorized | Access Token is missing, invalid, or expired. |
| 500 Internal Server Error | An 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
profileImageis 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.