NexgenStreamerNexgenStreamer
Docs menu

Admin API

The Admin API follows the XUI.one admin API: the same access-code URLs, api_key, action names, tables and STATUS_* replies. A few XUI.one actions, such as install_server, always refuse here, and the reference pages list them.

Every call puts the access code in the path and api_key and action in the query string:

http://<server>/<access_code>/?api_key=<key>&action=get_groups

Download the Postman collection with one request per action. Set its server, access_code and api_key variables.

Setup

In Access codes & API, create and enable an access code of type API. Set API IP allowlist to the IP addresses your requests will come from; requests from any other address get HTTP 403 Forbidden. Under Admin API keys, select New API key for an enabled user in an administrator group. The key acts with that user’s permissions and has no separate scopes. Send requests to the gateway shown in API connection URL, under /{access_code}/.

Requests

Use GET for reads and POST for changes. Send parameters in the query string, as application/x-www-form-urlencoded, as a JSON object (application/json), or as multipart/form-data for file uploads. Body values override matching query values. Send the key as api_key, as XUI.one does. The X-API-Key header also works; if you supply both, api_key takes precedence.

Set action to the name of the operation. In list requests, start is the zero-based offset and limit is the page size (default 50). Use id to select a table on /table.php. See Lists for filtering and pagination.

Responses

Action responses normally have a JSON status, with optional data and error. List results may add counts. Check both the HTTP code and status. Requests that pass authentication and rate checks include X-Request-ID for support. An unknown action returns {"status":"STATUS_FAILURE","error":"Invalid action."} when permitted to reach dispatch. A request blocked by the licence returns {"status":"STATUS_FAILURE","error":"License required."}. Management writes such as creating lines need management entitlement; reads and starting or stopping existing streams have separate licence rules.

HTTP 429 means the request was limited; 503 means the service could not accept it. Both include Retry-After: 1.

Status values

Status Meaning
STATUS_SUCCESS Action completed
STATUS_FAILURE General failure, including invalid credentials or a licence restriction
STATUS_SUCCESS_MULTI Created multiple episodes for a series
STATUS_INVALID_INPUT Invalid request structure or action parameters
STATUS_NO_PERMISSIONS No action result in the compatibility wrapper
STATUS_NO_SOURCES No usable media sources supplied
STATUS_CODE_LENGTH Access code length is outside the allowed range
STATUS_INVALID_CODE Malformed access code
STATUS_RESERVED_CODE Reserved access code
STATUS_EXISTS_CODE Access code already exists
STATUS_INVALID_DATE Invalid expiry date
STATUS_EXISTS_USERNAME Username already exists
STATUS_INVALID_GROUP Invalid group for the user
STATUS_INVALID_MAC Invalid device MAC address
STATUS_INVALID_USER Invalid user for the device
STATUS_EXISTS_MAC MAC address already exists
STATUS_NO_KEY Missing HMAC key
STATUS_NO_DESCRIPTION Missing HMAC description
STATUS_EXISTS_HMAC HMAC key already exists
STATUS_INVALID_IP Invalid IP address
STATUS_EXISTS_IP IP address already registered
STATUS_INVALID_NAME Invalid source-related name
STATUS_INVALID_DIR Invalid watch folder
STATUS_EXISTS_DIR Watch folder already exists

The second group lists names retained for legacy numeric statuses; their presence does not mean the API implements each legacy operation.

Status Meaning
STATUS_DISABLED Disabled
STATUS_NOT_ADMIN Administrator required
STATUS_INVALID_EMAIL Invalid email
STATUS_INVALID_PASSWORD Invalid password
STATUS_INVALID_PLAYLIST Invalid playlist
STATUS_INVALID_CAPTCHA Invalid CAPTCHA
STATUS_INVALID_FILE Invalid file
STATUS_INVALID_DATA Invalid data
STATUS_EXISTS_NAME Name already exists
STATUS_EXISTS_SOURCE Source already exists
STATUS_SUCCESS_REPLACE Replacement completed
STATUS_FLUSH Flush status
STATUS_TOO_MANY_RESULTS Too many results
STATUS_SPACE_ISSUE Storage space problem
STATUS_CERTBOT Certbot status
STATUS_CERTBOT_INVALID Invalid Certbot operation
STATUS_CERTBOT_RUNNING Certbot already running
STATUS_NOT_RESELLER Reseller required
STATUS_NO_TRIALS No trials available
STATUS_INSUFFICIENT_CREDITS Insufficient credits
STATUS_INVALID_PACKAGE Invalid package
STATUS_INVALID_TYPE Invalid type
STATUS_INVALID_USERNAME Invalid username
STATUS_INVALID_SUBRESELLER Invalid sub-reseller
STATUS_NO_TITLE Missing title
STATUS_NO_SOURCE Missing source
STATUS_BLOCKED_USER_DOMAIN Blocked user domain
STATUS_2FA_REQUIRED Two-factor authentication required
STATUS_2FA_INVALID Invalid two-factor authentication

Examples

Replace <server>, <access_code> and <key> with your values, and set NEW_LINE_PASSWORD in your shell.

List up to two lines:

curl -sS 'http://<server>/<access_code>/?api_key=<key>&action=get_lines&limit=2'

Create a line with one connection and an explicit expiry. The handler generates a username or password if omitted, defaults max_connections to 1, and uses the calling user as owner if no owner is supplied. This example does not grant content or output formats.

curl -sS 'http://<server>/<access_code>/?api_key=<key>&action=create_line' \
  --data-urlencode username=sample_line \
  --data-urlencode "password=$NEW_LINE_PASSWORD" \
  --data-urlencode max_connections=1 \
  --data-urlencode exp_date=2027-12-31