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

# User-Scoped Conversations

> Associate multiple conversations with a single end user using `user_id` in Rasa Pro.

## Providing User IDs

The `user_id` must be included in the message payload metadata sent from your frontend to Rasa's input channel:

```json theme={null}
{
  "sender": "conversation_12345",
  "message": "Hello",
  "metadata": {
    "user_id": "usr_a1b2c3d4e5f6"
  }
}
```

**Important Security Note**: For data protection, `user_id` should be a random, non-sensitive identifier (such as a UUID). Do not use personally identifiable information like email addresses, phone numbers, or names, as `user_id` values may appear in logs.

The `user_id` is persisted in all supported [tracker stores](/docs/reference/integrations/tracker-stores) ([InMemory](/docs/reference/integrations/tracker-stores#user-scoped-querying), [SQL](/docs/reference/integrations/tracker-stores#user-scoped-querying-1), [Redis](/docs/reference/integrations/tracker-stores#user-scoped-querying-2), [Mongo](/docs/reference/integrations/tracker-stores#user-scoped-querying-3) and [Dynamo](/docs/reference/integrations/tracker-stores#user-scoped-querying-4)).
If `user_id` is `null`, it is omitted from the serialized tracker JSON.

The tracker's current state also includes `user_id`:

```json theme={null}
{
  "sender_id": "conversation_12345",
  "user_id": "usr_a1b2c3d4e5f6",
  "current_session_id": "4b3c1e2a-91f0-4d8e-b123-abc123def456",
  "events": [...]
}
```

### `user_id` in event broker payloads

Every event streamed to an event broker now includes `user_id` alongside `sender_id`:

```json theme={null}
{
  "sender_id": "conversation_12345",
  "user_id": "usr_a1b2c3d4e5f6",
  "event": "user",
  "text": "Hello"
}
```

This allows downstream consumers (analytics pipelines, data warehouses, CRMs) to group events by user without additional joins.

## Retrieving Conversations by User

Once `user_id` is set, you can retrieve all conversations for that user via the [tracker API endpoint](/docs/reference/api/pro/http-api/tracker/retrieve-all-conversations-for-a-user)(`GET /users/{user_id}/trackers`).
The endpoint returns serialized tracker data — including events — read directly from storage without replaying conversation history through `DialogueStateTracker`. Call it on the server-side and expose only what the client needs.
This powers use cases like conversation history lists, support dashboards, and "resume a past session" flows.

<Note>
  **current\_session\_id in responses**

  The `current_session_id` field in each returned tracker is derived from the metadata of the last stored event. It is `null` when the last event is `ConversationInactive`, correctly reflecting that no active session exists at the time of the request.
</Note>

## Backward Compatibility

To support user-scoped tracker querying, you must implement the `get_trackers_by_user_id()` method in your custom tracker store. This method enables efficient retrieval of all conversations for a specific user with pagination and ordering support.
More details can be found in the [Rasa Pro Migration Guide](/docs/reference/changelogs/rasa-pro-migration-guide#4-implement-get_serialized_trackers_by_user_id-method).


## Related topics

- [Tracker Stores](/docs/reference/integrations/tracker-stores.md)
- [Retrieve all conversations for a user](/docs/reference/api/pro/http-api/tracker/retrieve-all-conversations-for-a-user.md)
- [Rasa Pro Change Log](/docs/reference/changelogs/rasa-pro-changelog.md)
- [Conversation Review](/docs/studio/build/content-management/conversation-review.md)
