> For the complete documentation index, see [llms.txt](https://wiki.crosswatch.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.crosswatch.app/crosswatch/advanced-and-api/api-reference/connections-and-instances.md).

# Connections and instances

Provider authentication, connection status, and instance management endpoints.

Use these endpoints to connect providers and manage their instances.

### Provider instances

Every provider has a `default` instance. Additional instances usually use `PROVIDER-P##` identifiers.

| Method   | Endpoint                                           | Purpose                            |
| -------- | -------------------------------------------------- | ---------------------------------- |
| `GET`    | `/api/provider-instances`                          | List instances for every provider. |
| `GET`    | `/api/provider-instances/{provider}`               | List instances for one provider.   |
| `POST`   | `/api/provider-instances/{provider}/next`          | Create the next instance.          |
| `POST`   | `/api/provider-instances/{provider}/{instance_id}` | Create or replace an instance.     |
| `DELETE` | `/api/provider-instances/{provider}/{instance_id}` | Delete a non-default instance.     |

Deletion returns `409` when active configuration references the instance.

### Provider authentication

| Provider family | Endpoint group                                                             | Purpose                                                   |
| --------------- | -------------------------------------------------------------------------- | --------------------------------------------------------- |
| Plex            | `/api/plex/*`                                                              | PIN sign-in, server discovery, libraries, and users.      |
| Jellyfin        | `/api/jellyfin/*`                                                          | Password and Quick Connect sign-in, libraries, and users. |
| Emby            | `/api/emby/*`                                                              | Password sign-in, server details, libraries, and users.   |
| Trackers        | `/api/trakt/*`, `/api/simkl/*`, `/api/anilist/*`                           | Device PIN and OAuth authorization flows.                 |
| Metadata        | `/api/tmdb/*`, `/api/tmdb_sync/*`                                          | TMDb API key and account authorization.                   |
| Other services  | `/api/mdblist/*`, `/api/publicmetadb/*`, `/api/nuvio/*`, `/api/tautulli/*` | Service-specific connection flows.                        |

Most connection routes accept an `instance` query parameter. Use the identifier returned by the instance endpoints.

Administrators can send `X-CW-View-As: <profile_id>` on `GET` requests to read as a Profile.

Send `X-CW-Assign-Profile: <profile_id>` on create requests to assign new pairs, routes, and webhooks to a Profile.

Both headers are ignored for non-admin users.

Non-admin users can call a provider's sign-in routes with `?instance=<id>` only when that instance belongs to their Profile alone.

### Status and discovery

| Method | Endpoint                       | Purpose                                 |
| ------ | ------------------------------ | --------------------------------------- |
| `GET`  | `/api/auth/providers`          | List provider authentication manifests. |
| `GET`  | `/api/status`                  | Return aggregate provider health.       |
| `POST` | `/api/debug/clear_probe_cache` | Clear cached provider probes.           |
| `GET`  | `/api/modules/versions`        | Return provider and module versions.    |

Keep credentials out of request logs. Redacted values preserve stored secrets where supported.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.crosswatch.app/crosswatch/advanced-and-api/api-reference/connections-and-instances.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
