> For the complete documentation index, see [llms.txt](https://streamsmanager.gitbook.io/streams-manager/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://streamsmanager.gitbook.io/streams-manager/faq/how-does-streams-manager-select-a-plex-server-to-add-a-user.md).

# How does Streams Manager select a Plex server to add a user?

Streams Manager uses the following rules to select a server for a subscriber:

* If a user is a subscriber already and shares a Plex server, verify that the server they are sharing accommodates the plan they picked. If it does, nothing is done expect add a payment covering the new time period. If not, proceed to the next step
* If a user has an invite to the Plex server that is not accepted, verify that the server they have an invite for accommodates the plan they picked. If it does, nothing is done expect add a payment covering the new time period. User needs to accept the invite they already have. If the server does not accommodate the plan, proceed to the next step
* Find all Plex servers that are enabled and have capacity remaining
* If a user shared a server in the past and that server has capacity and accommodates the plan user selected, add the user to that server&#x20;
* If plan is trial, use a server that is enabled, has capacity remaining, accepts trials and accommodates the trial plan and use that server giving preference to selected location. If multiple servers match the criteria, select the server with the lowest number of users
* If plan is not trial, use a server that is enabled, has capacity remaining, accommodates the plan and use that server giving preference to selected location. If multiple servers match the criteria, select the server with the lowest number of users
* If none, throw an error and notify admin


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://streamsmanager.gitbook.io/streams-manager/faq/how-does-streams-manager-select-a-plex-server-to-add-a-user.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
