> ## Documentation Index
> Fetch the complete documentation index at: https://docs.collab-kit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get User by Custom ID

> Look up a user using their custom identifier.

Retrieve user details by the optional `custom_id` set during user creation, instead of the internal UUID.

## Endpoint

```
GET /v1/accounts/:accountId/users/custom/:customId
```

## Authentication

**Bearer token** required.

## Path Parameters

<ParamField path="customId" type="string" required>
  The custom identifier assigned when the user was created.
</ParamField>

## Query Parameters

<ParamField query="roomId" type="string" required>
  The room ID the user belongs to. Required to route the request to the correct Durable Object.
</ParamField>

## Response

Returns the same response format as [Get User](/api-reference/users/get-user).

<ResponseField name="user" type="CollabKitUser">
  The user object. See [`CollabKitUser`](/types/core#collabkituser).
</ResponseField>

<ResponseField name="sessions" type="CollabKitUserSession[]">
  The user's session history. See [`CollabKitUserSession`](/types/core#collabkitusersession).
</ResponseField>

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.collab-kit.com/v1/accounts/${ACCOUNT_ID}/users/custom/alice-001?roomId=c3003c93-60cf-4184-b85f-20be14d26dac" \
    -H "Authorization: Bearer ${TOKEN}"
  ```

  ```typescript JavaScript theme={null}
  const res = await fetch(
    `https://api.collab-kit.com/v1/accounts/${accountId}/users/custom/alice-001?roomId=${roomId}`,
    { headers: { 'Authorization': `Bearer ${token}` } }
  );
  const { data } = await res.json();
  console.log(data.user, data.sessions);
  ```
</CodeGroup>

```json Response theme={null}
{
  "type": "response",
  "success": true,
  "description": "User retrieved",
  "data": {
    "user": {
      "id": "f47ac10b-58cc-4372-...",
      "room_id": "c3003c93-...",
      "name": "Alice",
      "profile_picture": "https://example.com/alice.png",
      "custom_id": "alice-001",
      "status": "online",
      "created_at": "2026-05-29T10:05:00.000Z",
      "joined_at": "2026-05-29T10:06:00.000Z",
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    },
    "sessions": [
      {
        "id": "sess_001",
        "user_id": "f47ac10b-58cc-4372-...",
        "room_id": "c3003c93-...",
        "joined_at": "2026-05-29T10:06:00.000Z",
        "left_at": null
      }
    ]
  },
  "error": null
}
```

<Note>
  If no user matches the given `customId` within the specified room, the API returns a `404 NOT_FOUND` error.
</Note>
