canonical: https://jentic.com/apis/plex.tv/plex

# Plex Tv Plex API

Media server streaming and library management API. The API exposes 5 endpoints secured with apiKey authentication.

## For AI agents

Programmatically get library sections, get section items. Covers 5 operations with apiKey authentication.

## Scope

Does not handle payments, communications, or crm - use for cloud infrastructure only.

## Capabilities

- Get library sections
- List Plex clients
- Play media

## Use cases

### Cloud Infrastructure Operations

Use the Plex API to perform cloud infrastructure operations programmatically. The API provides 5 endpoints covering core functionality including get library sections, get section items, get active sessions.

Example prompt: Call GET `/library/sections` to get library sections

### Automated Sessions Management

Automate sessions operations by combining multiple Plex API endpoints. Agents can get section items and then get active sessions in a single workflow.

Example prompt: Call GET `/library/sections/{sectionId}/all` to get section items, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Plex API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle apiKey tokens manually.

Example prompt: Search Jentic for 'get library sections', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/library/sections` | Get library sections |
| GET | `/library/sections/{sectionId}/all` | Get section items |
| GET | `/status/sessions` | Get active sessions |
| GET | `/clients` | List Plex clients |
| POST | `/player/playback/playMedia` | Play media |

## Key resources

- **Sessions** — Operations related to Sessions
- **Playback** — Operations related to Playback
- **Clients** — Operations related to Clients
- **Library** — Operations related to Library

## Why Jentic

- **Setup:** Wiring the Plex API by hand means learning its Authorization token header auth and hand-building requests across its library, session, client and playback endpoints yourself. Through Jentic you install once, import Plex from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Plex puts the section id in the URL path (`/library/sections/{sectionId}/all`), so a rule can pin your agent to one library section: it reads that section's contents and nothing else. You choose the operations it may call, so state-changing ones like starting media playback are not included unless you add them.
- **Credential handling:** Your Plex token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list library sections' or 'check active sessions', and Jentic returns the matching Plex operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Amazonaws** — Alternative cloud infrastructure API
- **Azure** — Alternative cloud infrastructure API
- **Googleapis** — Complementary cloud infrastructure API
- **Digitalocean** — Complementary cloud infrastructure API

## FAQ

### What authentication does the Plex API use?

The Plex API uses an API key passed in the `Authorization` header. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I get library sections with the Plex API?

Yes. Use the GET `/library/sections` endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Plex API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I get library sections through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'get library sections'. Jentic returns the matching Plex API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Plex API have?

The Plex API exposes 5 endpoints covering sessions, playback, clients operations.

### Can I limit what my agent is allowed to do with the Plex API?

Yes. Jentic One is self-hosted, so your own rules decide which Plex operations and credentials the agent may use. Because Plex puts the section id in the URL path, you can pin the agent to read one library section with GET `/library/sections/{sectionId}/all` and nothing else, and grant read-only calls like GET `/library/sections`, GET `/status/sessions`, or GET /clients while withholding the rest. State-changing operations such as POST `/player/playback/playMedia` to start playback are only available if you explicitly add them.
