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/profileAuthentication
Required (Bearer token)
Tenant-scoped
Yes (tenant DB — requires x-client-id)
Request Headers
| Header | Value | Description |
|---|---|---|
| Authorization | Bearer <access_token> | The Access Token for the authenticated client session. |
| is-tenant | true | Targets 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
| Code | Meaning |
|---|---|
| 200 | Success |
Common Errors
Profile fetch fails when authentication or tenant headers are missing or invalid.
| Code | Reason |
|---|---|
| 400 Bad Request | Required headers are missing or invalid. |
| 401 Unauthorized | Access Token is missing, invalid, or expired. |
| 500 Internal Server Error | An 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: trueandx-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.