Plex Host Docs
API

Plex Host API

The Plex Host REST API lets you manage servers, files, backups, and players from your own scripts, bots, or integrations — everything the dashboard can do to a server, an API token can do too, scoped to whatever you grant it.

This page covers the REST API (/api/v1). Plex Host also has a GraphQL API that powers the dashboard itself; it isn't part of this public contract.

Base URL

https://api.host.plex.gg

Every path in this section is relative to that base URL, e.g. GET /api/v1/servers means GET https://api.host.plex.gg/api/v1/servers. Development and staging environments use different hosts — use the base URL your token was issued against.

Authentication

Every request carries an API token as a bearer credential:

Authorization: Bearer plx_srv_...

Tokens come in two kinds, distinguished by their prefix — see Tokens for how to create and manage them:

PrefixKindScope
plx_srv_ServerBound to one server; scopes are that server's permissions
plx_acc_AccountActs across every server the owner can reach; scopes are broader actions like servers:read

A token is shown once, at creation. Plex Host stores only its hash.

The response envelope

Every /api/v1 response is wrapped the same way, success or failure.

Success:

{
  "data": { "...": "..." },
  "meta": { "requestId": "req_01hz..." }
}

Failure:

{
  "error": {
    "code": "SCOPE_DENIED",
    "message": "Token is missing the canModifyFiles scope",
    "requestId": "req_01hz...",
    "details": ["optional field-level validation messages"],
    "retryAfterSeconds": 0
  }
}

requestId is also echoed as the X-Request-Id response header — include it when reporting an issue. details is present only on a 400 from request validation; retryAfterSeconds is present only on a 429.

Rate limits

Every response carries rate-limit headers:

HeaderMeaning
X-RateLimit-LimitRequests allowed in the current window
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetSeconds until the window resets

A request that exceeds the limit gets a 429 with a Retry-After header and retryAfterSeconds in the error body:

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests",
    "requestId": "req_01hz...",
    "retryAfterSeconds": 42
  }
}

Error codes

Access denied (403):

CodeMeaning
API_TOKEN_NOT_ALLOWEDThe operation is closed to tokens outright, regardless of scope
WRONG_SERVERA server token was used against a server other than the one it's bound to
SCOPE_DENIEDThe token's scopes don't cover the capability the operation needs
OWNER_ONLYThe operation requires the account owner; no token satisfies it

Quota and plan (403 / 429):

CodeMeaning
API_DISABLED_FOR_PLANThe owner's plan doesn't include API access
TOKEN_LIMIT_REACHEDThe server already has the maximum number of tokens its plan allows (on creation)
RATE_LIMITEDPer-minute request cap hit — retry after retryAfterSeconds
QUOTA_EXCEEDEDMonthly request cap hit
PLAN_LIMITThe token is suspended because a plan change put its owner over a limit — see Tokens

Scopes

A server token's scopes are the same permissions a team member can hold on that server:

ScopeGrants
canViewServerRead server status, resource stats, and configuration
canControlServerStart, stop, restart, kill, and send console commands
canViewFilesBrowse and read files
canModifyFilesUpload, edit, rename, move, and delete files
canViewBackupsList backups and view backup details
canCreateBackupsCreate backups
canRestoreBackupsRestore a backup onto the server
canDeleteBackupsDelete backups
canViewPlayersSee the online player list and player activity
canManagePlayersAnnounce messages, ban, and unban players
canViewActivityRead the server's activity log

An account token's scopes act across every server the owner can reach, and map onto the same underlying permissions:

ScopeMaps to
servers:readcanViewServer
servers:powercanControlServer
servers:commandcanControlServer
files:readcanViewFiles
files:writecanModifyFiles
backups:readcanViewBackups
backups:createcanCreateBackups
backups:restorecanRestoreBackups
backups:deletecanDeleteBackups
players:readcanViewPlayers
players:managecanManagePlayers
activity:readcanViewActivity

A token's effective access is the intersection of its scopes and whatever the owner can currently do. If an owner is removed from a team, or a team role loses a capability, tokens that relied on it stop working even though the token itself hasn't changed.

Quick start

curl https://api.host.plex.gg/api/v1/servers \
  -H "Authorization: Bearer plx_acc_..."
{
  "data": [
    { "id": "srv_01hz...", "name": "Survival", "status": "running" }
  ],
  "meta": { "requestId": "req_01hz..." }
}

See Tokens to create your first token, then Servers, Files, Backups, and Players for the full operation reference, or Examples for curl, Node, Python, and a Discord bot.

On this page