API Reference
Update My Profile
Overview
Partially update the signed-in chat participant's own profile. Identity comes from the Bearer token — no path id is required.
Editable fields:
nameprofileImagemetadata
Provide at least one of name or profileImage. Use this from chat settings for display name and avatar. For another user's email or role, use Update User. For Platform client branding, use Platform → Update Profile.
When to use this endpoint?
Use Update My Profile when:
- The chat participant renames themselves in settings (
nameonly). - They change their chat avatar URL (
profileImageonly). - They store chat preferences in metadata (theme, locale, and so on).
- Chat settings saves several of the fields above in one request.
Part of the Chat User APIs. An empty body or a body without name / profileImage returns 400.
Editable Fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | New display name. At least one of name or profileImage must be present. |
| profileImage | string | null | Optional | Avatar image URL. Send null to clear if supported by your client. |
| metadata | object | Optional | Arbitrary key-value map for preferences and app-specific data. |
Single-Field Updates
Examples for updating one concern at a time:
Name only
{
"name": "New Name"
}Profile image only
{
"profileImage": "https://example.com/profile-image.png"
}Metadata (with a name or image also required by validation)
{
"metadata": {
"theme": "dark"
}
}{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. |
| Content-Type | application/json | JSON request body. |
Request Payload
Combined example updating name, avatar, and metadata:
{
"name": "New Name",
"profileImage": "https://example.com/profile-image.png",
"metadata": {
"theme": "dark"
}
}Success Response (HTTP 200 OK)
On success, the API returns the updated profile summary.
{
"success": true,
"message": "Profile updated successfully",
"data": {
"_id": "6a58...90d",
"name": "New Name",
"email": "will.smith@example.com",
"role": "user",
"profileImage": "https://example.com/profile-image.png"
},
"error": null
}Common Errors
Profile update fails when nothing is provided to update or the token is missing.
HTTP 400 Bad Request — Nothing to update
{
"success": false,
"message": "Provide at least one of: name, profileImage",
"data": null,
"error": null
}HTTP 401 Unauthorized — No token
{
"success": false,
"message": "No token, authorization denied",
"data": null,
"error": "Unauthorized"
}| Code | Reason |
|---|---|
| 400 Bad Request | Provide at least one of name or profileImage. |
| 401 Unauthorized | Access Token is missing, invalid, or expired. |
| 500 Internal Server Error | An unexpected error occurred while updating the profile. |
Best Practices
- Upload the avatar to storage first, then send the public URL as
profileImage. - Prefer single-field saves from chat settings for clearer UX.
- Refresh the chat shell avatar and name from the success response.
- Always send tenant headers with the chat user Bearer token over HTTPS.
Chat profile updated
Update the chat header and sidebar from the response, or call Get My Profile again if your client prefers a separate reload.