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

# Linking Users

Accurate attribution requires connecting user activity across logged-out and logged-in states. Topsort provides API tools to solve this issue, enabling you to link two opaque user IDs.

### How It Works

Users often interact with ads while logged out (e.g., `user_id` = 123) and later, they log in, gaining a distinct user ID (e.g., `user_id` = 456). Without linking these IDs, activities from the logged-out session are disconnected from post-login actions, leading to inaccurate attribution.

![Diagram of API Link Users API.](https://mintcdn.com/topsort/JfdWUceY7Se3NW-0/images/knowledge-base/ad-server-attribution-linking-users-diagram.webp?fit=max\&auto=format\&n=JfdWUceY7Se3NW-0\&q=85\&s=a95bf07d341eb22f45e41d5da682c819)

Our [Link Users API](http://api.docs.topsort.com/api-reference/events/\[beta]-report-link-users#beta-report-link-users) enables you to inform Topsort that two opaque user IDs belong to the same person. Improving attribution accuracy. Required fields to use our API:

<table><tbody><tr><td>**Field**</td><td>**Type**</td><td>**Required**</td><td>**Description**</td></tr><tr><td>**`from`**</td><td>**STRING**</td><td>yes</td><td>The original (e.g., logged-out) opaque user ID. (1-64 chars)</td></tr><tr><td>**`to`**</td><td>**STRING**</td><td>yes</td><td>The target (e.g., logged-in) opaque user ID. (1-64 chars)</td></tr></tbody></table>

> [!NOTE]
>
> `from` and `to` IDs must not be identical.

***

**Last updated:** 
<time dateTime="2025-11-18">2025-11-18</time>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.