# Third-Party App - Managed User Session Attribution via Public API

**URL:** <https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928>\
**Category:** Dev/API Corner\
**Created:** [March 8, 2026, 12:12am UTC](https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928 "2026-03-08T00:12:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickofearth](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@nickofearth](https://forums.plex.tv/u/nickofearth)\
**Post date:** [March 8, 2026, 12:12am UTC](https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928/1 "2026-03-08T00:12:49Z")

</div>

Hi Plex Team,

I am trying to create an app that gives the feel of channel surfing, but with content from my PMS, and I am trying to properly implement managed user (Home User) support with correct session attribution. I’ve hit a roadblock with the public API and hoping you can point me in the right direction.

**What I’m Trying to Accomplish:**

- Allow managed users to select their profile

- Have their playback sessions appear under their account in the Plex dashboard (not the main account owner)

**What I’ve Implemented:**

1. Using `/api/v2/home/users` to get list of users ✅

2. Using `/api/home/users/{id}/switch` to get user-specific token ✅

3. Using main account token for server access (libraries, media info, streams) ✅

**The Problem:** When a managed user’s token is used for timeline calls (`/:/timeline`), the server returns `401 Unauthorized`:

```auto
POST /api/home/users/{userId}/switch
Response: authToken="{token}"

GET http://192.168.50.124:32400/:/timeline?ratingKey=98682&state=playing&X-Plex-Token={token}
Response: 401 Unauthorized

```

Using the main account token for timeline calls works (200 OK), but sessions are attributed to the main account owner instead of the managed user.

**What I’ve Tried:**

- ✅ Using managed user token from `/switch` API - **401 error**

- ✅ Using main account token with `&accountID={userId}` parameter - **200 OK but session shows under main account**

- ✅ Verified the switch response contains only `authToken` and `authenticationToken` (both identical, no separate server token)

**Questions:**

1. Is there a way to properly attribute sessions to managed users via the public API?

2. Do managed user tokens from `/switch` have server access permissions, or are they plex.tv-only?

3. Is there a different endpoint or parameter I’m missing for multi-user session tracking?

4. If this isn’t supported in the public API, would you consider adding it?

I’ve examined the full XML response from `/switch` and it looks like there are no additional token fields beyond `authToken`. The official Plex apps handle this correctly, so I’m hoping there’s an approach I haven’t discovered yet.

Any guidance would be greatly appreciated! Happy to provide additional technical details if helpful.

Thanks!

---

<div class="post-metadata">

**Author:** ![SwiftPanda16](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/swiftpanda16/32/81839_2.png) [@SwiftPanda16](https://forums.plex.tv/u/SwiftPanda16)\
**Post date:** [March 8, 2026, 12:35am UTC](https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928/2 "2026-03-08T00:35:44Z")

</div>

Exchange for their server token at

```auto
https://plex.tv/api/v2/resources

```

---

<div class="post-metadata">

**Author:** ![nickofearth](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@nickofearth](https://forums.plex.tv/u/nickofearth)\
**Post date:** [March 8, 2026, 12:47am UTC](https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928/3 "2026-03-08T00:47:02Z")

</div>

> [@SwiftPanda16](#):
>
> xchange for their server token at
> 
> ```auto
> https://plex.tv/api/v2/resources
> 
> ```

Thank you! I’ll go give it a try!

---

<div class="post-metadata">

**Author:** ![nickofearth](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@nickofearth](https://forums.plex.tv/u/nickofearth)\
**Post date:** [March 8, 2026, 1:49am UTC](https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928/4 "2026-03-08T01:49:31Z")

</div>

That did it, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [June 6, 2026, 1:49am UTC](https://forums.plex.tv/t/third-party-app-managed-user-session-attribution-via-public-api/936928/5 "2026-06-06T01:49:48Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
