# Get user

Get one trader's name, username, email, avatar, online status and last sign-in, by their internal record ID or email.

- Endpoint: `GET https://api.returning.ai/v1/communities/{communityId}/users/{userId}`
- Section: Community / Members
- Authentication: `Authorization: Bearer <API_KEY>` (Community API key)
- Permission: `None` (Any Community API key for this community works)
- Retries: Read-only; exact retries are safe
- Guide: hand-written
- Verified: live, 2026-09-27
- Last updated: 26 Sep 2026
- Web page: https://docs.returning.ai/api-reference/community-community-users/get-user

## When to use this

- You have a trader's internal record ID or email and want their public profile for your own tools.
- You want to know whether a trader is online right now, or when they last signed in.
- You want only a few profile fields, such as the email and platform user ID.

**Instead:** Use [Get User Data](https://docs.returning.ai/api-reference/users/get-user-data.md) instead when you have the platform user ID or a broker identifier, or when you need roles, XP, coins or custom fields.

## Authentication

- Header: `Authorization: Bearer <API_KEY>`
- Permission: `None`

Send a Community API key as `Authorization: Bearer <API_KEY>`, and keep it on your server. No specific permission is needed, so any key for your community works. `communityId` in the path must be the community that owns your key; another community's ID returns `401`.

## Behaviour

`userId` is matched as an internal record ID when it looks like one, and as an email otherwise. Email matching ignores case. Usernames and platform user IDs don't match, so they return `404`.

A deleted trader is still returned here. Get User Data returns `404` for the same trader, so use it when you need to know whether an account is still active. Profile changes can take a short time to show.

Any query parameter switches the response to field selection: only the fields you set to `true` come back. A parameter that isn't a field name, such as `page=1`, or a field set to `false`, returns `200` with an empty `data` object. To get every field, send no query string.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `communityId` | `string` | Yes | Your community's ID. Use the community that owns your API key. (24 hex characters) |
| `userId` | `string` | Yes | The trader's internal record ID (`_id`), or their email. A platform user ID or a username returns `404`. (Record ID or email) |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `_id` | `boolean` | No | Send `true` to include `_id`. Sending any query parameter returns only the fields set to `true`. |
| `id` | `boolean` | No | Send `true` to include `id`, the platform user ID. |
| `avatar` | `boolean` | No | Send `true` to include `avatar`. |
| `displayName` | `boolean` | No | Send `true` to include `displayName`. |
| `username` | `boolean` | No | Send `true` to include `username`. |
| `firstName` | `boolean` | No | Send `true` to include `firstName`. |
| `lastName` | `boolean` | No | Send `true` to include `lastName`. |
| `email` | `boolean` | No | Send `true` to include `email`. |
| `isOnline` | `boolean` | No | Send `true` to include `isOnline`. |
| `lastLogin` | `boolean` | No | Send `true` to include `lastLogin`. |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | Yes | Community API key. No specific permission is needed. (`Bearer <API_KEY>`) |

### Example request

```bash
curl --request GET \
  --url 'https://api.returning.ai/v1/communities/66f000000000000000000010/users/<userObjectId>' \
  --header 'Authorization: Bearer <API_KEY>'
```

## Response

A `200` returns one trader in `data`, not a list. `meta` has only `status` and `statusCode`.

### Response fields

| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `meta` | `object` | always | - |
| `meta.status` | `string` | always | - |
| `meta.statusCode` | `integer` | always | - |
| `message` | `string` | always | Human-readable summary. Do not branch on it. |
| `data` | `object` | always | The trader. Without query parameters it has all ten fields; with them, only the fields set to `true`. |
| `data._id` | `string` | - | The trader's internal record ID. |
| `data.id` | `number` | - | The trader's platform user ID, as a number here. Store it as a string. |
| `data.avatar` | `string` | - | Avatar image URL, or `null`. (Nullable) |
| `data.displayName` | `string` | - | Public display name. |
| `data.username` | `string` | - | Username. |
| `data.firstName` | `string` | - | First name, or `********` when the trader's privacy settings hide it. |
| `data.lastName` | `string` | - | Last name, or `********` when hidden. |
| `data.email` | `string` | - | Email, or `********` when hidden. |
| `data.isOnline` | `boolean` | - | `true` while the trader is online. |
| `data.lastLogin` | `string` | - | When the trader last signed in. (Date-time) |

### Example response (200)

```json
{
  "meta": {
    "status": "success",
    "statusCode": 200
  },
  "message": "Get user success.",
  "data": {
    "_id": "<userObjectId>",
    "id": 3247779,
    "avatar": null,
    "displayName": "Sample Trader",
    "username": "sample_trader",
    "firstName": "Sample",
    "lastName": "Trader",
    "email": "trader@example.com",
    "isOnline": false,
    "lastLogin": "2026-09-26T08:30:00.000Z"
  }
}
```

## Errors

Errors on this endpoint have no machine-readable code; branch on the HTTP status and read `detail`. Without an `Authorization` header the `401` body is not JSON.

### Fix the request

| Status | Code | What to do |
| --- | --- | --- |
| 400 | - | `communityId` isn't a 24-character hex ID. `detail.communityId` says `Community ID is required` even when you sent a value. |
| 401 | - | The key is missing or invalid (`Token is wrong.`), or `communityId` isn't the community that owns your key (`User can only get your own information!`). Send a current key and your own community's ID. |

### Fix the data

| Status | Code | What to do |
| --- | --- | --- |
| 404 | - | No trader matches `userId`. Send the internal record ID or the email; for a platform user ID, use [Get User Data](https://docs.returning.ai/api-reference/users/get-user-data.md). |

### Retry with backoff

| Status | Code | What to do |
| --- | --- | --- |
| 500 | - | The read failed unexpectedly. Retry the same request with exponential backoff. |

**Retries:** This endpoint is read-only, so retrying the exact same request is safe after a network error or a `500`. Use bounded exponential backoff, and don't retry a `400`, `401` or `404` without changing the request. Over the [rate limit](https://docs.returning.ai/how-it-works.md#rate-limits), requests return `429`; wait for the window to reset, then retry.

## Next step

- [Get User Data](https://docs.returning.ai/api-reference/users/get-user-data.md): `POST /v1/users/info`. Read the same trader in full, including roles, XP, coins and custom fields, and check that the account is still active.
- [List traders with Get community users](https://docs.returning.ai/api-reference/community-community-users/get-community-users.md): `GET /v1/communities/{communityId}/users`.
