openapi: 3.1.0
info:
  title: XC_VM Admin API
  version: 2.7.3
  summary: Admin API of the Xtream Codes compatible HTTP surface, as implemented by XC_VM.
  description: |
    A source-level reference for the **Xtream Codes (XC) API**: the de facto standard HTTP interface
    between IPTV panels and player apps. The reference implementation is
    [XC_VM](https://github.com/Vateron-Media/XC_VM) 2.7.3, an open-source continuation of Xtream UI / XC.
    Each operation cites the XC_VM source file and line it was traced from (`src/...:line`).

    ## Authentication models

    The panel has several independent auth schemes. Each endpoint states which one it uses.

    | Who | How |
    |---|---|
    | Line (subscriber) | `username` + `password` query parameters, or `token` (32-char line access token). Also in path form: `/player_api/{u}/{p}`, `/live/{u}/{p}/...` |
    | Activation code | The code typed as `username` (or `token`) is activated on first use and becomes a line |
    | MAG / Stalker box | MAC address cookie + bearer token from `handshake` (`/c/portal.php`, `/stalker_portal/...`) |
    | Enigma2 box | MAC/device registration (`enigma2.php`) |
    | Admin / reseller REST | `api_key` query parameter (named `xct_` token or legacy per-user key) on `/{access_code}/?action=...`; the access code's IP whitelist is enforced by nginx |
    | Load-balancer nodes | Shared cluster secret (`/cluster/v1`); signed `node.rpc` (legacy `api.php` on nodes older than 2.7.0) |

    ## Notation

    OpenAPI cannot express query-string multiplexing, so action-based endpoints are written as separate
    literal paths such as `/player_api.php?action=get_live_streams`. The request is still a single
    `GET /player_api.php` with `action` as an ordinary query parameter.

    The admin and reseller REST APIs share one URL shape, `/{access_code}/?action=...`. Each access code has a type
    (3 = Admin API, 4 = Reseller API) and nginx routes it to that API, so `/{access_code}/...` and `/{reseller_access_code}/...` are the
    same URL and differ only in which kind of code is used.
  contact:
    name: XC_VM project
    url: https://github.com/Vateron-Media/XC_VM
  license:
    name: AGPL-3.0 (XC_VM source); this document describes its public interface
    identifier: AGPL-3.0-only
servers:
  - url: '{protocol}://{host}:{port}'
    description: Any XC compatible panel or load-balancer node
    variables:
      protocol:
        default: http
        enum:
          - http
          - https
      host:
        default: tv.example.com
      port:
        default: '80'
        description: HTTP broadcast port (often 80, 8080, 8000, 25461); HTTPS often 443 or 25463.
externalDocs:
  description: XC_VM source
  url: https://github.com/Vateron-Media/XC_VM
security:
  - Admin_ApiKey: []
components:
  securitySchemes:
    Admin_ApiKey:
      type: apiKey
      in: query
      name: api_key
      description: A named API token (`xct_...`, stored as a SHA-256 hash in `api_tokens`) or, while the `api_legacy_keys` setting is not '0', the user's legacy `users.api_key`. The key's user must have `status=1` and be in a group with `is_admin=1`. Tokens may also carry an IP allow-list and an expiry (src/Core/Auth/ApiTokens.php:47-93). Missing or rejected keys give `{"status":"STATUS_FAILURE","error":"Invalid API key."}`.
  parameters:
    Admin_AccessCode:
      name: access_code
      in: path
      required: true
      schema:
        type: string
        example: adminapi
      description: An access code of type 3 (Admin API) (Access Codes page). nginx routes `/<code>/...` to src/Public/index.php with XC_SCOPE=includes/api/admin (src/Core/Auth/AuthRepository.php:119-120, src/bin/nginx/conf/codes/template). Anything after the code in the path is ignored; only the parameters matter. The code's whitelist, when set, becomes nginx `allow`/`deny all` rules.
    Admin_Start:
      name: start
      in: query
      schema:
        type: integer
        default: 0
        minimum: 0
      description: Row offset (intval).
    Admin_Limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
      description: Page size (intval; 0 or absent = 50). Passed to the table handler as `length`. Not capped in API mode.
    Admin_ShowColumns:
      name: show_columns
      in: query
      schema:
        type: string
        example: id,username,exp_date
      description: Comma-separated whitelist of row keys to keep (applied to `data`). Takes precedence over hide_columns.
    Admin_HideColumns:
      name: hide_columns
      in: query
      schema:
        type: string
        example: password
      description: Comma-separated row keys to drop (ignored when show_columns is set).
    Admin_SearchValue:
      name: search[value]
      in: query
      schema:
        type: string
      description: DataTables global search; LIKE %value% across the columns listed in the operation.
    Admin_OrderColumn:
      name: order[0][column]
      in: query
      schema:
        type: integer
        default: 0
      description: DataTables sort column index (see the per-operation index map; an index mapped to none, including the default 0 on most tables, means no ORDER BY).
    Admin_OrderDir:
      name: order[0][dir]
      in: query
      schema:
        type: string
        enum:
          - asc
          - desc
        default: asc
      description: Sort direction; anything but `desc` is ascending.
    Admin_Id:
      name: id
      in: query
      required: true
      schema:
        type: integer
        example: 12
      description: Record id.
  examples:
    Admin_InvalidKey:
      summary: Missing or rejected api_key
      value:
        status: STATUS_FAILURE
        error: Invalid API key.
    Admin_NoPermissions:
      summary: Token scope or group permission refused
      value:
        status: STATUS_NO_PERMISSIONS
    Admin_Failure:
      summary: Record not found / operation failed
      value:
        status: STATUS_FAILURE
  schemas:
    Admin_Status:
      type: string
      description: Status name. Numeric service codes (src/Core/Config/ConstantsInitializer.php:200-252) are converted to their constant names by parseError(); an empty service result becomes STATUS_NO_PERMISSIONS.
      enum:
        - STATUS_FAILURE
        - STATUS_SUCCESS
        - STATUS_SUCCESS_MULTI
        - STATUS_CODE_LENGTH
        - STATUS_NO_SOURCES
        - STATUS_DISABLED
        - STATUS_NOT_ADMIN
        - STATUS_INVALID_EMAIL
        - STATUS_INVALID_PASSWORD
        - STATUS_INVALID_IP
        - STATUS_INVALID_PLAYLIST
        - STATUS_INVALID_NAME
        - STATUS_INVALID_CAPTCHA
        - STATUS_INVALID_CODE
        - STATUS_INVALID_DATE
        - STATUS_INVALID_FILE
        - STATUS_INVALID_GROUP
        - STATUS_INVALID_DATA
        - STATUS_INVALID_DIR
        - STATUS_INVALID_MAC
        - STATUS_EXISTS_CODE
        - STATUS_EXISTS_NAME
        - STATUS_EXISTS_USERNAME
        - STATUS_EXISTS_MAC
        - STATUS_EXISTS_SOURCE
        - STATUS_EXISTS_IP
        - STATUS_EXISTS_DIR
        - STATUS_SUCCESS_REPLACE
        - STATUS_FLUSH
        - STATUS_TOO_MANY_RESULTS
        - STATUS_SPACE_ISSUE
        - STATUS_INVALID_USER
        - STATUS_CERTBOT
        - STATUS_CERTBOT_INVALID
        - STATUS_INVALID_INPUT
        - STATUS_NOT_RESELLER
        - STATUS_NO_TRIALS
        - STATUS_INSUFFICIENT_CREDITS
        - STATUS_INVALID_PACKAGE
        - STATUS_INVALID_TYPE
        - STATUS_INVALID_USERNAME
        - STATUS_INVALID_SUBRESELLER
        - STATUS_NO_DESCRIPTION
        - STATUS_NO_KEY
        - STATUS_EXISTS_HMAC
        - STATUS_CERTBOT_RUNNING
        - STATUS_RESERVED_CODE
        - STATUS_NO_TITLE
        - STATUS_NO_SOURCE
        - STATUS_PORT_IN_USE
        - STATUS_2FA_REQUIRED
        - STATUS_2FA_INVALID
        - STATUS_2FA_LOCKED
        - STATUS_NO_PERMISSIONS
    Admin_Envelope:
      type: object
      required:
        - status
      description: Standard reply envelope. Always HTTP 200 (except the reseller maintenance 503).
      properties:
        status:
          $ref: '#/components/schemas/Admin_Status'
        data:
          description: Payload; shape depends on the action. On create/edit, the full stored record. On a validation error, often the (filtered) input echoed back.
        error:
          type: string
          description: Human-readable error (only some errors carry one).
      additionalProperties: true
    Admin_Error:
      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/Admin_Status'
        error:
          type: string
    Admin_TableResponse:
      type: object
      description: 'API-mode DataTables reply: no `draw` key. `recordsFiltered` is min(recordsTotal, limit) - a page cap, not a filtered count. A handler permission failure yields an empty body.'
      properties:
        status:
          type: string
          enum:
            - STATUS_SUCCESS
        data:
          type: array
          items:
            type: object
            additionalProperties: true
        recordsTotal:
          oneOf:
            - type: integer
            - type: string
              pattern: ^[0-9]+$
          description: Total rows after filters (numeric string for raw-row handlers, integer for typed log handlers).
        recordsFiltered:
          oneOf:
            - type: integer
            - type: string
    Admin_ActiveCodeRow:
      type: object
      description: Row of ActiveCodeService::listCodes() (src/Domain/Line/ActiveCodeService.php:1314-1341). Typed values.
      properties:
        id:
          type: integer
        activation_code:
          type: string
        batch_name:
          type: string
          description: '''None'' when empty'
        status:
          type: integer
          enum:
            - 0
            - 1
            - 2
          description: 0 disabled, 1 stock (not redeemed), 2 redeemed
        status_key:
          type: string
          enum:
            - disabled
            - stock
            - expired
            - active
        status_label:
          type: string
          enum:
            - Disabled
            - Ready (Stock)
            - Expired
            - Active
        package_id:
          type: integer
        package_name:
          type: string
        subscriber_id:
          type:
            - integer
            - 'null'
        line_username:
          type:
            - string
            - 'null'
        line_password:
          type:
            - string
            - 'null'
        exp_date:
          type:
            - integer
            - 'null'
        exp_date_formatted:
          type:
            - string
            - 'null'
        remaining_days:
          type: integer
        mac:
          type:
            - string
            - 'null'
        device_id:
          type:
            - string
            - 'null'
        max_connections:
          type: integer
        is_trial:
          type: integer
        is_adult:
          type: integer
        purchase_cost:
          type: number
        created_by:
          type: integer
        creator_username:
          type: string
        created_at:
          type: integer
        created_at_formatted:
          type: string
        activated_at:
          type:
            - integer
            - 'null'
        activated_at_formatted:
          type:
            - string
            - 'null'
    Admin_ActiveCodeGenerate:
      type: object
      required:
        - package_id
      description: Inputs of ActiveCodeService::generateCodes() (src/Domain/Line/ActiveCodeService.php:69-371). Each code creates a disabled line with no expiry until the code is redeemed.
      properties:
        package_id:
          type: integer
          description: Package id (required; error 'Invalid package selected.').
        num_codes:
          type: integer
          minimum: 1
          maximum: 500
          default: 1
          description: Number of codes (not `qty`).
        code_length:
          type: integer
          minimum: 6
          maximum: 24
          default: 10
        code_format:
          type: string
          enum:
            - alphanumeric
            - numeric
          default: alphanumeric
          description: Alphanumeric alphabet is 23456789ABCDEFGHJKLMNPQRSTUVWXYZ.
        is_trial:
          type: boolean
          description: Trial codes (cost = package trial_credits).
        batch_name:
          type: string
          description: Default `BATCH-YYYYMMDD-XXXXX`.
        bouquets_selected[]:
          type: array
          items:
            type: integer
          description: 'Default: the package''s bouquets.'
        dns_base:
          type: string
          description: Host used in playlist links.
        is_adult:
          type: boolean
        category_template_id:
          type: integer
        streaming_username:
          type: string
          description: Only when num_codes=1 (alias `username`); min 3 chars, [A-Za-z0-9._-]. Default `ac_` + 9 hex.
        streaming_password:
          type: string
          description: Only when num_codes=1 (alias `password`); no `/`. Default 10 hex chars.
        created_by:
          type: integer
          description: 'Owner of the codes (default: the key user).'
        forced_country:
          type: string
          description: 'Default: the package value; empty clears.'
        max_connections:
          type: integer
          description: 'Default: package value or 1.'
        custom_data:
          type: string
          description: JSON object or array.
    Admin_LineInput:
      type: object
      additionalProperties: true
      description: 'Line fields for create_line/edit_line (LineService::process, src/Domain/Line/LineService.php:177-332). On create, checkbox fields are switched ON whenever the key is present (PHP isset), whatever its value: send them only to turn them on. Any other request key that matches a column of the target table is written as-is (QueryHelper::verifyPostTable, src/Core/Database/QueryHelper.php:65-110); PHP arrays (`x[]=`) are JSON-encoded and the string "null" becomes NULL. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.'
      properties:
        username:
          type: string
          description: Empty/absent = random 10 characters. Must not contain `/` (STATUS_INVALID_USERNAME, 40). Duplicate = STATUS_EXISTS_USERNAME (22).
        password:
          type: string
          description: Plain text (stored unhashed). Empty/absent = random 10 characters. `/` = STATUS_INVALID_PASSWORD (8).
        bouquets_selected:
          type: string
          description: 'JSON string, e.g. `[1,2,3]`. Bouquet ids. **Required** (a missing/invalid value raises a PHP TypeError: HTTP 500, empty body). Re-sorted into the global bouquet order and stored in `bouquet`. If the owner (`member_id`) has `allowed_bouquets`, silently intersected with it.'
          example: '[1,2,3]'
        bouquet_order:
          type: string
          description: Custom bouquet order (JSON string or array of ids); sets `bouquet_order_custom=1`, remaining bouquets appended.
        exp_date:
          type: string
          description: Expiry; any PHP DateTime string (`2026-12-31`, `2026-12-31 23:59`, `@1798761600`). Absent = never expires (NULL) on create; unparsable = STATUS_INVALID_DATE (14); `""` or `1970-01-01` leaves it unchanged.
          example: '2026-12-31'
        no_expire:
          type:
            - integer
            - string
          description: Checkbox. Present = `exp_date` NULL (never expires). On edit only a truthy value counts.
        member_id:
          type: integer
          description: Owner (registered user id). Falsy = the API key's user.
        isp_clear:
          type: string
          description: 'ISP lock handling: empty/absent clears `isp_desc` and `as_number`. The edit wrapper keeps the lock unless the request sends `isp_clear` (any value), which clears it.'
        is_isplock:
          type:
            - integer
            - string
          description: Checkbox. Lock the line to the first ISP seen.
        is_trial:
          type:
            - integer
            - string
          description: Checkbox.
        allowed_ips[]:
          type: array
          items:
            type: string
          description: IP allow-list (a scalar is wrapped). Stored JSON. Empty on edit = cleared.
        category_template_id:
          type:
            - integer
            - string
          description: '`0`/`none` clears `custom_data`; a positive id builds `custom_data` from that category template.'
        custom_data:
          type: string
          description: Raw custom data (JSON) when no template is used.
        max_connections:
          type: integer
          description: Default 1.
          default: 1
        enabled:
          type: integer
          description: 1/0. Default 1.
          enum:
            - 0
            - 1
        admin_enabled:
          type: integer
          description: 1/0 (0 = banned). Default 1.
          enum:
            - 0
            - 1
        is_stalker:
          type:
            - integer
            - string
          description: Checkbox.
        is_restreamer:
          type:
            - integer
            - string
          description: Checkbox.
        bypass_ua:
          type:
            - integer
            - string
          description: Checkbox. Bypass the user-agent blocklist.
        allowed_ua[]:
          type: array
          items:
            type: string
          description: User-agent allow-list.
        access_output[]:
          type: array
          items:
            type: integer
            enum:
              - 1
              - 2
              - 3
          description: 'Allowed outputs: 1 HLS (m3u8), 2 MPEG-TS, 3 RTMP. Stored as `allowed_outputs`. Absent on create = none.'
        bouquet_order_revision:
          type: string
          description: 'Edit only: sha256 of the stored order; on mismatch with `bouquet_order` sent, STATUS_INVALID_DATA (17) with `data.bouquet_order_conflict=true`.'
        admin_notes:
          type: string
        reseller_notes:
          type: string
        forced_country:
          type: string
          description: ISO country code or empty.
        force_server_id:
          type: integer
        package_id:
          type: integer
        contact:
          type: string
        telegram:
          type: string
    Admin_MagInput:
      type: object
      additionalProperties: true
      description: 'MAG device + backing line (MagService::process, src/Domain/Device/MagService.php:218-405). The backing line is forced to max_connections=1, is_restreamer=0, allowed_outputs=[1,2], is_mag=1. Any `mag_devices` or `lines` column is also accepted. On create, checkbox fields are switched ON whenever the key is present (PHP isset), whatever its value: send them only to turn them on. Any other request key that matches a column of the target table is written as-is (QueryHelper::verifyPostTable, src/Core/Database/QueryHelper.php:65-110); PHP arrays (`x[]=`) are JSON-encoded and the string "null" becomes NULL. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.'
      properties:
        mac:
          type: string
          description: '**Required.** Empty = STATUS_INVALID_INPUT (34); invalid = STATUS_INVALID_MAC (19); used by another device = STATUS_EXISTS_MAC (23).'
          example: 00:1A:79:12:34:56
        username:
          type: string
          description: Backing line username; empty = random 32 characters.
        password:
          type: string
          description: Backing line password; empty = random 32 characters.
        bouquets_selected:
          type: string
          description: 'JSON string, e.g. `[1,2,3]`. Bouquet ids. **Required** (a missing/invalid value raises a PHP TypeError: HTTP 500, empty body). Re-sorted into the global bouquet order and stored in `bouquet`. If the owner (`member_id`) has `allowed_bouquets`, silently intersected with it.'
          example: '[1,2,3]'
        exp_date:
          type: string
          description: Expiry; any PHP DateTime string (`2026-12-31`, `2026-12-31 23:59`, `@1798761600`). Absent = never expires (NULL) on create; unparsable = STATUS_INVALID_DATE (14); `""` or `1970-01-01` leaves it unchanged.
          example: '2026-12-31'
        no_expire:
          type:
            - integer
            - string
          description: Checkbox. Present = `exp_date` NULL (never expires). On edit only a truthy value counts.
        member_id:
          type: integer
          description: Owner (registered user id). Falsy = the API key's user.
        isp_clear:
          type: string
          description: 'ISP lock handling: empty/absent clears `isp_desc` and `as_number`. The edit wrapper keeps the lock unless the request sends `isp_clear` (any value), which clears it.'
        is_isplock:
          type:
            - integer
            - string
          description: Checkbox. Lock the line to the first ISP seen.
        is_trial:
          type:
            - integer
            - string
          description: Checkbox.
        allowed_ips[]:
          type: array
          items:
            type: string
          description: IP allow-list (a scalar is wrapped). Stored JSON. Empty on edit = cleared.
        lock_device:
          type:
            - integer
            - string
          description: Checkbox. Lock to the first device identifiers seen.
        pair_id:
          type: integer
          description: Main line this device mirrors; must exist (else STATUS_INVALID_USER, 31).
        category_template_id:
          type:
            - integer
            - string
          description: '`0`/`none` clears `custom_data`; a positive id builds `custom_data` from that category template.'
        admin_notes:
          type: string
        reseller_notes:
          type: string
        forced_country:
          type: string
        parent_password:
          type: string
          description: STB parental password.
        stb_type:
          type: string
        sn:
          type: string
        mac_filter:
          type: string
    Admin_EnigmaInput:
      type: object
      additionalProperties: true
      description: 'Enigma2 device + backing line (EnigmaService::process, src/Domain/Device/EnigmaService.php:168-351). Backing line forced to max_connections=1, is_e2=1. Any `enigma2_devices` or `lines` column is also accepted. On create, checkbox fields are switched ON whenever the key is present (PHP isset), whatever its value: send them only to turn them on. Any other request key that matches a column of the target table is written as-is (QueryHelper::verifyPostTable, src/Core/Database/QueryHelper.php:65-110); PHP arrays (`x[]=`) are JSON-encoded and the string "null" becomes NULL. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.'
      properties:
        mac:
          type: string
          description: '**Required.** Empty = STATUS_INVALID_INPUT (34); invalid = STATUS_INVALID_MAC (19); used by another device = STATUS_EXISTS_MAC (23).'
          example: 00:1A:79:12:34:56
        username:
          type: string
          description: Backing line username; empty = random 32 characters.
        password:
          type: string
          description: Backing line password; empty = random 32 characters.
        bouquets_selected:
          type: string
          description: 'JSON string, e.g. `[1,2,3]`. Bouquet ids. **Required** (a missing/invalid value raises a PHP TypeError: HTTP 500, empty body). Re-sorted into the global bouquet order and stored in `bouquet`. If the owner (`member_id`) has `allowed_bouquets`, silently intersected with it.'
          example: '[1,2,3]'
        exp_date:
          type: string
          description: Expiry; any PHP DateTime string (`2026-12-31`, `2026-12-31 23:59`, `@1798761600`). Absent = never expires (NULL) on create; unparsable = STATUS_INVALID_DATE (14); `""` or `1970-01-01` leaves it unchanged.
          example: '2026-12-31'
        no_expire:
          type:
            - integer
            - string
          description: Checkbox. Present = `exp_date` NULL (never expires). On edit only a truthy value counts.
        member_id:
          type: integer
          description: Owner (registered user id). Falsy = the API key's user.
        isp_clear:
          type: string
          description: 'ISP lock handling: empty/absent clears `isp_desc` and `as_number`. The edit wrapper keeps the lock unless the request sends `isp_clear` (any value), which clears it.'
        is_isplock:
          type:
            - integer
            - string
          description: Checkbox. Lock the line to the first ISP seen.
        is_trial:
          type:
            - integer
            - string
          description: Checkbox.
        allowed_ips[]:
          type: array
          items:
            type: string
          description: IP allow-list (a scalar is wrapped). Stored JSON. Empty on edit = cleared.
        lock_device:
          type:
            - integer
            - string
          description: Checkbox. Lock to the first device identifiers seen.
        pair_id:
          type: integer
          description: Main line this device mirrors; must exist (else STATUS_INVALID_USER, 31).
        category_template_id:
          type:
            - integer
            - string
          description: '`0`/`none` clears `custom_data`; a positive id builds `custom_data` from that category template.'
        admin_notes:
          type: string
        reseller_notes:
          type: string
        forced_country:
          type: string
        modem_mac:
          type: string
        local_ip:
          type: string
        enigma_version:
          type: string
        cpu:
          type: string
        lversion:
          type: string
        token:
          type: string
    Admin_UserInput:
      type: object
      additionalProperties: true
      description: 'Registered user (admin or reseller account) for create_user/edit_user (UserService::process, src/Domain/User/UserService.php:162-307). On create, checkbox fields are switched ON whenever the key is present (PHP isset), whatever its value: send them only to turn them on. Any other request key that matches a column of the target table is written as-is (QueryHelper::verifyPostTable, src/Core/Database/QueryHelper.php:65-110); PHP arrays (`x[]=`) are JSON-encoded and the string "null" becomes NULL. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.'
      required:
        - member_group_id
      properties:
        member_group_id:
          type: integer
          description: '**Required.** Empty, or a reserved group (group 1 and every is_admin group, unless you are a full admin) = STATUS_INVALID_GROUP (16).'
        username:
          type: string
          description: Empty = random 10 characters. Duplicate = STATUS_EXISTS_USERNAME (22).
        password:
          type: string
          description: Plain text; hashed on save. Empty on edit keeps the stored hash.
        email:
          type: string
        notes:
          type: string
        reseller_dns:
          type: string
          description: Comma-separated DNS hosts for the reseller's playlists.
        owner_id:
          type: integer
          description: Parent reseller.
        status:
          type: integer
          description: 1 enabled / 0 disabled. Default 1.
          enum:
            - 0
            - 1
        credits:
          type: number
          description: 'Create: initial balance. Edit: new balance; the change (`credits - credits_shown`, or minus the stored balance) is logged to users_credits_logs with `credits_reason`.'
        credits_shown:
          type: number
        credits_reason:
          type: string
        api_key:
          type: string
          description: 'Legacy API key: exactly 32 hex characters, otherwise stored empty.'
          pattern: ^[0-9a-fA-F]{32}$
        override_{packageId}:
          type: number
          description: Per-package official_credits override, one field per package (e.g. `override_3=8`). Stored overrides are kept on edit.
        bouquet_limit_enabled:
          type: string
          description: '`1` = restrict the reseller to `allowed_bouquets`; any other value = unrestricted (NULL). Absent on edit keeps the stored value.'
        allowed_bouquets:
          type:
            - array
            - string
          items:
            type: integer
          description: Bouquet ids (array or JSON string) used when bouquet_limit_enabled=1.
        bouquet_limit_revision:
          type: string
          description: 'Edit only: sha256 guard; mismatch = STATUS_INVALID_INPUT (34).'
        reset_2fa:
          type:
            - integer
            - string
          description: 'Checkbox. Edit only: non-empty disables the user''s 2FA.'
        timezone:
          type: string
        lang:
          type: string
        theme:
          type: string
        hue:
          type: string
    Admin_BouquetInput:
      type: object
      additionalProperties: true
      description: Bouquet (BouquetService::process, src/Domain/Bouquet/BouquetService.php:36-121). No name validation. On edit the wrapper rebuilds `bouquet_data` from the stored lists when it is not sent.
      properties:
        bouquet_name:
          type: string
        bouquet_data:
          type: string
          description: 'JSON object with ALL four keys: `{"stream":[ids],"movies":[ids],"radios":[ids],"series":[ids]}` (key `stream` is singular). A missing key raises a TypeError (HTTP 500). Ids are filtered against the DB; dropped ids can leave a JSON object instead of a list in the stored column.'
          example: '{"stream":[25,26],"movies":[],"radios":[],"series":[3]}'
        bouquet_order:
          type: integer
          description: 'Create: defaults to MAX+1.'
    Admin_AccessCodeInput:
      type: object
      additionalProperties: true
      description: Access code (AuthService::processCode, src/Core/Auth/AuthService.php:35-107). Saving regenerates the nginx code configs.
      properties:
        code:
          type: string
          description: Path segment. Length >= 8 (>= 3 for types 6-8; any for type 2 but not empty) else STATUS_CODE_LENGTH (3). Reserved words (admin, stream, api, live, movie, series, player_api, playlist, xmltv, hls, ...) = STATUS_RESERVED_CODE (46). Duplicate = STATUS_EXISTS_CODE (20).
        type:
          type: integer
          description: 0 admin UI, 1 reseller UI, 2 ministra, 3 **admin API**, 4 **reseller API**, 5 ministra (new), 6 player, 7 portal, 8 player_v2. Not range-checked.
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
        enabled:
          type:
            - integer
            - string
          description: Checkbox.
        groups[]:
          type: array
          items:
            type: integer
          description: Member groups allowed through this code (types 0,1,3,4 only).
        whitelist[]:
          type: array
          items:
            type: string
          description: Client IPs allowed (nginx allow/deny). Empty = no restriction. A string is stored verbatim (should be JSON).
    Admin_HmacInput:
      type: object
      additionalProperties: true
      required:
        - keygen
        - notes
      description: HMAC key (AuthService::processHMAC, src/Core/Auth/AuthService.php:122-172).
      properties:
        keygen:
          type: string
          description: Exactly 32 characters, or `HMAC KEY HIDDEN` to keep the stored key; else STATUS_NO_KEY (43). Duplicate = STATUS_EXISTS_HMAC (44). Stored encrypted.
        notes:
          type: string
          description: Required, else STATUS_NO_DESCRIPTION (42).
        enabled:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_EpgInput:
      type: object
      additionalProperties: true
      description: EPG source (EpgService::process, src/Domain/Epg/EpgService.php:31-72). The name `Created Channels` (reserved) returns STATUS_FAILURE.
      properties:
        epg_name:
          type: string
        epg_file:
          type: string
          description: XMLTV URL.
        days_keep:
          type: integer
          description: Default 7.
        offset:
          type: integer
          description: Minutes offset. Default 0.
    Admin_ProviderInput:
      type: object
      additionalProperties: true
      required:
        - name
        - ip
        - port
        - username
        - password
      description: Upstream provider (ProviderService::process, src/Domain/Stream/ProviderService.php:49-99). A missing required field = STATUS_INVALID_INPUT (34); same ip+username as another provider = STATUS_EXISTS_IP (25).
      properties:
        name:
          type: string
        ip:
          type: string
          description: Host or IP.
        port:
          type: integer
        username:
          type: string
        password:
          type: string
        enabled:
          type:
            - integer
            - string
          description: Checkbox.
        ssl:
          type:
            - integer
            - string
          description: Checkbox.
        hls:
          type:
            - integer
            - string
          description: Checkbox.
        legacy:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_GroupInput:
      type: object
      additionalProperties: true
      required:
        - group_name
      description: Member group (GroupService::process, src/Domain/User/GroupService.php:30-125). Empty group_name = STATUS_INVALID_INPUT (34). Setting is_admin or editing a reserved group as a non-full admin = STATUS_INVALID_GROUP (16). **Wrapper bug:** editGroup does not keep `require_2fa`, so an edit that omits it turns it off (AdminAPIWrapper.php:1071).
      properties:
        group_name:
          type: string
        is_admin:
          type:
            - integer
            - string
          description: Checkbox.
        is_reseller:
          type:
            - integer
            - string
          description: Checkbox.
        allow_restrictions:
          type:
            - integer
            - string
          description: Checkbox.
        create_sub_resellers:
          type:
            - integer
            - string
          description: Checkbox.
        delete_users:
          type:
            - integer
            - string
          description: Checkbox.
        allow_download:
          type:
            - integer
            - string
          description: Checkbox.
        can_view_vod:
          type:
            - integer
            - string
          description: Checkbox.
        reseller_client_connection_logs:
          type:
            - integer
            - string
          description: Checkbox.
        allow_change_bouquets:
          type:
            - integer
            - string
          description: Checkbox.
        allow_change_username:
          type:
            - integer
            - string
          description: Checkbox.
        allow_change_password:
          type:
            - integer
            - string
          description: Checkbox.
        require_2fa:
          type:
            - integer
            - string
          description: Checkbox.
        permissions_selected:
          type: string
          description: JSON array of advanced permission keys (stored as `allowed_pages`; empty list on an admin group = full admin). Required on create.
          example: '["users","edit_user","add_user"]'
        groups_selected:
          type: string
          description: JSON string, e.g. `[1,2,3]`. Groups this reseller group may create sub-resellers in (`subresellers`). Required on create.
          example: '[1,2,3]'
        packages_selected:
          type: string
          description: JSON string, e.g. `[1,2,3]`. Packages this group may sell; the group is added to / removed from each package's `groups`.
          example: '[1,2,3]'
        notice_html:
          type: string
          description: Stored through htmlentities().
        total_allowed_gen_trials:
          type: integer
        total_allowed_gen_in:
          type: string
          description: '`day`/`month`...'
        minimum_trial_credits:
          type: integer
        create_sub_resellers_price:
          type: number
        minimum_username_length:
          type: integer
        minimum_password_length:
          type: integer
    Admin_PackageInput:
      type: object
      additionalProperties: true
      required:
        - package_name
      description: Package (PackageService::process, src/Domain/Line/PackageService.php:31-82). Empty name = STATUS_INVALID_NAME (11).
      properties:
        package_name:
          type: string
        is_trial:
          type:
            - integer
            - string
          description: Checkbox.
        is_official:
          type:
            - integer
            - string
          description: Checkbox.
        is_line:
          type:
            - integer
            - string
          description: Checkbox.
        is_mag:
          type:
            - integer
            - string
          description: Checkbox.
        is_e2:
          type:
            - integer
            - string
          description: Checkbox.
        lock_device:
          type:
            - integer
            - string
          description: Checkbox.
        is_restreamer:
          type:
            - integer
            - string
          description: Checkbox.
        is_isplock:
          type:
            - integer
            - string
          description: Checkbox.
        check_compatible:
          type:
            - integer
            - string
          description: Checkbox.
        groups_selected:
          type: string
          description: JSON string, e.g. `[1,2,3]`. Member groups allowed to sell it. Required on create.
          example: '[1,2,3]'
        bouquets_selected:
          type: string
          description: JSON string, e.g. `[1,2,3]`. Bouquets granted. Required on create.
          example: '[1,2,3]'
        output_formats[]:
          type: array
          items:
            type: integer
            enum:
              - 1
              - 2
              - 3
        trial_credits:
          type: number
        official_credits:
          type: number
        trial_duration:
          type: integer
        trial_duration_in:
          type: string
          description: hours|days|months|years
          enum:
            - hours
            - days
            - months
            - years
        official_duration:
          type: integer
        official_duration_in:
          type: string
          enum:
            - hours
            - days
            - months
            - years
        max_connections:
          type: integer
        force_server_id:
          type: integer
        forced_country:
          type: string
        is_addon:
          type:
            - integer
            - string
          description: Checkbox.
        addon_packages:
          type: string
          description: JSON array of package ids.
    Admin_ProfileInput:
      type: object
      additionalProperties: true
      required:
        - profile_name
      description: Transcode profile (ProfileService::process, src/Domain/Stream/ProfileService.php:30-304). The whole profile is rebuilt from the request (the edit wrapper fills stored values). Codec/preset/profile values must match `^[A-Za-z0-9][A-Za-z0-9_.:+-]*$`, else STATUS_INVALID_INPUT (34). Empty string = not set.
      properties:
        profile_name:
          type: string
        gpu_device:
          type: string
          description: '`0`/absent = CPU; else `<x>_<n>` with n the GPU index.'
        video_codec_cpu:
          type: string
          description: e.g. libx264, copy
        preset_cpu:
          type: string
        video_profile_cpu:
          type: string
        scaling:
          type: string
        yadif_filter:
          type:
            - integer
            - string
          description: Checkbox.
        video_codec_gpu:
          type: string
          description: h264_nvenc | hevc_nvenc
        software_decoding:
          type: integer
        resize:
          type: string
        deint:
          type: integer
        preset_h264:
          type: string
        preset_hevc:
          type: string
        video_profile_h264:
          type: string
        video_profile_hevc:
          type: string
        audio_codec:
          type: string
        video_bitrate:
          type: integer
        audio_bitrate:
          type: integer
        min_tolerance:
          type: integer
        max_tolerance:
          type: integer
        buffer_size:
          type: integer
        crf_value:
          type: integer
        aspect_ratio:
          type: string
        framerate:
          type: integer
        samplerate:
          type: integer
        audio_channels:
          type: integer
        threads:
          type: integer
        logo_path:
          type: string
        logo_pos:
          type: string
          description: '`x:y`, default `10:10`.'
    Admin_RtmpIpInput:
      type: object
      additionalProperties: true
      required:
        - ip
      description: RTMP push/pull IP (BlocklistService::processRTMPIP, src/Domain/Security/BlocklistService.php:140-178). Invalid IP (hostnames rejected) = STATUS_INVALID_IP (9); duplicate = STATUS_EXISTS_IP (25).
      properties:
        ip:
          type: string
        password:
          type: string
          description: Empty = random 16 characters.
        push:
          type:
            - integer
            - string
          description: Checkbox.
        pull:
          type:
            - integer
            - string
          description: Checkbox.
        notes:
          type: string
    Admin_CategoryInput:
      type: object
      additionalProperties: true
      description: Stream category (CategoryService::process, src/Domain/Stream/CategoryService.php:71-113). No validation (missing name stored as NULL). Clears the categories cache.
      properties:
        category_name:
          type: string
        category_type:
          type: string
          enum:
            - live
            - movie
            - series
            - radio
        parent_id:
          type: integer
        is_adult:
          type:
            - integer
            - string
          description: Checkbox.
        cat_order:
          type: integer
          description: Forced to 99 on create.
    Admin_StreamInput:
      type: object
      additionalProperties: true
      description: 'Live stream (StreamService::process, src/Domain/Stream/StreamService.php:40). Any `streams` column is accepted (epg_id, channel_id, epg_lang, delay_minutes, tv_archive_server_id, tv_archive_duration, llod, probesize_ondemand, fps_threshold, ...). Errors: STATUS_NO_SOURCES (4), STATUS_INVALID_INPUT (34, `error` = source_driver_*). On create, checkbox fields are switched ON whenever the key is present (PHP isset), whatever its value: send them only to turn them on. Any other request key that matches a column of the target table is written as-is (QueryHelper::verifyPostTable, src/Core/Database/QueryHelper.php:65-110); PHP arrays (`x[]=`) are JSON-encoded and the string "null" becomes NULL. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.'
      properties:
        stream_display_name:
          type: string
          description: Title.
        bouquets[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Bouquet ids (or names; new names need `bouquet_create_list`).
        category_id[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Category ids (or names with `category_create_list`).
        bouquet_create_list:
          type: string
          description: JSON array of new bouquet names to create.
        category_create_list:
          type: string
          description: JSON array of new category names to create.
        server_tree_data:
          type: string
          description: '**Required.** JSON array of `{"id":"<serverId>","parent":"#"|"source"|"<parentServerId>"}`; `#` = load-balancer root, `source` = direct.'
          example: '[{"id":"1","parent":"source"}]'
        on_demand[]:
          type: array
          items:
            type: integer
          description: Server ids that run the stream on demand.
        restart_on_edit:
          type:
            - integer
            - string
          description: Checkbox. Restart on save.
        stream_icon:
          type: string
        notes:
          type: string
        custom_sid:
          type: string
        custom_ffmpeg:
          type: string
        stream_source[]:
          type: array
          items:
            type: string
          description: Source URLs, in failover order.
        adaptive_link[]:
          type: array
          items:
            type: integer
          description: Stream ids for adaptive playback.
        title_sync:
          type: string
          description: '`<providerId>_<streamId>` to sync the title.'
        transcode_profile_id:
          type: integer
          description: 0 = none.
        fps_restart:
          type:
            - integer
            - string
          description: Checkbox.
        gen_timestamps:
          type:
            - integer
            - string
          description: Checkbox.
        allow_record:
          type:
            - integer
            - string
          description: Checkbox.
        rtmp_output:
          type:
            - integer
            - string
          description: Checkbox.
        stream_all:
          type:
            - integer
            - string
          description: Checkbox.
        direct_source:
          type:
            - integer
            - string
          description: Checkbox.
        direct_proxy:
          type:
            - integer
            - string
          description: Checkbox.
        read_native:
          type:
            - integer
            - string
          description: Checkbox.
        force_ffmpeg:
          type:
            - integer
            - string
          description: Checkbox.
        days_to_restart[]:
          type: array
          items:
            type: string
          description: Day names for the scheduled restart.
        time_to_restart:
          type: string
          description: HH:MM
        user_agent:
          type: string
        http_proxy:
          type: string
        cookie:
          type: string
        headers:
          type: string
        force_input_acodec:
          type: string
        max_height:
          type: integer
        skip_ffprobe:
          type:
            - integer
            - string
          description: Checkbox.
        review[]:
          type: array
          items:
            type: string
          description: Bulk import review mode (panel import flow).
    Admin_ChannelInput:
      type: object
      additionalProperties: true
      description: Created channel (ChannelService::process, src/Domain/Stream/ChannelService.php:37). bouquets[], category_id[] and server_tree_data are required. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.
      properties:
        stream_display_name:
          type: string
          description: Title.
        bouquets[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Bouquet ids (or names; new names need `bouquet_create_list`).
        category_id[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Category ids (or names with `category_create_list`).
        bouquet_create_list:
          type: string
          description: JSON array of new bouquet names to create.
        category_create_list:
          type: string
          description: JSON array of new category names to create.
        server_tree_data:
          type: string
          description: '**Required.** JSON array of `{"id":"<serverId>","parent":"#"|"source"|"<parentServerId>"}`; `#` = load-balancer root, `source` = direct.'
          example: '[{"id":"1","parent":"source"}]'
        on_demand[]:
          type: array
          items:
            type: integer
          description: Server ids that run the stream on demand.
        restart_on_edit:
          type:
            - integer
            - string
          description: Checkbox. Restart on save.
        stream_icon:
          type: string
        notes:
          type: string
        custom_sid:
          type: string
        custom_ffmpeg:
          type: string
        channel_type:
          type: integer
          description: 0 = series playlist (series_no); otherwise a file playlist (video_files).
          enum:
            - 0
            - 1
        series_no:
          type: integer
          description: Series id when channel_type=0.
        video_files:
          type: string
          description: JSON array of file paths/URLs.
        transcode_profile_id:
          type: integer
          description: '-1 = symlink, 0 = none.'
        reencode_on_edit:
          type:
            - integer
            - string
          description: Checkbox.
        allow_record:
          type:
            - integer
            - string
          description: Checkbox.
        rtmp_output:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_StationInput:
      type: object
      additionalProperties: true
      required:
        - stream_display_name
      description: Radio station (RadioService::process, src/Domain/Stream/RadioService.php:36). bouquets[] required. On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.
      properties:
        stream_display_name:
          type: string
          description: Title.
        bouquets[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Bouquet ids (or names; new names need `bouquet_create_list`).
        category_id[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Category ids (or names with `category_create_list`).
        bouquet_create_list:
          type: string
          description: JSON array of new bouquet names to create.
        category_create_list:
          type: string
          description: JSON array of new category names to create.
        server_tree_data:
          type: string
          description: '**Required.** JSON array of `{"id":"<serverId>","parent":"#"|"source"|"<parentServerId>"}`; `#` = load-balancer root, `source` = direct.'
          example: '[{"id":"1","parent":"source"}]'
        on_demand[]:
          type: array
          items:
            type: integer
          description: Server ids that run the stream on demand.
        restart_on_edit:
          type:
            - integer
            - string
          description: Checkbox. Restart on save.
        stream_icon:
          type: string
        notes:
          type: string
        custom_sid:
          type: string
        custom_ffmpeg:
          type: string
        stream_source[]:
          type: array
          items:
            type: string
        direct_source:
          type:
            - integer
            - string
          description: Checkbox.
        probesize_ondemand:
          type: integer
          description: Default 128000.
    Admin_MovieInput:
      type: object
      additionalProperties: true
      description: Movie (MovieService::process, src/Domain/Vod/MovieService.php:41). Metadata fields are stored in `movie_properties` (JSON). On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.
      properties:
        stream_display_name:
          type: string
          description: Title.
        bouquets[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Bouquet ids (or names; new names need `bouquet_create_list`).
        category_id[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Category ids (or names with `category_create_list`).
        bouquet_create_list:
          type: string
          description: JSON array of new bouquet names to create.
        category_create_list:
          type: string
          description: JSON array of new category names to create.
        server_tree_data:
          type: string
          description: '**Required.** JSON array of `{"id":"<serverId>","parent":"#"|"source"|"<parentServerId>"}`; `#` = load-balancer root, `source` = direct.'
          example: '[{"id":"1","parent":"source"}]'
        on_demand[]:
          type: array
          items:
            type: integer
          description: Server ids that run the stream on demand.
        restart_on_edit:
          type:
            - integer
            - string
          description: Checkbox. Restart on save.
        stream_icon:
          type: string
        notes:
          type: string
        custom_sid:
          type: string
        custom_ffmpeg:
          type: string
        stream_source:
          type: string
          description: Single source URL/path (a string, not an array).
        target_container:
          type: string
          description: mp4|mkv|...
        year:
          type: integer
          description: 1900..next year.
        movie_subtitles[]:
          type: array
          items:
            type: string
          description: '`s:<serverId>:<path>` entries.'
        read_native:
          type:
            - integer
            - string
          description: Checkbox.
        movie_symlink:
          type:
            - integer
            - string
          description: Checkbox.
        direct_source:
          type:
            - integer
            - string
          description: Checkbox.
        direct_proxy:
          type:
            - integer
            - string
          description: Checkbox.
        remove_subtitles:
          type:
            - integer
            - string
          description: Checkbox.
        transcode_profile_id:
          type: integer
        movie_image:
          type: string
        release_date:
          type: string
        episode_run_time:
          type: integer
        youtube_trailer:
          type: string
        director:
          type: string
        cast:
          type: string
        plot:
          type: string
        country:
          type: string
        genre:
          type: string
        rating:
          type:
            - number
            - string
        tmdb_id:
          type: integer
    Admin_EpisodeInput:
      type: object
      additionalProperties: true
      description: Episode (EpisodeService::process, src/Domain/Vod/EpisodeService.php:35). On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.
      properties:
        series:
          type: integer
          description: Series id.
        season_num:
          type: integer
        episode:
          type: integer
          description: Episode number.
        stream_display_name:
          type: string
        stream_source:
          type: string
          description: Single source URL/path.
        target_container:
          type: string
        movie_subtitles[]:
          type: array
          items:
            type: string
        server_tree_data:
          type: string
          description: '**Required.** JSON array of `{"id":"<serverId>","parent":"#"|"source"|"<parentServerId>"}`; `#` = load-balancer root, `source` = direct.'
          example: '[{"id":"1","parent":"source"}]'
        read_native:
          type:
            - integer
            - string
          description: Checkbox.
        movie_symlink:
          type:
            - integer
            - string
          description: Checkbox.
        direct_source:
          type:
            - integer
            - string
          description: Checkbox.
        direct_proxy:
          type:
            - integer
            - string
          description: Checkbox.
        remove_subtitles:
          type:
            - integer
            - string
          description: Checkbox.
        transcode_profile_id:
          type: integer
        movie_image:
          type: string
        episode_run_time:
          type: integer
        release_date:
          type: string
        plot:
          type: string
        rating:
          type:
            - number
            - string
        tmdb_id:
          type: integer
    Admin_SeriesInput:
      type: object
      additionalProperties: true
      required:
        - title
      description: Series (SeriesService::process, src/Domain/Vod/SeriesService.php:36). On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.
      properties:
        title:
          type: string
          description: Required.
        category_id[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Category ids (or names with `category_create_list`).
        bouquets[]:
          type: array
          items:
            type:
              - integer
              - string
          description: Bouquet ids (or names; new names need `bouquet_create_list`).
        cover:
          type: string
        backdrop_path:
          type: string
        genre:
          type: string
        plot:
          type: string
        cast:
          type: string
        rating:
          type:
            - number
            - string
        director:
          type: string
        release_date:
          type: string
        tmdb_id:
          type: integer
        seasons:
          type: string
        episode_run_time:
          type: integer
        youtube_trailer:
          type: string
        tmdb_language:
          type: string
        year:
          type: integer
    Admin_ServerInstallInput:
      type: object
      additionalProperties: true
      required:
        - ssh_port
        - root_username
        - root_password
      description: Install a load balancer (install_server) or proxy (install_proxy) over SSH (ServerService::install, src/Domain/Server/ServerService.php:357). The controller forces `type` (2 server, 1 proxy). Missing ssh_port/root_username/root_password = `{"status":"STATUS_INVALID_INPUT"}`; invalid IP = STATUS_INVALID_IP (9); existing IP = STATUS_EXISTS_IP (25).
      properties:
        server_name:
          type: string
        server_ip:
          type: string
        ssh_port:
          type: integer
          default: 22
        root_username:
          type: string
        root_password:
          type: string
        http_broadcast_port:
          type: integer
        https_broadcast_port:
          type: integer
        parent_id:
          type: string
          description: 'Proxy only: JSON array of parent server ids.'
        update_sysctl:
          type:
            - integer
            - string
          description: Checkbox.
        use_private_ip:
          type:
            - integer
            - string
          description: Checkbox.
        expected_hostkey:
          type: string
          description: Pinned SSH host key fingerprint.
        forget_hostkey:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_ServerEditInput:
      type: object
      additionalProperties: true
      description: 'Streaming server edit (ServerService::process, src/Domain/Server/ServerService.php:37). Errors: STATUS_INVALID_IP (9), STATUS_PORT_IN_USE (49), STATUS_INVALID_INPUT (34). On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.'
      properties:
        server_name:
          type: string
        server_ip:
          type: string
        private_ip:
          type: string
        domain_name[]:
          type: array
          items:
            type: string
        http_broadcast_ports[]:
          type: array
          items:
            type: integer
        https_broadcast_ports[]:
          type: array
          items:
            type: integer
        rtmp_port:
          type: integer
        geoip_countries[]:
          type: array
          items:
            type: string
        isp_names[]:
          type: array
          items:
            type: string
        total_services:
          type: integer
        governor:
          type: string
        sysctl:
          type: string
        network_guaranteed_speed:
          type: integer
        enable_gzip:
          type:
            - integer
            - string
          description: Checkbox.
        timeshift_only:
          type:
            - integer
            - string
          description: Checkbox.
        enable_https:
          type:
            - integer
            - string
          description: Checkbox.
        random_ip:
          type:
            - integer
            - string
          description: Checkbox.
        enable_geoip:
          type:
            - integer
            - string
          description: Checkbox.
        enable_isp:
          type:
            - integer
            - string
          description: Checkbox.
        enabled:
          type:
            - integer
            - string
          description: Checkbox.
        enable_proxy:
          type:
            - integer
            - string
          description: Checkbox.
        disable_ramdisk:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_ProxyEditInput:
      type: object
      additionalProperties: true
      description: Proxy server edit (ServerService::processProxy, src/Domain/Server/ServerService.php:290). On edit the API wrapper fills every field the request leaves out from the stored row (AdminAPIWrapper::keepFields / keepLineFields, src/Public/Controllers/Api/AdminAPIWrapper.php:186-292), so a partial update is safe; checkbox switches are on for any non-empty value other than 0 and off for `0` or `""`.
      properties:
        server_name:
          type: string
        server_ip:
          type: string
        domain_name[]:
          type: array
          items:
            type: string
        geoip_countries[]:
          type: array
          items:
            type: string
        enable_https:
          type:
            - integer
            - string
          description: Checkbox.
        random_ip:
          type:
            - integer
            - string
          description: Checkbox.
        enable_geoip:
          type:
            - integer
            - string
          description: Checkbox.
        enabled:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_SettingsInput:
      type: object
      additionalProperties: true
      description: Panel settings (SettingsService::edit, src/Domain/Server/SettingsService.php:222). Any `settings` column is accepted (about 140 checkbox settings plus text/number ones); the wrapper keeps every column the request omits (AdminAPIWrapper::keepSettings). Also `genre_<id>` + `bouquet_<id>[]` and `genretv_<id>` + `bouquettv_<id>[]` for watch-folder genre mappings, and default stream arguments `user_agent`, `http_proxy`, `cookie`, `headers`. Cluster validation errors = STATUS_INVALID_DATA (17) with `message`.
      properties:
        server_name:
          type: string
        default_timezone:
          type: string
        live_streaming_pass:
          type: string
        user_agent:
          type: string
        http_proxy:
          type: string
        cookie:
          type: string
        headers:
          type: string
    Admin_BlockedUaInput:
      type: object
      additionalProperties: true
      description: Blocked user agent (BlocklistService::processUA, src/Domain/Security/BlocklistService.php:187-218).
      properties:
        user_agent:
          type: string
          description: User-agent string.
        exact_match:
          type:
            - integer
            - string
          description: Checkbox.
    Admin_ActiveCodeEdit:
      type: object
      additionalProperties: true
      description: Active code edit (ActiveCodeService::updateCode, src/Domain/Line/ActiveCodeService.php:884).
      properties:
        activation_code:
          type: string
          description: New code string (must be unique).
        package_id:
          type: integer
        status:
          type: integer
          description: 0 disabled, 1 stock, 2 redeemed.
          enum:
            - 0
            - 1
            - 2
        mac:
          type: string
        device_id:
          type: string
        password:
          type: string
          description: Streaming password of the backing line.
        batch_name:
          type: string
        max_connections:
          type: integer
        exp_date:
          type: string
          description: Date or timestamp; empty = no expiry.
    Admin_LineRow:
      type: object
      description: '`lines` row (UserRepository::getLineById). `exp_date` is a unix timestamp string or null (never expires); `bouquet`, `allowed_outputs`, `allowed_ips`, `allowed_ua` are JSON strings. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        member_id:
          type:
            - string
            - integer
            - 'null'
        username:
          type:
            - string
            - integer
            - 'null'
        password:
          type:
            - string
            - integer
            - 'null'
        last_ip:
          type:
            - string
            - integer
            - 'null'
        exp_date:
          type:
            - string
            - integer
            - 'null'
        admin_enabled:
          type:
            - string
            - integer
            - 'null'
        enabled:
          type:
            - string
            - integer
            - 'null'
        admin_notes:
          type:
            - string
            - integer
            - 'null'
        reseller_notes:
          type:
            - string
            - integer
            - 'null'
        bouquet:
          type:
            - string
            - integer
            - 'null'
        bouquet_order_custom:
          type:
            - string
            - integer
            - 'null'
        allowed_outputs:
          type:
            - string
            - integer
            - 'null'
        max_connections:
          type:
            - string
            - integer
            - 'null'
        is_restreamer:
          type:
            - string
            - integer
            - 'null'
        is_trial:
          type:
            - string
            - integer
            - 'null'
        is_mag:
          type:
            - string
            - integer
            - 'null'
        is_e2:
          type:
            - string
            - integer
            - 'null'
        is_stalker:
          type:
            - string
            - integer
            - 'null'
        is_isplock:
          type:
            - string
            - integer
            - 'null'
        allowed_ips:
          type:
            - string
            - integer
            - 'null'
        allowed_ua:
          type:
            - string
            - integer
            - 'null'
        created_at:
          type:
            - string
            - integer
            - 'null'
        pair_id:
          type:
            - string
            - integer
            - 'null'
        force_server_id:
          type:
            - string
            - integer
            - 'null'
        as_number:
          type:
            - string
            - integer
            - 'null'
        isp_desc:
          type:
            - string
            - integer
            - 'null'
        forced_country:
          type:
            - string
            - integer
            - 'null'
        bypass_ua:
          type:
            - string
            - integer
            - 'null'
        play_token:
          type:
            - string
            - integer
            - 'null'
        last_expiration_video:
          type:
            - string
            - integer
            - 'null'
        package_id:
          type:
            - string
            - integer
            - 'null'
        access_token:
          type:
            - string
            - integer
            - 'null'
        contact:
          type:
            - string
            - integer
            - 'null'
        telegram:
          type:
            - string
            - integer
            - 'null'
        last_activity:
          type:
            - string
            - integer
            - 'null'
        last_activity_array:
          type:
            - string
            - integer
            - 'null'
        updated:
          type:
            - string
            - integer
            - 'null'
        is_activecode:
          type:
            - string
            - integer
            - 'null'
        custom_data:
          type:
            - string
            - integer
            - 'null'
    Admin_UserRow:
      type: object
      description: '`users` row (UserRepository::getRegisteredUserById) without `password`; `api_key` only on your own row. `credits` is normalised to a number. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        username:
          type:
            - string
            - integer
            - 'null'
        email:
          type:
            - string
            - integer
            - 'null'
        ip:
          type:
            - string
            - integer
            - 'null'
        date_registered:
          type:
            - string
            - integer
            - 'null'
        last_login:
          type:
            - string
            - integer
            - 'null'
        member_group_id:
          type:
            - string
            - integer
            - 'null'
        credits:
          type: number
        notes:
          type:
            - string
            - integer
            - 'null'
        status:
          type:
            - string
            - integer
            - 'null'
        reseller_dns:
          type:
            - string
            - integer
            - 'null'
        owner_id:
          type:
            - string
            - integer
            - 'null'
        override_packages:
          type:
            - string
            - integer
            - 'null'
        hue:
          type:
            - string
            - integer
            - 'null'
        theme:
          type:
            - string
            - integer
            - 'null'
        timezone:
          type:
            - string
            - integer
            - 'null'
        api_key:
          type:
            - string
            - integer
            - 'null'
        lang:
          type:
            - string
            - integer
            - 'null'
        allowed_bouquets:
          type:
            - string
            - integer
            - 'null'
        ui_prefs:
          type:
            - string
            - integer
            - 'null'
    Admin_MagRow:
      type: object
      description: '`mag_devices` row (about 80 STB columns) plus `user` (backing line row) and `paired` (paired line row or null) (MagService::getById). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        mag_id:
          type:
            - string
            - integer
            - 'null'
        user_id:
          type:
            - string
            - integer
            - 'null'
        mac:
          type:
            - string
            - integer
            - 'null'
        ip:
          type:
            - string
            - integer
            - 'null'
        ver:
          type:
            - string
            - integer
            - 'null'
        stb_type:
          type:
            - string
            - integer
            - 'null'
        sn:
          type:
            - string
            - integer
            - 'null'
        image_version:
          type:
            - string
            - integer
            - 'null'
        hw_version:
          type:
            - string
            - integer
            - 'null'
        device_id:
          type:
            - string
            - integer
            - 'null'
        device_id2:
          type:
            - string
            - integer
            - 'null'
        lock_device:
          type:
            - string
            - integer
            - 'null'
        theme_type:
          type:
            - string
            - integer
            - 'null'
        mac_filter:
          type:
            - string
            - integer
            - 'null'
        parent_password:
          type:
            - string
            - integer
            - 'null'
        fav_channels:
          type:
            - string
            - integer
            - 'null'
        user:
          type:
            - object
            - 'null'
        paired:
          type:
            - object
            - 'null'
    Admin_EnigmaRow:
      type: object
      description: '`enigma2_devices` row plus `user` and `paired` (EnigmaService::getById). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        device_id:
          type:
            - string
            - integer
            - 'null'
        mac:
          type:
            - string
            - integer
            - 'null'
        user_id:
          type:
            - string
            - integer
            - 'null'
        modem_mac:
          type:
            - string
            - integer
            - 'null'
        local_ip:
          type:
            - string
            - integer
            - 'null'
        public_ip:
          type:
            - string
            - integer
            - 'null'
        key_auth:
          type:
            - string
            - integer
            - 'null'
        enigma_version:
          type:
            - string
            - integer
            - 'null'
        cpu:
          type:
            - string
            - integer
            - 'null'
        version:
          type:
            - string
            - integer
            - 'null'
        lversion:
          type:
            - string
            - integer
            - 'null'
        token:
          type:
            - string
            - integer
            - 'null'
        last_updated:
          type:
            - string
            - integer
            - 'null'
        watchdog_timeout:
          type:
            - string
            - integer
            - 'null'
        lock_device:
          type:
            - string
            - integer
            - 'null'
        telnet_enable:
          type:
            - string
            - integer
            - 'null'
        ftp_enable:
          type:
            - string
            - integer
            - 'null'
        ssh_enable:
          type:
            - string
            - integer
            - 'null'
        dns:
          type:
            - string
            - integer
            - 'null'
        original_mac:
          type:
            - string
            - integer
            - 'null'
        rc:
          type:
            - string
            - integer
            - 'null'
        mac_filter:
          type:
            - string
            - integer
            - 'null'
        user:
          type:
            - object
            - 'null'
        paired:
          type:
            - object
            - 'null'
    Admin_StreamRow:
      type: object
      description: '`streams` row (StreamRepository::getById). `type`: 1 live, 2 movie, 3 created channel, 4 radio, 5 episode. `category_id`, `stream_source`, `movie_properties` are JSON strings. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        type:
          type:
            - string
            - integer
            - 'null'
        category_id:
          type:
            - string
            - integer
            - 'null'
        stream_display_name:
          type:
            - string
            - integer
            - 'null'
        stream_source:
          type:
            - string
            - integer
            - 'null'
        stream_icon:
          type:
            - string
            - integer
            - 'null'
        notes:
          type:
            - string
            - integer
            - 'null'
        enable_transcode:
          type:
            - string
            - integer
            - 'null'
        transcode_attributes:
          type:
            - string
            - integer
            - 'null'
        custom_ffmpeg:
          type:
            - string
            - integer
            - 'null'
        movie_properties:
          type:
            - string
            - integer
            - 'null'
        movie_subtitles:
          type:
            - string
            - integer
            - 'null'
        read_native:
          type:
            - string
            - integer
            - 'null'
        target_container:
          type:
            - string
            - integer
            - 'null'
        stream_all:
          type:
            - string
            - integer
            - 'null'
        remove_subtitles:
          type:
            - string
            - integer
            - 'null'
        custom_sid:
          type:
            - string
            - integer
            - 'null'
        epg_id:
          type:
            - string
            - integer
            - 'null'
        channel_id:
          type:
            - string
            - integer
            - 'null'
        epg_lang:
          type:
            - string
            - integer
            - 'null'
        order:
          type:
            - string
            - integer
            - 'null'
        auto_restart:
          type:
            - string
            - integer
            - 'null'
        transcode_profile_id:
          type:
            - string
            - integer
            - 'null'
        gen_timestamps:
          type:
            - string
            - integer
            - 'null'
        added:
          type:
            - string
            - integer
            - 'null'
        series_no:
          type:
            - string
            - integer
            - 'null'
        direct_source:
          type:
            - string
            - integer
            - 'null'
        tv_archive_duration:
          type:
            - string
            - integer
            - 'null'
        tv_archive_server_id:
          type:
            - string
            - integer
            - 'null'
        tv_archive_pid:
          type:
            - string
            - integer
            - 'null'
        vframes_server_id:
          type:
            - string
            - integer
            - 'null'
        vframes_pid:
          type:
            - string
            - integer
            - 'null'
        movie_symlink:
          type:
            - string
            - integer
            - 'null'
        rtmp_output:
          type:
            - string
            - integer
            - 'null'
        allow_record:
          type:
            - string
            - integer
            - 'null'
        probesize_ondemand:
          type:
            - string
            - integer
            - 'null'
        custom_map:
          type:
            - string
            - integer
            - 'null'
        external_push:
          type:
            - string
            - integer
            - 'null'
        delay_minutes:
          type:
            - string
            - integer
            - 'null'
        tmdb_language:
          type:
            - string
            - integer
            - 'null'
        llod:
          type:
            - string
            - integer
            - 'null'
        year:
          type:
            - string
            - integer
            - 'null'
        rating:
          type:
            - string
            - integer
            - 'null'
        plex_uuid:
          type:
            - string
            - integer
            - 'null'
        uuid:
          type:
            - string
            - integer
            - 'null'
        epg_offset:
          type:
            - string
            - integer
            - 'null'
        updated:
          type:
            - string
            - integer
            - 'null'
        similar:
          type:
            - string
            - integer
            - 'null'
        tmdb_id:
          type:
            - string
            - integer
            - 'null'
        adaptive_link:
          type:
            - string
            - integer
            - 'null'
        title_sync:
          type:
            - string
            - integer
            - 'null'
        fps_restart:
          type:
            - string
            - integer
            - 'null'
        fps_threshold:
          type:
            - string
            - integer
            - 'null'
        direct_proxy:
          type:
            - string
            - integer
            - 'null'
        force_ffmpeg:
          type:
            - string
            - integer
            - 'null'
    Admin_SeriesRow:
      type: object
      description: '`streams_series` row (SeriesService::getById). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        title:
          type:
            - string
            - integer
            - 'null'
        category_id:
          type:
            - string
            - integer
            - 'null'
        cover:
          type:
            - string
            - integer
            - 'null'
        cover_big:
          type:
            - string
            - integer
            - 'null'
        genre:
          type:
            - string
            - integer
            - 'null'
        plot:
          type:
            - string
            - integer
            - 'null'
        cast:
          type:
            - string
            - integer
            - 'null'
        rating:
          type:
            - string
            - integer
            - 'null'
        director:
          type:
            - string
            - integer
            - 'null'
        release_date:
          type:
            - string
            - integer
            - 'null'
        last_modified:
          type:
            - string
            - integer
            - 'null'
        tmdb_id:
          type:
            - string
            - integer
            - 'null'
        seasons:
          type:
            - string
            - integer
            - 'null'
        episode_run_time:
          type:
            - string
            - integer
            - 'null'
        backdrop_path:
          type:
            - string
            - integer
            - 'null'
        youtube_trailer:
          type:
            - string
            - integer
            - 'null'
        tmdb_language:
          type:
            - string
            - integer
            - 'null'
        year:
          type:
            - string
            - integer
            - 'null'
        plex_uuid:
          type:
            - string
            - integer
            - 'null'
        similar:
          type:
            - string
            - integer
            - 'null'
    Admin_ServerRow:
      type: object
      description: '`servers` row without `php_pids` (ServerRepository::getById). get_servers rows add `server_online` (boolean) and `order`. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        server_type:
          type:
            - string
            - integer
            - 'null'
        xc_vm_version:
          type:
            - string
            - integer
            - 'null'
        server_name:
          type:
            - string
            - integer
            - 'null'
        domain_name:
          type:
            - string
            - integer
            - 'null'
        server_ip:
          type:
            - string
            - integer
            - 'null'
        private_ip:
          type:
            - string
            - integer
            - 'null'
        is_main:
          type:
            - string
            - integer
            - 'null'
        enabled:
          type:
            - string
            - integer
            - 'null'
        parent_id:
          type:
            - string
            - integer
            - 'null'
        http_broadcast_port:
          type:
            - string
            - integer
            - 'null'
        https_broadcast_port:
          type:
            - string
            - integer
            - 'null'
        http_ports_add:
          type:
            - string
            - integer
            - 'null'
        https_ports_add:
          type:
            - string
            - integer
            - 'null'
        total_clients:
          type:
            - string
            - integer
            - 'null'
        network_interface:
          type:
            - string
            - integer
            - 'null'
        status:
          type:
            - string
            - integer
            - 'null'
        enable_geoip:
          type:
            - string
            - integer
            - 'null'
        geoip_countries:
          type:
            - string
            - integer
            - 'null'
        last_check_ago:
          type:
            - string
            - integer
            - 'null'
        server_hardware:
          type:
            - string
            - integer
            - 'null'
        total_services:
          type:
            - string
            - integer
            - 'null'
        rtmp_port:
          type:
            - string
            - integer
            - 'null'
        isp_names:
          type:
            - string
            - integer
            - 'null'
        enable_isp:
          type:
            - string
            - integer
            - 'null'
        network_guaranteed_speed:
          type:
            - string
            - integer
            - 'null'
        timeshift_only:
          type:
            - string
            - integer
            - 'null'
        random_ip:
          type:
            - string
            - integer
            - 'null'
        enable_proxy:
          type:
            - string
            - integer
            - 'null'
        enable_https:
          type:
            - string
            - integer
            - 'null'
        uuid:
          type:
            - string
            - integer
            - 'null'
        requests_per_second:
          type:
            - string
            - integer
            - 'null'
        connections:
          type:
            - string
            - integer
            - 'null'
        users:
          type:
            - string
            - integer
            - 'null'
        governor:
          type:
            - string
            - integer
            - 'null'
        order:
          type:
            - string
            - integer
            - 'null'
        enable_gzip:
          type:
            - string
            - integer
            - 'null'
        server_online:
          type: boolean
    Admin_BouquetRow:
      type: object
      description: '`bouquets` row. The four list columns are JSON strings (usually lists, possibly objects). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        bouquet_name:
          type:
            - string
            - integer
            - 'null'
        bouquet_channels:
          type:
            - string
            - integer
            - 'null'
        bouquet_movies:
          type:
            - string
            - integer
            - 'null'
        bouquet_radios:
          type:
            - string
            - integer
            - 'null'
        bouquet_series:
          type:
            - string
            - integer
            - 'null'
        bouquet_order:
          type:
            - string
            - integer
            - 'null'
    Admin_AccessCodeRow:
      type: object
      description: '`access_codes` row. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        code:
          type:
            - string
            - integer
            - 'null'
        type:
          type:
            - string
            - integer
            - 'null'
        enabled:
          type:
            - string
            - integer
            - 'null'
        groups:
          type:
            - string
            - integer
            - 'null'
        whitelist:
          type:
            - string
            - integer
            - 'null'
    Admin_HmacRow:
      type: object
      description: '`hmac_keys` row (`key` is stored encrypted). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        key:
          type:
            - string
            - integer
            - 'null'
        notes:
          type:
            - string
            - integer
            - 'null'
        enabled:
          type:
            - string
            - integer
            - 'null'
    Admin_EpgRow:
      type: object
      description: '`epg` row; `data` is the parsed channel list (JSON string, can be large). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        epg_name:
          type:
            - string
            - integer
            - 'null'
        epg_file:
          type:
            - string
            - integer
            - 'null'
        last_updated:
          type:
            - string
            - integer
            - 'null'
        days_keep:
          type:
            - string
            - integer
            - 'null'
        offset:
          type:
            - string
            - integer
            - 'null'
        data:
          type:
            - string
            - integer
            - 'null'
    Admin_ProviderRow:
      type: object
      description: '`providers` row. **Contains the provider password in plain text.** `data` is the cron-fetched catalogue (JSON string). Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        name:
          type:
            - string
            - integer
            - 'null'
        ip:
          type:
            - string
            - integer
            - 'null'
        port:
          type:
            - string
            - integer
            - 'null'
        username:
          type:
            - string
            - integer
            - 'null'
        password:
          type:
            - string
            - integer
            - 'null'
        last_changed:
          type:
            - string
            - integer
            - 'null'
        legacy:
          type:
            - string
            - integer
            - 'null'
        enabled:
          type:
            - string
            - integer
            - 'null'
        status:
          type:
            - string
            - integer
            - 'null'
        ssl:
          type:
            - string
            - integer
            - 'null'
        hls:
          type:
            - string
            - integer
            - 'null'
        data:
          type:
            - string
            - integer
            - 'null'
    Admin_GroupRow:
      type: object
      description: '`users_groups` row. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        group_id:
          type:
            - string
            - integer
            - 'null'
        group_name:
          type:
            - string
            - integer
            - 'null'
        is_admin:
          type:
            - string
            - integer
            - 'null'
        is_reseller:
          type:
            - string
            - integer
            - 'null'
        total_allowed_gen_trials:
          type:
            - string
            - integer
            - 'null'
        total_allowed_gen_in:
          type:
            - string
            - integer
            - 'null'
        delete_users:
          type:
            - string
            - integer
            - 'null'
        allowed_pages:
          type:
            - string
            - integer
            - 'null'
        can_delete:
          type:
            - string
            - integer
            - 'null'
        create_sub_resellers:
          type:
            - string
            - integer
            - 'null'
        create_sub_resellers_price:
          type:
            - string
            - integer
            - 'null'
        reseller_client_connection_logs:
          type:
            - string
            - integer
            - 'null'
        can_view_vod:
          type:
            - string
            - integer
            - 'null'
        allow_download:
          type:
            - string
            - integer
            - 'null'
        minimum_trial_credits:
          type:
            - string
            - integer
            - 'null'
        allow_restrictions:
          type:
            - string
            - integer
            - 'null'
        allow_change_username:
          type:
            - string
            - integer
            - 'null'
        allow_change_password:
          type:
            - string
            - integer
            - 'null'
        minimum_username_length:
          type:
            - string
            - integer
            - 'null'
        minimum_password_length:
          type:
            - string
            - integer
            - 'null'
        allow_change_bouquets:
          type:
            - string
            - integer
            - 'null'
        notice_html:
          type:
            - string
            - integer
            - 'null'
        subresellers:
          type:
            - string
            - integer
            - 'null'
        require_2fa:
          type:
            - string
            - integer
            - 'null'
    Admin_PackageRow:
      type: object
      description: '`users_packages` row. Credits columns are normalised to numbers. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        package_name:
          type:
            - string
            - integer
            - 'null'
        is_addon:
          type:
            - string
            - integer
            - 'null'
        is_trial:
          type:
            - string
            - integer
            - 'null'
        is_official:
          type:
            - string
            - integer
            - 'null'
        trial_credits:
          type: number
        official_credits:
          type: number
        trial_duration:
          type:
            - string
            - integer
            - 'null'
        trial_duration_in:
          type:
            - string
            - integer
            - 'null'
        official_duration:
          type:
            - string
            - integer
            - 'null'
        official_duration_in:
          type:
            - string
            - integer
            - 'null'
        groups:
          type:
            - string
            - integer
            - 'null'
        bouquets:
          type:
            - string
            - integer
            - 'null'
        addon_packages:
          type:
            - string
            - integer
            - 'null'
        is_line:
          type:
            - string
            - integer
            - 'null'
        is_mag:
          type:
            - string
            - integer
            - 'null'
        is_e2:
          type:
            - string
            - integer
            - 'null'
        is_restreamer:
          type:
            - string
            - integer
            - 'null'
        is_isplock:
          type:
            - string
            - integer
            - 'null'
        output_formats:
          type:
            - string
            - integer
            - 'null'
        max_connections:
          type:
            - string
            - integer
            - 'null'
        force_server_id:
          type:
            - string
            - integer
            - 'null'
        forced_country:
          type:
            - string
            - integer
            - 'null'
        lock_device:
          type:
            - string
            - integer
            - 'null'
        check_compatible:
          type:
            - string
            - integer
            - 'null'
    Admin_ProfileRow:
      type: object
      description: '`profiles` row; `profile_options` is a JSON string of ffmpeg options. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        profile_id:
          type:
            - string
            - integer
            - 'null'
        profile_name:
          type:
            - string
            - integer
            - 'null'
        profile_options:
          type:
            - string
            - integer
            - 'null'
    Admin_RtmpIpRow:
      type: object
      description: '`rtmp_ips` row. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        ip:
          type:
            - string
            - integer
            - 'null'
        password:
          type:
            - string
            - integer
            - 'null'
        notes:
          type:
            - string
            - integer
            - 'null'
        push:
          type:
            - string
            - integer
            - 'null'
        pull:
          type:
            - string
            - integer
            - 'null'
    Admin_CategoryRow:
      type: object
      description: '`streams_categories` row. Raw DB row cleaned by get_row(): non-zero values arrive as strings (numbers included), falsy values (0, "", null) keep their type, `<`/`>` become `&lt;`/`&gt;`, text is trimmed. JSON columns are JSON-encoded strings.'
      additionalProperties: true
      properties:
        id:
          type:
            - string
            - integer
            - 'null'
        category_type:
          type:
            - string
            - integer
            - 'null'
        category_name:
          type:
            - string
            - integer
            - 'null'
        parent_id:
          type:
            - string
            - integer
            - 'null'
        cat_order:
          type:
            - string
            - integer
            - 'null'
        is_adult:
          type:
            - string
            - integer
            - 'null'
    Admin_BlockedUaRow:
      type: object
      description: '`blocked_uas` row (raw; numbers as strings).'
      additionalProperties: true
      properties:
        id:
          type: string
        user_agent:
          type: string
        exact_match:
          type:
            - string
            - integer
        attempts_blocked:
          type:
            - string
            - integer
    Admin_BlockedIpRow:
      type: object
      description: '`blocked_ips` row (raw; numbers as strings).'
      additionalProperties: true
      properties:
        id:
          type: string
        ip:
          type: string
        notes:
          type: string
        date:
          type:
            - string
            - integer
        attempts_blocked:
          type:
            - string
            - integer
tags:
  - name: Admin API
    description: |-
      **Routing.** Create an access code of type 3 (Admin API) on the Access Codes page. nginx (src/bin/nginx/conf/codes/template) routes every request under `/<code>/` to src/Public/index.php with XC_SCOPE=includes/api/admin; index.php resolves the code (src/Public/index.php:117-135, src/Core/Auth/AuthRepository.php:115-135) and runs the controller. The rest of the path is ignored. Parameters may be sent as query string or form-encoded POST (merged; POST wins; src/Core/Init/LegacyInitializer.php:57-58). Every operation in this tag is `/{code}/?action=<name>`; the HTTP method shown is a suggestion, both work.

      **Authentication.** `api_key` is either a named API token (`xct_` + 40 hex, created per user in the panel; stored as a SHA-256 hash in `api_tokens` with scope full/read/lines, optional allow_sql, IP allow-list and expiry; last_used is updated) or, while setting `api_legacy_keys` is not '0', the user's legacy `users.api_key` (32 hex). The key's user must have status=1 and belong to a group with is_admin=1 (src/Core/Auth/ApiTokens.php:47-93). Token scopes: `full` = everything the group may do; `read` = every get_* action plus user_info, packages, the log tables, check_active_code and export_active_code_batch; `lines` = user_info, packages, get_packages, get_package, get_bouquets, get_bouquet, any *active_code* action, and any action named `<verb>_line(s)|mag(s)|enigma(s)`. A scope refusal is `{"status":"STATUS_NO_PERMISSIONS"}`. Legacy keys are not scope-limited. The access code's own whitelist (if set) is enforced by nginx (allow/deny), before PHP (src/Core/Auth/AuthRepository.php:157-166).

      **Envelope.** Every reply is JSON with HTTP 200 (exceptions: a PHP TypeError gives HTTP 500 with an empty body; noted per operation). `status` is a constant name; services return numeric codes that parseError() maps to names: 0 STATUS_FAILURE, 1 STATUS_SUCCESS, 2 STATUS_SUCCESS_MULTI, 3 STATUS_CODE_LENGTH, 4 STATUS_NO_SOURCES, 5 STATUS_DISABLED, 6 STATUS_NOT_ADMIN, 7 STATUS_INVALID_EMAIL, 8 STATUS_INVALID_PASSWORD, 9 STATUS_INVALID_IP, 10 STATUS_INVALID_PLAYLIST, 11 STATUS_INVALID_NAME, 12 STATUS_INVALID_CAPTCHA, 13 STATUS_INVALID_CODE, 14 STATUS_INVALID_DATE, 15 STATUS_INVALID_FILE, 16 STATUS_INVALID_GROUP, 17 STATUS_INVALID_DATA, 18 STATUS_INVALID_DIR, 19 STATUS_INVALID_MAC, 20 STATUS_EXISTS_CODE, 21 STATUS_EXISTS_NAME, 22 STATUS_EXISTS_USERNAME, 23 STATUS_EXISTS_MAC, 24 STATUS_EXISTS_SOURCE, 25 STATUS_EXISTS_IP, 26 STATUS_EXISTS_DIR, 27 STATUS_SUCCESS_REPLACE, 28 STATUS_FLUSH, 29 STATUS_TOO_MANY_RESULTS, 30 STATUS_SPACE_ISSUE, 31 STATUS_INVALID_USER, 32 STATUS_CERTBOT, 33 STATUS_CERTBOT_INVALID, 34 STATUS_INVALID_INPUT, 35 STATUS_NOT_RESELLER, 36 STATUS_NO_TRIALS, 37 STATUS_INSUFFICIENT_CREDITS, 38 STATUS_INVALID_PACKAGE, 39 STATUS_INVALID_TYPE, 40 STATUS_INVALID_USERNAME, 41 STATUS_INVALID_SUBRESELLER, 42 STATUS_NO_DESCRIPTION, 43 STATUS_NO_KEY, 44 STATUS_EXISTS_HMAC, 45 STATUS_CERTBOT_RUNNING, 46 STATUS_RESERVED_CODE, 47 STATUS_NO_TITLE, 48 STATUS_NO_SOURCE, 49 STATUS_PORT_IN_USE, 50 STATUS_2FA_REQUIRED, 51 STATUS_2FA_INVALID, 52 STATUS_2FA_LOCKED. A service returning nothing (false/empty) becomes STATUS_NO_PERMISSIONS. Missing/rejected key: `{"status":"STATUS_FAILURE","error":"Invalid API key."}`; unknown action: `{"status":"STATUS_FAILURE","error":"Invalid action."}`.

      **Paging and columns.** `start` (intval, default 0) and `limit` (intval, 0/absent = 50) apply to table and active-code lists. `show_columns` / `hide_columns` (comma-separated) filter the keys of `data` (single records) or of every row (lists). Table actions accept DataTables parameters (`search[value]`, `order[0][column]`, `order[0][dir]`) and answer `{status, data, recordsTotal, recordsFiltered}` without `draw`.

      **Values.** Records are raw DB rows: non-zero numbers arrive as strings, zeros/empty/null keep their PHP type; JSON columns are JSON-encoded strings; timestamps are unix seconds.

      **Admin specifics** (src/Public/Controllers/Api/AdminApiController.php). Each action maps to advanced permissions (ACTION_PERMISSIONS, line 32); the key owner's group must hold any one of them, or be a full admin (empty allowed_pages / Administrators group); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`. Every non-read action is recorded in the admin audit trail (AdminAudit) before that check. Unknown actions fall through to module actions (AdminApiRegistry) and module tables (TableRegistry); those bypass ACTION_PERMISSIONS and are not documented here. **Quirk:** several list actions (get_bouquets, get_access_codes, get_hmacs, get_epgs, get_providers, get_groups, get_packages, get_transcode_profiles, get_rtmp_ips, get_categories, get_blocked_uas, get_blocked_ips, get_servers) return a bare JSON array with no status. Table handlers that fail their own permission check print an empty body.
paths:
  /{access_code}/?action=mysql_query:
    post:
      operationId: Admin_mysql_query
      tags:
        - Admin API
      summary: Run a raw SQL statement
      description: |-
        Runs the `query` parameter verbatim against the panel database and returns every row the statement produced plus the last insert id. Any statement type is accepted (SELECT, UPDATE, DELETE, DDL); there is no parameter binding, no read-only mode and no row cap. **Extremely dangerous**: equivalent to full DB access; restrict with a token that does not have allow_sql. Rows are raw DB values (numbers as strings).

        **Permission:** the key's group needs any one of the advanced permissions `database` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** only a `full` token with `allow_sql` set (or a legacy key) (src/Core/Auth/ApiTokens.php:111-113).

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:290`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1942`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - mysql_query
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  example: SELECT id, username FROM users LIMIT 2
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                      insert_id:
                        type:
                          - integer
                          - string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '1'
                        username: admin
                      - id: '5'
                        username: reseller1
                    insert_id: 0
                sql_error:
                  summary: Statement failed
                  value:
                    status: STATUS_FAILURE
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=user_info:
    get:
      operationId: Admin_user_info
      tags:
        - Admin API
      summary: Who am I (key owner, group and permissions)
      description: |-
        Returns the API key owner's `users` row (without `password`) and the owner's group row with the resolved advanced permission list. show_columns/hide_columns filter `data` only.

        **Permission:** no advanced permission is required (not listed in ACTION_PERMISSIONS).

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:293`, `src/Public/Controllers/Api/AdminAPIWrapper.php:135`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - user_info
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_UserRow'
                      permissions:
                        type: object
                        additionalProperties: true
                        description: '`users_groups` row of the key owner plus `advanced` (array of advanced permission keys; empty for a full admin).'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      username: admin
                      email: r1@example.com
                      ip: 203.0.113.10
                      date_registered: '1750000000'
                      last_login: '1760690000'
                      member_group_id: '1'
                      credits: 0
                      notes: ''
                      status: '1'
                      reseller_dns: tv.example.com
                      owner_id: 0
                      override_packages: '[]'
                      hue: ''
                      theme: 0
                      timezone: ''
                      lang: en
                      allowed_bouquets: null
                      ui_prefs: null
                      api_key: ''
                    permissions:
                      group_id: '1'
                      group_name: Administrators
                      is_admin: '1'
                      is_reseller: 0
                      allowed_pages: '[]'
                      advanced: []
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_line:
    get:
      operationId: Admin_get_line
      tags:
        - Admin API
      summary: Get a line
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:360`, `src/Public/Controllers/Api/AdminAPIWrapper.php:141`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_LineRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '12'
                      member_id: '1'
                      username: john01
                      password: Xk29dLp0
                      last_ip: 198.51.100.23
                      exp_date: '1798761600'
                      admin_enabled: '1'
                      enabled: '1'
                      admin_notes: ''
                      reseller_notes: ''
                      bouquet: '[1,2,5]'
                      bouquet_order_custom: 0
                      allowed_outputs: '[1,2]'
                      max_connections: '1'
                      is_restreamer: 0
                      is_trial: 0
                      is_mag: 0
                      is_e2: 0
                      is_stalker: 0
                      is_isplock: 0
                      allowed_ips: '[]'
                      allowed_ua: '[]'
                      created_at: '1760600000'
                      pair_id: null
                      force_server_id: 0
                      as_number: null
                      isp_desc: ''
                      forced_country: ''
                      bypass_ua: 0
                      play_token: ''
                      last_expiration_video: null
                      package_id: '3'
                      access_token: null
                      contact: ''
                      telegram: ''
                      last_activity: '3456'
                      last_activity_array: '{"stream_id":"25","date_end":null}'
                      updated: '2026-10-16 12:00:00'
                      is_activecode: 0
                      custom_data: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_line:
    post:
      operationId: Admin_create_line
      tags:
        - Admin API
      summary: Create a line
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input. Lines created here are owned by `member_id` (default: the key user). No credits are charged.

        **Permission:** the key's group needs any one of the advanced permissions `add_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:363`, `src/Public/Controllers/Api/AdminAPIWrapper.php:148`, `src/Domain/Line/LineService.php:177`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_LineInput'
                - type: object
                  required:
                    - bouquets_selected
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '12'
                      member_id: '1'
                      username: john01
                      password: Xk29dLp0
                      last_ip: 198.51.100.23
                      exp_date: '1798761600'
                      admin_enabled: '1'
                      enabled: '1'
                      admin_notes: ''
                      reseller_notes: ''
                      bouquet: '[1,2,5]'
                      bouquet_order_custom: 0
                      allowed_outputs: '[1,2]'
                      max_connections: '1'
                      is_restreamer: 0
                      is_trial: 0
                      is_mag: 0
                      is_e2: 0
                      is_stalker: 0
                      is_isplock: 0
                      allowed_ips: '[]'
                      allowed_ua: '[]'
                      created_at: '1760600000'
                      pair_id: null
                      force_server_id: 0
                      as_number: null
                      isp_desc: ''
                      forced_country: ''
                      bypass_ua: 0
                      play_token: ''
                      last_expiration_video: null
                      package_id: '3'
                      access_token: null
                      contact: ''
                      telegram: ''
                      last_activity: '3456'
                      last_activity_array: '{"stream_id":"25","date_end":null}'
                      updated: '2026-10-16 12:00:00'
                      is_activecode: 0
                      custom_data: null
                exists:
                  summary: Username taken
                  value:
                    status: STATUS_EXISTS_USERNAME
                    data:
                      username: john01
                      bouquets_selected: '[1,2]'
                bad_date:
                  summary: Unparsable exp_date
                  value:
                    status: STATUS_INVALID_DATE
                    data:
                      username: john01
                      exp_date: next tuesday-ish
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'bouquets_selected missing: PHP TypeError, HTTP 500 with an empty body (shown here as an empty string)'
  /{access_code}/?action=edit_line:
    post:
      operationId: Admin_edit_line
      tags:
        - Admin API
      summary: Edit a line
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record. Changing username/password/bouquets signals connected sessions (LineService::updateLineSignal).

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:366`, `src/Public/Controllers/Api/AdminAPIWrapper.php:159`, `src/Domain/Line/LineService.php:177`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_LineInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '12'
                      member_id: '1'
                      username: john01
                      password: Xk29dLp0
                      last_ip: 198.51.100.23
                      exp_date: '1798761600'
                      admin_enabled: '1'
                      enabled: '1'
                      admin_notes: ''
                      reseller_notes: ''
                      bouquet: '[1,2,5]'
                      bouquet_order_custom: 0
                      allowed_outputs: '[1,2]'
                      max_connections: '1'
                      is_restreamer: 0
                      is_trial: 0
                      is_mag: 0
                      is_e2: 0
                      is_stalker: 0
                      is_isplock: 0
                      allowed_ips: '[]'
                      allowed_ua: '[]'
                      created_at: '1760600000'
                      pair_id: null
                      force_server_id: 0
                      as_number: null
                      isp_desc: ''
                      forced_country: ''
                      bypass_ua: 0
                      play_token: ''
                      last_expiration_video: null
                      package_id: '3'
                      access_token: null
                      contact: ''
                      telegram: ''
                      last_activity: '3456'
                      last_activity_array: '{"stream_id":"25","date_end":null}'
                      updated: '2026-10-16 12:00:00'
                      is_activecode: 0
                      custom_data: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                bouquet_conflict:
                  summary: Bouquet order changed since bouquet_order_revision was read
                  value:
                    status: STATUS_INVALID_DATA
                    data:
                      bouquet_order_conflict: true
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_line:
    post:
      operationId: Admin_delete_line
      tags:
        - Admin API
      summary: Delete a line
      description: |-
        Deletes line `id` and its connections/logs (LineService::deleteLineById). FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:371`, `src/Public/Controllers/Api/AdminAPIWrapper.php:500`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=disable_line:
    post:
      operationId: Admin_disable_line
      tags:
        - Admin API
      summary: Disable a line
      description: |-
        Sets `enabled=0` for line `id` (FAILURE when the line does not exist). The admin line versions update the column only: no line signal is sent, so open sessions continue until the next cache refresh.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:374`, `src/Public/Controllers/Api/AdminAPIWrapper.php:509`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - disable_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=enable_line:
    post:
      operationId: Admin_enable_line
      tags:
        - Admin API
      summary: Enable a line
      description: |-
        Sets `enabled=1` for line `id` (FAILURE when the line does not exist). The admin line versions update the column only: no line signal is sent, so open sessions continue until the next cache refresh.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:377`, `src/Public/Controllers/Api/AdminAPIWrapper.php:517`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - enable_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=ban_line:
    post:
      operationId: Admin_ban_line
      tags:
        - Admin API
      summary: Ban a line
      description: |-
        Sets `admin_enabled=0` for line `id` (FAILURE when the line does not exist). The admin line versions update the column only: no line signal is sent, so open sessions continue until the next cache refresh.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:383`, `src/Public/Controllers/Api/AdminAPIWrapper.php:525`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - ban_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=unban_line:
    post:
      operationId: Admin_unban_line
      tags:
        - Admin API
      summary: Unban a line
      description: |-
        Sets `admin_enabled=1` for line `id` (FAILURE when the line does not exist). The admin line versions update the column only: no line signal is sent, so open sessions continue until the next cache refresh.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:380`, `src/Public/Controllers/Api/AdminAPIWrapper.php:533`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - unban_line
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_user:
    get:
      operationId: Admin_get_user
      tags:
        - Admin API
      summary: Get a registered user
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. `password` is always removed; `api_key` is removed unless the row is the key owner's own.

        **Permission:** the key's group needs any one of the advanced permissions `edit_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:386`, `src/Public/Controllers/Api/AdminAPIWrapper.php:541`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_user
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_UserRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '5'
                      username: reseller1
                      email: r1@example.com
                      ip: 203.0.113.10
                      date_registered: '1750000000'
                      last_login: '1760690000'
                      member_group_id: '2'
                      credits: 150
                      notes: ''
                      status: '1'
                      reseller_dns: tv.example.com
                      owner_id: '1'
                      override_packages: '[]'
                      hue: ''
                      theme: 0
                      timezone: ''
                      lang: en
                      allowed_bouquets: null
                      ui_prefs: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_user:
    post:
      operationId: Admin_create_user
      tags:
        - Admin API
      summary: Create a registered user (admin/reseller account)
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:389`, `src/Public/Controllers/Api/AdminAPIWrapper.php:555`, `src/Domain/User/UserService.php:162`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_user
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_UserInput'
                - type: object
                  required:
                    - member_group_id
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '5'
                      username: reseller1
                      email: r1@example.com
                      ip: 203.0.113.10
                      date_registered: '1750000000'
                      last_login: '1760690000'
                      member_group_id: '2'
                      credits: 150
                      notes: ''
                      status: '1'
                      reseller_dns: tv.example.com
                      owner_id: '1'
                      override_packages: '[]'
                      hue: ''
                      theme: 0
                      timezone: ''
                      lang: en
                      allowed_bouquets: null
                      ui_prefs: null
                invalid_group:
                  summary: member_group_id missing or reserved
                  value:
                    status: STATUS_INVALID_GROUP
                    data:
                      username: reseller9
                exists:
                  summary: Username taken
                  value:
                    status: STATUS_EXISTS_USERNAME
                    data:
                      username: reseller1
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_user:
    post:
      operationId: Admin_edit_user
      tags:
        - Admin API
      summary: Edit a registered user
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record. Credits sent here are logged to users_credits_logs as an adjustment.

        **Permission:** the key's group needs any one of the advanced permissions `edit_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:392`, `src/Public/Controllers/Api/AdminAPIWrapper.php:566`, `src/Domain/User/UserService.php:162`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_user
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_UserInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '5'
                      username: reseller1
                      email: r1@example.com
                      ip: 203.0.113.10
                      date_registered: '1750000000'
                      last_login: '1760690000'
                      member_group_id: '2'
                      credits: 150
                      notes: ''
                      status: '1'
                      reseller_dns: tv.example.com
                      owner_id: '1'
                      override_packages: '[]'
                      hue: ''
                      theme: 0
                      timezone: ''
                      lang: en
                      allowed_bouquets: null
                      ui_prefs: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                bouquet_conflict:
                  summary: bouquet_limit_revision mismatch
                  value:
                    status: STATUS_INVALID_INPUT
                    data:
                      allowed_bouquets:
                        - 1
                        - 2
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_user:
    post:
      operationId: Admin_delete_user
      tags:
        - Admin API
      summary: Delete a registered user
      description: |-
        Deletes registered user `id` (UserService::deleteRegisteredUser). FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `edit_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:397`, `src/Public/Controllers/Api/AdminAPIWrapper.php:587`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_user
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=disable_user:
    post:
      operationId: Admin_disable_user
      tags:
        - Admin API
      summary: Disable a registered user
      description: |-
        Sets `status=0`. FAILURE when the user does not exist or is in a reserved group (group 1 / any is_admin group) and you are not a full admin.

        **Permission:** the key's group needs any one of the advanced permissions `edit_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:400`, `src/Public/Controllers/Api/AdminAPIWrapper.php:596`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - disable_user
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=enable_user:
    post:
      operationId: Admin_enable_user
      tags:
        - Admin API
      summary: Enable a registered user
      description: |-
        Sets `status=1`. Same restrictions as disable_user.

        **Permission:** the key's group needs any one of the advanced permissions `edit_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:403`, `src/Public/Controllers/Api/AdminAPIWrapper.php:605`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - enable_user
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_mag:
    get:
      operationId: Admin_get_mag
      tags:
        - Admin API
      summary: Get a MAG device
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. `id` is the device id (`mag_id`), not the line id. `mac` is stored base64-encoded.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:406`, `src/Public/Controllers/Api/AdminAPIWrapper.php:614`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_MagRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      mag_id: '7'
                      user_id: '40'
                      mac: MDA6MUE6Nzk6MTI6MzQ6NTY=
                      ip: 198.51.100.40
                      ver: 'ImageDescription: 0.2.18-r23-250'
                      stb_type: MAG250
                      sn: ''
                      image_version: '218'
                      hw_version: 1.7-BD-00
                      device_id: ''
                      device_id2: ''
                      lock_device: 0
                      theme_type: 0
                      mac_filter: ''
                      parent_password: '0000'
                      fav_channels: '{"live":[],"movie":[],"radio_streams":[]}'
                      user:
                        id: '40'
                        member_id: '1'
                        username: mag_8f3a1c2e
                        password: b7c1e9a04d2f
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: '1'
                        is_e2: 0
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                      paired: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_mag:
    post:
      operationId: Admin_create_mag
      tags:
        - Admin API
      summary: Create a MAG device
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:409`, `src/Public/Controllers/Api/AdminAPIWrapper.php:621`, `src/Domain/Device/MagService.php:218`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_MagInput'
                - type: object
                  required:
                    - mac
                    - bouquets_selected
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      mag_id: '7'
                      user_id: '40'
                      mac: MDA6MUE6Nzk6MTI6MzQ6NTY=
                      ip: 198.51.100.40
                      ver: 'ImageDescription: 0.2.18-r23-250'
                      stb_type: MAG250
                      sn: ''
                      image_version: '218'
                      hw_version: 1.7-BD-00
                      device_id: ''
                      device_id2: ''
                      lock_device: 0
                      theme_type: 0
                      mac_filter: ''
                      parent_password: '0000'
                      fav_channels: '{"live":[],"movie":[],"radio_streams":[]}'
                      user:
                        id: '40'
                        member_id: '1'
                        username: mag_8f3a1c2e
                        password: b7c1e9a04d2f
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: '1'
                        is_e2: 0
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                      paired: null
                invalid_mac:
                  summary: MAC invalid
                  value:
                    status: STATUS_INVALID_MAC
                    data:
                      mac: 00:1A:79:ZZ
                exists_mac:
                  summary: MAC already registered
                  value:
                    status: STATUS_EXISTS_MAC
                    data:
                      mac: 00:1A:79:12:34:56
                no_mac:
                  summary: MAC missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_mag:
    post:
      operationId: Admin_edit_mag
      tags:
        - Admin API
      summary: Edit a MAG device
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:412`, `src/Public/Controllers/Api/AdminAPIWrapper.php:632`, `src/Domain/Device/MagService.php:218`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_MagInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      mag_id: '7'
                      user_id: '40'
                      mac: MDA6MUE6Nzk6MTI6MzQ6NTY=
                      ip: 198.51.100.40
                      ver: 'ImageDescription: 0.2.18-r23-250'
                      stb_type: MAG250
                      sn: ''
                      image_version: '218'
                      hw_version: 1.7-BD-00
                      device_id: ''
                      device_id2: ''
                      lock_device: 0
                      theme_type: 0
                      mac_filter: ''
                      parent_password: '0000'
                      fav_channels: '{"live":[],"movie":[],"radio_streams":[]}'
                      user:
                        id: '40'
                        member_id: '1'
                        username: mag_8f3a1c2e
                        password: b7c1e9a04d2f
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: '1'
                        is_e2: 0
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                      paired: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_mac:
                  summary: MAC invalid
                  value:
                    status: STATUS_INVALID_MAC
                    data:
                      mac: 00:1A:79:ZZ
                exists_mac:
                  summary: MAC already registered
                  value:
                    status: STATUS_EXISTS_MAC
                    data:
                      mac: 00:1A:79:12:34:56
                no_mac:
                  summary: MAC missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_mag:
    post:
      operationId: Admin_delete_mag
      tags:
        - Admin API
      summary: Delete a MAG device
      description: |-
        Deletes the device and its backing line. `id` is the device id.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:417`, `src/Public/Controllers/Api/AdminAPIWrapper.php:649`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=disable_mag:
    post:
      operationId: Admin_disable_mag
      tags:
        - Admin API
      summary: Disable a MAG device
      description: |-
        Sets `enabled=0` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:420`, `src/Public/Controllers/Api/AdminAPIWrapper.php:661`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - disable_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=enable_mag:
    post:
      operationId: Admin_enable_mag
      tags:
        - Admin API
      summary: Enable a MAG device
      description: |-
        Sets `enabled=1` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:423`, `src/Public/Controllers/Api/AdminAPIWrapper.php:670`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - enable_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=ban_mag:
    post:
      operationId: Admin_ban_mag
      tags:
        - Admin API
      summary: Ban a MAG device
      description: |-
        Sets `admin_enabled=0` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:429`, `src/Public/Controllers/Api/AdminAPIWrapper.php:679`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - ban_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=unban_mag:
    post:
      operationId: Admin_unban_mag
      tags:
        - Admin API
      summary: Unban a MAG device
      description: |-
        Sets `admin_enabled=1` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:426`, `src/Public/Controllers/Api/AdminAPIWrapper.php:688`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - unban_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=convert_mag:
    post:
      operationId: Admin_convert_mag
      tags:
        - Admin API
      summary: Convert a MAG device to a plain line
      description: |-
        Deletes the device row but keeps its backing line (now a normal line). **Quirk:** `data` is the whole get_line envelope, so the line is at `data.data`.

        **Permission:** the key's group needs any one of the advanced permissions `edit_mag` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:432`, `src/Public/Controllers/Api/AdminAPIWrapper.php:697`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - convert_mag
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        required:
                          - status
                        properties:
                          status:
                            $ref: '#/components/schemas/Admin_Status'
                          data:
                            $ref: '#/components/schemas/Admin_LineRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      status: STATUS_SUCCESS
                      data:
                        id: '40'
                        member_id: '1'
                        username: mag_8f3a1c2e
                        password: b7c1e9a04d2f
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: 0
                        is_e2: 0
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_enigma:
    get:
      operationId: Admin_get_enigma
      tags:
        - Admin API
      summary: Get a Enigma2 device
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. `id` is the device id (`device_id`), not the line id.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:435`, `src/Public/Controllers/Api/AdminAPIWrapper.php:705`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_EnigmaRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      device_id: '3'
                      mac: 00:1D:EC:0A:1B:2C
                      user_id: '41'
                      modem_mac: ''
                      local_ip: 192.168.1.20
                      public_ip: 198.51.100.41
                      key_auth: ''
                      enigma_version: OpenATV 7.4
                      cpu: BCM7252S
                      version: ''
                      lversion: ''
                      token: ''
                      last_updated: '1760690000'
                      watchdog_timeout: '10'
                      lock_device: 0
                      telnet_enable: 0
                      ftp_enable: 0
                      ssh_enable: 0
                      dns: ''
                      original_mac: ''
                      rc: 0
                      mac_filter: ''
                      user:
                        id: '41'
                        member_id: '1'
                        username: e2_51c0aa9f
                        password: 0d9e1c7b6a52
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: 0
                        is_e2: '1'
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                      paired: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_enigma:
    post:
      operationId: Admin_create_enigma
      tags:
        - Admin API
      summary: Create a Enigma2 device
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:438`, `src/Public/Controllers/Api/AdminAPIWrapper.php:712`, `src/Domain/Device/EnigmaService.php:168`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_EnigmaInput'
                - type: object
                  required:
                    - mac
                    - bouquets_selected
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      device_id: '3'
                      mac: 00:1D:EC:0A:1B:2C
                      user_id: '41'
                      modem_mac: ''
                      local_ip: 192.168.1.20
                      public_ip: 198.51.100.41
                      key_auth: ''
                      enigma_version: OpenATV 7.4
                      cpu: BCM7252S
                      version: ''
                      lversion: ''
                      token: ''
                      last_updated: '1760690000'
                      watchdog_timeout: '10'
                      lock_device: 0
                      telnet_enable: 0
                      ftp_enable: 0
                      ssh_enable: 0
                      dns: ''
                      original_mac: ''
                      rc: 0
                      mac_filter: ''
                      user:
                        id: '41'
                        member_id: '1'
                        username: e2_51c0aa9f
                        password: 0d9e1c7b6a52
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: 0
                        is_e2: '1'
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                      paired: null
                invalid_mac:
                  summary: MAC invalid
                  value:
                    status: STATUS_INVALID_MAC
                    data:
                      mac: 00:1A:79:ZZ
                exists_mac:
                  summary: MAC already registered
                  value:
                    status: STATUS_EXISTS_MAC
                    data:
                      mac: 00:1A:79:12:34:56
                no_mac:
                  summary: MAC missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_enigma:
    post:
      operationId: Admin_edit_enigma
      tags:
        - Admin API
      summary: Edit a Enigma2 device
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:441`, `src/Public/Controllers/Api/AdminAPIWrapper.php:723`, `src/Domain/Device/EnigmaService.php:168`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_EnigmaInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      device_id: '3'
                      mac: 00:1D:EC:0A:1B:2C
                      user_id: '41'
                      modem_mac: ''
                      local_ip: 192.168.1.20
                      public_ip: 198.51.100.41
                      key_auth: ''
                      enigma_version: OpenATV 7.4
                      cpu: BCM7252S
                      version: ''
                      lversion: ''
                      token: ''
                      last_updated: '1760690000'
                      watchdog_timeout: '10'
                      lock_device: 0
                      telnet_enable: 0
                      ftp_enable: 0
                      ssh_enable: 0
                      dns: ''
                      original_mac: ''
                      rc: 0
                      mac_filter: ''
                      user:
                        id: '41'
                        member_id: '1'
                        username: e2_51c0aa9f
                        password: 0d9e1c7b6a52
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: 0
                        is_e2: '1'
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                      paired: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_mac:
                  summary: MAC invalid
                  value:
                    status: STATUS_INVALID_MAC
                    data:
                      mac: 00:1A:79:ZZ
                exists_mac:
                  summary: MAC already registered
                  value:
                    status: STATUS_EXISTS_MAC
                    data:
                      mac: 00:1A:79:12:34:56
                no_mac:
                  summary: MAC missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_enigma:
    post:
      operationId: Admin_delete_enigma
      tags:
        - Admin API
      summary: Delete a Enigma2 device
      description: |-
        Deletes the device and its backing line. `id` is the device id.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:446`, `src/Public/Controllers/Api/AdminAPIWrapper.php:740`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=disable_enigma:
    post:
      operationId: Admin_disable_enigma
      tags:
        - Admin API
      summary: Disable a Enigma2 device
      description: |-
        Sets `enabled=0` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:449`, `src/Public/Controllers/Api/AdminAPIWrapper.php:749`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - disable_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=enable_enigma:
    post:
      operationId: Admin_enable_enigma
      tags:
        - Admin API
      summary: Enable a Enigma2 device
      description: |-
        Sets `enabled=1` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:452`, `src/Public/Controllers/Api/AdminAPIWrapper.php:758`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - enable_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=ban_enigma:
    post:
      operationId: Admin_ban_enigma
      tags:
        - Admin API
      summary: Ban a Enigma2 device
      description: |-
        Sets `admin_enabled=0` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:458`, `src/Public/Controllers/Api/AdminAPIWrapper.php:767`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - ban_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=unban_enigma:
    post:
      operationId: Admin_unban_enigma
      tags:
        - Admin API
      summary: Unban a Enigma2 device
      description: |-
        Sets `admin_enabled=1` on the backing line and sends the line signal.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:455`, `src/Public/Controllers/Api/AdminAPIWrapper.php:776`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - unban_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=convert_enigma:
    post:
      operationId: Admin_convert_enigma
      tags:
        - Admin API
      summary: Convert a Enigma2 device to a plain line
      description: |-
        Deletes the device row but keeps its backing line (now a normal line). **Quirk:** `data` is the whole get_line envelope, so the line is at `data.data`.

        **Permission:** the key's group needs any one of the advanced permissions `edit_e2` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:461`, `src/Public/Controllers/Api/AdminAPIWrapper.php:785`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - convert_enigma
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        required:
                          - status
                        properties:
                          status:
                            $ref: '#/components/schemas/Admin_Status'
                          data:
                            $ref: '#/components/schemas/Admin_LineRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      status: STATUS_SUCCESS
                      data:
                        id: '41'
                        member_id: '1'
                        username: e2_51c0aa9f
                        password: 0d9e1c7b6a52
                        last_ip: 198.51.100.23
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        bouquet: '[1,2,5]'
                        bouquet_order_custom: 0
                        allowed_outputs: '[1,2]'
                        max_connections: '1'
                        is_restreamer: 0
                        is_trial: 0
                        is_mag: 0
                        is_e2: 0
                        is_stalker: 0
                        is_isplock: 0
                        allowed_ips: '[]'
                        allowed_ua: '[]'
                        created_at: '1760600000'
                        pair_id: null
                        force_server_id: 0
                        as_number: null
                        isp_desc: ''
                        forced_country: ''
                        bypass_ua: 0
                        play_token: ''
                        last_expiration_video: null
                        package_id: '3'
                        access_token: null
                        contact: ''
                        telegram: ''
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        updated: '2026-10-16 12:00:00'
                        is_activecode: 0
                        custom_data: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_bouquets:
    get:
      operationId: Admin_get_bouquets
      tags:
        - Admin API
      summary: List bouquets
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `bouquets` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:464`, `src/Public/Controllers/Api/AdminAPIWrapper.php:793`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_bouquets
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_BouquetRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '2'
                      bouquet_name: Sports
                      bouquet_channels: '[25,26,27]'
                      bouquet_movies: '[]'
                      bouquet_radios: '[]'
                      bouquet_series: '[3]'
                      bouquet_order: '2'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_bouquet:
    get:
      operationId: Admin_get_bouquet
      tags:
        - Admin API
      summary: Get a bouquet
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `bouquets`, `edit_bouquet` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:467`, `src/Public/Controllers/Api/AdminAPIWrapper.php:797`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_bouquet
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_BouquetRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '2'
                      bouquet_name: Sports
                      bouquet_channels: '[25,26,27]'
                      bouquet_movies: '[]'
                      bouquet_radios: '[]'
                      bouquet_series: '[3]'
                      bouquet_order: '2'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_bouquet:
    post:
      operationId: Admin_create_bouquet
      tags:
        - Admin API
      summary: Create a bouquet
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_bouquet` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:470`, `src/Public/Controllers/Api/AdminAPIWrapper.php:804`, `src/Domain/Bouquet/BouquetService.php:36`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_bouquet
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_BouquetInput'
                - type: object
                  required:
                    - bouquet_data
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '2'
                      bouquet_name: Sports
                      bouquet_channels: '[25,26,27]'
                      bouquet_movies: '[]'
                      bouquet_radios: '[]'
                      bouquet_series: '[3]'
                      bouquet_order: '2'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'bouquet_data missing or lacking a key: PHP TypeError, HTTP 500 with an empty body (shown here as an empty string)'
  /{access_code}/?action=edit_bouquet:
    post:
      operationId: Admin_edit_bouquet
      tags:
        - Admin API
      summary: Edit a bouquet
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_bouquet` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:473`, `src/Public/Controllers/Api/AdminAPIWrapper.php:815`, `src/Domain/Bouquet/BouquetService.php:36`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_bouquet
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_BouquetInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '2'
                      bouquet_name: Sports
                      bouquet_channels: '[25,26,27]'
                      bouquet_movies: '[]'
                      bouquet_radios: '[]'
                      bouquet_series: '[3]'
                      bouquet_order: '2'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'bouquet_data missing or lacking a key: PHP TypeError, HTTP 500 with an empty body (shown here as an empty string)'
  /{access_code}/?action=delete_bouquet:
    post:
      operationId: Admin_delete_bouquet
      tags:
        - Admin API
      summary: Delete a bouquet
      description: |-
        Deletes bouquet `id`. FAILURE when it does not exist. The bouquet id is also removed from every line and package.

        **Permission:** the key's group needs any one of the advanced permissions `edit_bouquet` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:478`, `src/Public/Controllers/Api/AdminAPIWrapper.php:830`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_bouquet
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_access_codes:
    get:
      operationId: Admin_get_access_codes
      tags:
        - Admin API
      summary: List access codes
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `add_code` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:481`, `src/Public/Controllers/Api/AdminAPIWrapper.php:839`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_access_codes
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_AccessCodeRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '4'
                      code: adminapi
                      type: '3'
                      enabled: '1'
                      groups: '[1]'
                      whitelist: '["203.0.113.10"]'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_access_code:
    get:
      operationId: Admin_get_access_code
      tags:
        - Admin API
      summary: Get a access code
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `add_code` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:484`, `src/Public/Controllers/Api/AdminAPIWrapper.php:843`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_access_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_AccessCodeRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '4'
                      code: adminapi
                      type: '3'
                      enabled: '1'
                      groups: '[1]'
                      whitelist: '["203.0.113.10"]'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_access_code:
    post:
      operationId: Admin_create_access_code
      tags:
        - Admin API
      summary: Create a access code
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input. Regenerates the nginx code configs and reloads nginx. Deleting or disabling the code you are calling through locks you out.

        **Permission:** the key's group needs any one of the advanced permissions `add_code` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:487`, `src/Public/Controllers/Api/AdminAPIWrapper.php:850`, `src/Core/Auth/AuthService.php:35`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_access_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_AccessCodeInput'
                - type: object
                  required:
                    - code
                    - type
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '4'
                      code: adminapi
                      type: '3'
                      enabled: '1'
                      groups: '[1]'
                      whitelist: '["203.0.113.10"]'
                too_short:
                  summary: Code too short
                  value:
                    status: STATUS_CODE_LENGTH
                    data:
                      code: abc
                reserved:
                  summary: Reserved word
                  value:
                    status: STATUS_RESERVED_CODE
                    data:
                      code: player_api
                exists:
                  summary: Duplicate
                  value:
                    status: STATUS_EXISTS_CODE
                    data:
                      code: adminapi
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_access_code:
    post:
      operationId: Admin_edit_access_code
      tags:
        - Admin API
      summary: Edit a access code
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `add_code` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:490`, `src/Public/Controllers/Api/AdminAPIWrapper.php:861`, `src/Core/Auth/AuthService.php:35`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_access_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_AccessCodeInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '4'
                      code: adminapi
                      type: '3'
                      enabled: '1'
                      groups: '[1]'
                      whitelist: '["203.0.113.10"]'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                too_short:
                  summary: Code too short
                  value:
                    status: STATUS_CODE_LENGTH
                    data:
                      code: abc
                reserved:
                  summary: Reserved word
                  value:
                    status: STATUS_RESERVED_CODE
                    data:
                      code: player_api
                exists:
                  summary: Duplicate
                  value:
                    status: STATUS_EXISTS_CODE
                    data:
                      code: adminapi
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_access_code:
    post:
      operationId: Admin_delete_access_code
      tags:
        - Admin API
      summary: Delete a access code
      description: |-
        Deletes access code `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `add_code` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:495`, `src/Public/Controllers/Api/AdminAPIWrapper.php:874`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_access_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_hmacs:
    get:
      operationId: Admin_get_hmacs
      tags:
        - Admin API
      summary: List HMAC keys
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `add_hmac` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:498`, `src/Public/Controllers/Api/AdminAPIWrapper.php:883`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_hmacs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_HmacRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '1'
                      key: U2FsdGVkX19mY3pR...
                      notes: Set-top portal
                      enabled: '1'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_hmac:
    get:
      operationId: Admin_get_hmac
      tags:
        - Admin API
      summary: Get a HMAC key
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `add_hmac` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:501`, `src/Public/Controllers/Api/AdminAPIWrapper.php:887`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_hmac
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_HmacRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      key: U2FsdGVkX19mY3pR...
                      notes: Set-top portal
                      enabled: '1'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_hmac:
    post:
      operationId: Admin_create_hmac
      tags:
        - Admin API
      summary: Create a HMAC key
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_hmac` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:504`, `src/Public/Controllers/Api/AdminAPIWrapper.php:894`, `src/Core/Auth/AuthService.php:122`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_hmac
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_HmacInput'
                - type: object
                  required:
                    - keygen
                    - notes
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      key: U2FsdGVkX19mY3pR...
                      notes: Set-top portal
                      enabled: '1'
                no_key:
                  summary: keygen not 32 characters
                  value:
                    status: STATUS_NO_KEY
                    data:
                      notes: x
                no_description:
                  summary: notes missing
                  value:
                    status: STATUS_NO_DESCRIPTION
                    data: {}
                exists:
                  summary: Key already exists
                  value:
                    status: STATUS_EXISTS_HMAC
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_hmac:
    post:
      operationId: Admin_edit_hmac
      tags:
        - Admin API
      summary: Edit a HMAC key
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `add_hmac` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:507`, `src/Public/Controllers/Api/AdminAPIWrapper.php:905`, `src/Core/Auth/AuthService.php:122`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_hmac
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_HmacInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      key: U2FsdGVkX19mY3pR...
                      notes: Set-top portal
                      enabled: '1'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                no_key:
                  summary: keygen not 32 characters
                  value:
                    status: STATUS_NO_KEY
                    data:
                      notes: x
                no_description:
                  summary: notes missing
                  value:
                    status: STATUS_NO_DESCRIPTION
                    data: {}
                exists:
                  summary: Key already exists
                  value:
                    status: STATUS_EXISTS_HMAC
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_hmac:
    post:
      operationId: Admin_delete_hmac
      tags:
        - Admin API
      summary: Delete a HMAC key
      description: |-
        Deletes HMAC key `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `add_hmac` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:512`, `src/Public/Controllers/Api/AdminAPIWrapper.php:920`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_hmac
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_epgs:
    get:
      operationId: Admin_get_epgs
      tags:
        - Admin API
      summary: List EPG sources
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `epg` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:515`, `src/Public/Controllers/Api/AdminAPIWrapper.php:929`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_epgs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_EpgRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '1'
                      epg_name: Main XMLTV
                      epg_file: https://epg.example.com/guide.xml.gz
                      last_updated: '1760680000'
                      days_keep: '7'
                      offset: 0
                      data: '[]'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_epg:
    get:
      operationId: Admin_get_epg
      tags:
        - Admin API
      summary: Get a EPG source
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `epg`, `epg_edit` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:518`, `src/Public/Controllers/Api/AdminAPIWrapper.php:933`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_epg
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_EpgRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      epg_name: Main XMLTV
                      epg_file: https://epg.example.com/guide.xml.gz
                      last_updated: '1760680000'
                      days_keep: '7'
                      offset: 0
                      data: '[]'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_epg:
    post:
      operationId: Admin_create_epg
      tags:
        - Admin API
      summary: Create a EPG source
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_epg` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:521`, `src/Public/Controllers/Api/AdminAPIWrapper.php:940`, `src/Domain/Epg/EpgService.php:31`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_epg
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_EpgInput'
                - type: object
                  required:
                    - epg_name
                    - epg_file
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      epg_name: Main XMLTV
                      epg_file: https://epg.example.com/guide.xml.gz
                      last_updated: '1760680000'
                      days_keep: '7'
                      offset: 0
                      data: '[]'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_epg:
    post:
      operationId: Admin_edit_epg
      tags:
        - Admin API
      summary: Edit a EPG source
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `epg_edit` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:524`, `src/Public/Controllers/Api/AdminAPIWrapper.php:951`, `src/Domain/Epg/EpgService.php:31`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_epg
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_EpgInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      epg_name: Main XMLTV
                      epg_file: https://epg.example.com/guide.xml.gz
                      last_updated: '1760680000'
                      days_keep: '7'
                      offset: 0
                      data: '[]'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_epg:
    post:
      operationId: Admin_delete_epg
      tags:
        - Admin API
      summary: Delete a EPG source
      description: |-
        Deletes EPG source `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `epg_edit` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:529`, `src/Public/Controllers/Api/AdminAPIWrapper.php:963`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_epg
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_providers:
    get:
      operationId: Admin_get_providers
      tags:
        - Admin API
      summary: List upstream providers
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row. Rows include the provider password in plain text.

        **Permission:** the key's group needs any one of the advanced permissions `streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:535`, `src/Public/Controllers/Api/AdminAPIWrapper.php:981`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_providers
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_ProviderRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '1'
                      name: Upstream A
                      ip: up.example.net
                      port: '8080'
                      username: feeduser
                      password: feedpass
                      last_changed: '1760600000'
                      legacy: 0
                      enabled: '1'
                      status: '1'
                      ssl: 0
                      hls: 0
                      data: '[]'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_provider:
    get:
      operationId: Admin_get_provider
      tags:
        - Admin API
      summary: Get a provider
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:538`, `src/Public/Controllers/Api/AdminAPIWrapper.php:985`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_provider
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_ProviderRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      name: Upstream A
                      ip: up.example.net
                      port: '8080'
                      username: feeduser
                      password: feedpass
                      last_changed: '1760600000'
                      legacy: 0
                      enabled: '1'
                      status: '1'
                      ssl: 0
                      hls: 0
                      data: '[]'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_provider:
    post:
      operationId: Admin_create_provider
      tags:
        - Admin API
      summary: Create a provider
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:541`, `src/Public/Controllers/Api/AdminAPIWrapper.php:992`, `src/Domain/Stream/ProviderService.php:49`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_provider
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_ProviderInput'
                - type: object
                  required:
                    - name
                    - ip
                    - port
                    - username
                    - password
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      name: Upstream A
                      ip: up.example.net
                      port: '8080'
                      username: feeduser
                      password: feedpass
                      last_changed: '1760600000'
                      legacy: 0
                      enabled: '1'
                      status: '1'
                      ssl: 0
                      hls: 0
                      data: '[]'
                missing:
                  summary: Required field missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data:
                      name: x
                exists:
                  summary: Same ip + username already configured
                  value:
                    status: STATUS_EXISTS_IP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_provider:
    post:
      operationId: Admin_edit_provider
      tags:
        - Admin API
      summary: Edit a provider
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:544`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1003`, `src/Domain/Stream/ProviderService.php:49`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_provider
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ProviderInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      name: Upstream A
                      ip: up.example.net
                      port: '8080'
                      username: feeduser
                      password: feedpass
                      last_changed: '1760600000'
                      legacy: 0
                      enabled: '1'
                      status: '1'
                      ssl: 0
                      hls: 0
                      data: '[]'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                missing:
                  summary: Required field missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data:
                      name: x
                exists:
                  summary: Same ip + username already configured
                  value:
                    status: STATUS_EXISTS_IP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_provider:
    post:
      operationId: Admin_delete_provider
      tags:
        - Admin API
      summary: Delete a provider
      description: |-
        Deletes provider `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:549`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1017`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_provider
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_groups:
    get:
      operationId: Admin_get_groups
      tags:
        - Admin API
      summary: List member groups
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `mng_groups` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:555`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1035`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_groups
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_GroupRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - group_id: '2'
                      group_name: Resellers
                      is_admin: 0
                      is_reseller: '1'
                      total_allowed_gen_trials: '5'
                      total_allowed_gen_in: day
                      delete_users: '1'
                      allowed_pages: '[]'
                      can_delete: '1'
                      create_sub_resellers: '1'
                      create_sub_resellers_price: '10'
                      reseller_client_connection_logs: '1'
                      can_view_vod: '1'
                      allow_download: '1'
                      minimum_trial_credits: 0
                      allow_restrictions: '1'
                      allow_change_username: '1'
                      allow_change_password: '1'
                      minimum_username_length: '6'
                      minimum_password_length: '6'
                      allow_change_bouquets: 0
                      notice_html: ''
                      subresellers: '[2]'
                      require_2fa: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_group:
    get:
      operationId: Admin_get_group
      tags:
        - Admin API
      summary: Get a member group
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `mng_groups`, `edit_group` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:558`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1039`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_group
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_GroupRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      group_id: '2'
                      group_name: Resellers
                      is_admin: 0
                      is_reseller: '1'
                      total_allowed_gen_trials: '5'
                      total_allowed_gen_in: day
                      delete_users: '1'
                      allowed_pages: '[]'
                      can_delete: '1'
                      create_sub_resellers: '1'
                      create_sub_resellers_price: '10'
                      reseller_client_connection_logs: '1'
                      can_view_vod: '1'
                      allow_download: '1'
                      minimum_trial_credits: 0
                      allow_restrictions: '1'
                      allow_change_username: '1'
                      allow_change_password: '1'
                      minimum_username_length: '6'
                      minimum_password_length: '6'
                      allow_change_bouquets: 0
                      notice_html: ''
                      subresellers: '[2]'
                      require_2fa: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_group:
    post:
      operationId: Admin_create_group
      tags:
        - Admin API
      summary: Create a member group
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_group` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:561`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1046`, `src/Domain/User/GroupService.php:30`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_group
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_GroupInput'
                - type: object
                  required:
                    - group_name
                    - permissions_selected
                    - groups_selected
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      group_id: '2'
                      group_name: Resellers
                      is_admin: 0
                      is_reseller: '1'
                      total_allowed_gen_trials: '5'
                      total_allowed_gen_in: day
                      delete_users: '1'
                      allowed_pages: '[]'
                      can_delete: '1'
                      create_sub_resellers: '1'
                      create_sub_resellers_price: '10'
                      reseller_client_connection_logs: '1'
                      can_view_vod: '1'
                      allow_download: '1'
                      minimum_trial_credits: 0
                      allow_restrictions: '1'
                      allow_change_username: '1'
                      allow_change_password: '1'
                      minimum_username_length: '6'
                      minimum_password_length: '6'
                      allow_change_bouquets: 0
                      notice_html: ''
                      subresellers: '[2]'
                      require_2fa: 0
                missing_name:
                  summary: group_name missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_group:
                  summary: Reserved group or is_admin without full admin
                  value:
                    status: STATUS_INVALID_GROUP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_group:
    post:
      operationId: Admin_edit_group
      tags:
        - Admin API
      summary: Edit a member group
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record. **Bug:** require_2fa is not carried over by the edit wrapper; send it again or it is switched off.

        **Permission:** the key's group needs any one of the advanced permissions `edit_group` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:564`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1057`, `src/Domain/User/GroupService.php:30`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_group
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_GroupInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      group_id: '2'
                      group_name: Resellers
                      is_admin: 0
                      is_reseller: '1'
                      total_allowed_gen_trials: '5'
                      total_allowed_gen_in: day
                      delete_users: '1'
                      allowed_pages: '[]'
                      can_delete: '1'
                      create_sub_resellers: '1'
                      create_sub_resellers_price: '10'
                      reseller_client_connection_logs: '1'
                      can_view_vod: '1'
                      allow_download: '1'
                      minimum_trial_credits: 0
                      allow_restrictions: '1'
                      allow_change_username: '1'
                      allow_change_password: '1'
                      minimum_username_length: '6'
                      minimum_password_length: '6'
                      allow_change_bouquets: 0
                      notice_html: ''
                      subresellers: '[2]'
                      require_2fa: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                missing_name:
                  summary: group_name missing
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_group:
                  summary: Reserved group or is_admin without full admin
                  value:
                    status: STATUS_INVALID_GROUP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_group:
    post:
      operationId: Admin_delete_group
      tags:
        - Admin API
      summary: Delete a member group
      description: |-
        Deletes member group `id`. FAILURE when it does not exist. Groups with can_delete=0 are refused (FAILURE).

        **Permission:** the key's group needs any one of the advanced permissions `edit_group` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:569`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1080`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_group
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_packages:
    get:
      operationId: Admin_get_packages
      tags:
        - Admin API
      summary: List packages
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `mng_packages` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:572`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1089`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_packages
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_PackageRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '3'
                      package_name: 1 Month
                      is_addon: 0
                      is_trial: '1'
                      is_official: '1'
                      trial_credits: 0
                      official_credits: 10
                      trial_duration: '24'
                      trial_duration_in: hours
                      official_duration: '1'
                      official_duration_in: months
                      groups: '[2]'
                      bouquets: '[1,2,5]'
                      addon_packages: '[]'
                      is_line: '1'
                      is_mag: '1'
                      is_e2: '1'
                      is_restreamer: 0
                      is_isplock: 0
                      output_formats: '[1,2]'
                      max_connections: '1'
                      force_server_id: 0
                      forced_country: ''
                      lock_device: 0
                      check_compatible: '1'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_package:
    get:
      operationId: Admin_get_package
      tags:
        - Admin API
      summary: Get a package
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `mng_packages`, `edit_package` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:575`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1093`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_package
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_PackageRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '3'
                      package_name: 1 Month
                      is_addon: 0
                      is_trial: '1'
                      is_official: '1'
                      trial_credits: 0
                      official_credits: 10
                      trial_duration: '24'
                      trial_duration_in: hours
                      official_duration: '1'
                      official_duration_in: months
                      groups: '[2]'
                      bouquets: '[1,2,5]'
                      addon_packages: '[]'
                      is_line: '1'
                      is_mag: '1'
                      is_e2: '1'
                      is_restreamer: 0
                      is_isplock: 0
                      output_formats: '[1,2]'
                      max_connections: '1'
                      force_server_id: 0
                      forced_country: ''
                      lock_device: 0
                      check_compatible: '1'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_package:
    post:
      operationId: Admin_create_package
      tags:
        - Admin API
      summary: Create a package
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_packages` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:578`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1100`, `src/Domain/Line/PackageService.php:31`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_package
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_PackageInput'
                - type: object
                  required:
                    - package_name
                    - groups_selected
                    - bouquets_selected
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '3'
                      package_name: 1 Month
                      is_addon: 0
                      is_trial: '1'
                      is_official: '1'
                      trial_credits: 0
                      official_credits: 10
                      trial_duration: '24'
                      trial_duration_in: hours
                      official_duration: '1'
                      official_duration_in: months
                      groups: '[2]'
                      bouquets: '[1,2,5]'
                      addon_packages: '[]'
                      is_line: '1'
                      is_mag: '1'
                      is_e2: '1'
                      is_restreamer: 0
                      is_isplock: 0
                      output_formats: '[1,2]'
                      max_connections: '1'
                      force_server_id: 0
                      forced_country: ''
                      lock_device: 0
                      check_compatible: '1'
                invalid_name:
                  summary: package_name missing
                  value:
                    status: STATUS_INVALID_NAME
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_package:
    post:
      operationId: Admin_edit_package
      tags:
        - Admin API
      summary: Edit a package
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_package` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:581`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1111`, `src/Domain/Line/PackageService.php:31`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_package
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_PackageInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '3'
                      package_name: 1 Month
                      is_addon: 0
                      is_trial: '1'
                      is_official: '1'
                      trial_credits: 0
                      official_credits: 10
                      trial_duration: '24'
                      trial_duration_in: hours
                      official_duration: '1'
                      official_duration_in: months
                      groups: '[2]'
                      bouquets: '[1,2,5]'
                      addon_packages: '[]'
                      is_line: '1'
                      is_mag: '1'
                      is_e2: '1'
                      is_restreamer: 0
                      is_isplock: 0
                      output_formats: '[1,2]'
                      max_connections: '1'
                      force_server_id: 0
                      forced_country: ''
                      lock_device: 0
                      check_compatible: '1'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_name:
                  summary: package_name missing
                  value:
                    status: STATUS_INVALID_NAME
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_package:
    post:
      operationId: Admin_delete_package
      tags:
        - Admin API
      summary: Delete a package
      description: |-
        Deletes package `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `edit_package` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:586`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1127`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_package
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_transcode_profiles:
    get:
      operationId: Admin_get_transcode_profiles
      tags:
        - Admin API
      summary: List transcode profiles
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `tprofiles` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:589`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1136`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_transcode_profiles
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_ProfileRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - profile_id: '1'
                      profile_name: H264 720p
                      profile_options: '{"-vcodec":"libx264","-preset":"veryfast","-b:v":"2500k","-acodec":"aac","-b:a":"128k","16":{"cmd":"scale=1280:720","val":"1280:720"}}'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_transcode_profile:
    get:
      operationId: Admin_get_transcode_profile
      tags:
        - Admin API
      summary: Get a transcode profile
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `tprofiles`, `tprofile` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:592`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1140`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_transcode_profile
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_ProfileRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      profile_id: '1'
                      profile_name: H264 720p
                      profile_options: '{"-vcodec":"libx264","-preset":"veryfast","-b:v":"2500k","-acodec":"aac","-b:a":"128k","16":{"cmd":"scale=1280:720","val":"1280:720"}}'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_transcode_profile:
    post:
      operationId: Admin_create_transcode_profile
      tags:
        - Admin API
      summary: Create a transcode profile
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `tprofile` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:595`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1147`, `src/Domain/Stream/ProfileService.php:30`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_transcode_profile
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_ProfileInput'
                - type: object
                  required:
                    - profile_name
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      profile_id: '1'
                      profile_name: H264 720p
                      profile_options: '{"-vcodec":"libx264","-preset":"veryfast","-b:v":"2500k","-acodec":"aac","-b:a":"128k","16":{"cmd":"scale=1280:720","val":"1280:720"}}'
                invalid:
                  summary: Missing name or bad codec/preset value
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_transcode_profile:
    post:
      operationId: Admin_edit_transcode_profile
      tags:
        - Admin API
      summary: Edit a transcode profile
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `tprofile` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:598`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1158`, `src/Domain/Stream/ProfileService.php:30`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_transcode_profile
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ProfileInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      profile_id: '1'
                      profile_name: H264 720p
                      profile_options: '{"-vcodec":"libx264","-preset":"veryfast","-b:v":"2500k","-acodec":"aac","-b:a":"128k","16":{"cmd":"scale=1280:720","val":"1280:720"}}'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid:
                  summary: Missing name or bad codec/preset value
                  value:
                    status: STATUS_INVALID_INPUT
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_transcode_profile:
    post:
      operationId: Admin_delete_transcode_profile
      tags:
        - Admin API
      summary: Delete a transcode profile
      description: |-
        Deletes transcode profile `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `tprofiles` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:603`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1171`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_transcode_profile
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_rtmp_ips:
    get:
      operationId: Admin_get_rtmp_ips
      tags:
        - Admin API
      summary: List RTMP push/pull IPs
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `rtmp` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:606`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1180`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_rtmp_ips
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_RtmpIpRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '1'
                      ip: 203.0.113.50
                      password: k3Lz9QpR2mVt8XwA
                      notes: Encoder
                      push: '1'
                      pull: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_rtmp_ip:
    get:
      operationId: Admin_get_rtmp_ip
      tags:
        - Admin API
      summary: Get a RTMP IP
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `rtmp`, `add_rtmp` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:609`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1184`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_rtmp_ip
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_RtmpIpRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      ip: 203.0.113.50
                      password: k3Lz9QpR2mVt8XwA
                      notes: Encoder
                      push: '1'
                      pull: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_rtmp_ip:
    post:
      operationId: Admin_create_rtmp_ip
      tags:
        - Admin API
      summary: Create a RTMP IP
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_rtmp` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:612`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1191`, `src/Domain/Security/BlocklistService.php:140`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_rtmp_ip
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_RtmpIpInput'
                - type: object
                  required:
                    - ip
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      ip: 203.0.113.50
                      password: k3Lz9QpR2mVt8XwA
                      notes: Encoder
                      push: '1'
                      pull: 0
                invalid_ip:
                  summary: Not an IP address
                  value:
                    status: STATUS_INVALID_IP
                    data:
                      ip: encoder.local
                exists:
                  summary: IP already listed
                  value:
                    status: STATUS_EXISTS_IP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_rtmp_ip:
    post:
      operationId: Admin_edit_rtmp_ip
      tags:
        - Admin API
      summary: Edit a RTMP IP
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `add_rtmp` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:615`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1202`, `src/Domain/Security/BlocklistService.php:140`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_rtmp_ip
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_RtmpIpInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '1'
                      ip: 203.0.113.50
                      password: k3Lz9QpR2mVt8XwA
                      notes: Encoder
                      push: '1'
                      pull: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_ip:
                  summary: Not an IP address
                  value:
                    status: STATUS_INVALID_IP
                    data:
                      ip: encoder.local
                exists:
                  summary: IP already listed
                  value:
                    status: STATUS_EXISTS_IP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_rtmp_ip:
    post:
      operationId: Admin_delete_rtmp_ip
      tags:
        - Admin API
      summary: Delete a RTMP IP
      description: |-
        Deletes RTMP IP `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `add_rtmp` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:620`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1217`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_rtmp_ip
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_categories:
    get:
      operationId: Admin_get_categories
      tags:
        - Admin API
      summary: List live categories
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row. **Only `live` categories are listed**; movie/series/radio categories are reachable through get_category only.

        **Permission:** the key's group needs any one of the advanced permissions `categories` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:623`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1226`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_categories
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_CategoryRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '4'
                      category_type: live
                      category_name: UK | Sports
                      parent_id: 0
                      cat_order: '3'
                      is_adult: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_category:
    get:
      operationId: Admin_get_category
      tags:
        - Admin API
      summary: Get a category
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. Any category type.

        **Permission:** the key's group needs any one of the advanced permissions `categories` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:626`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1230`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_category
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_CategoryRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '4'
                      category_type: live
                      category_name: UK | Sports
                      parent_id: 0
                      cat_order: '3'
                      is_adult: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_category:
    post:
      operationId: Admin_create_category
      tags:
        - Admin API
      summary: Create a category
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_cat` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:629`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1237`, `src/Domain/Stream/CategoryService.php:71`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_category
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_CategoryInput'
                - type: object
                  required:
                    - category_name
                    - category_type
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '4'
                      category_type: live
                      category_name: UK | Sports
                      parent_id: 0
                      cat_order: '3'
                      is_adult: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_category:
    post:
      operationId: Admin_edit_category
      tags:
        - Admin API
      summary: Edit a category
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `add_cat` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:632`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1248`, `src/Domain/Stream/CategoryService.php:71`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_category
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_CategoryInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '4'
                      category_type: live
                      category_name: UK | Sports
                      parent_id: 0
                      cat_order: '3'
                      is_adult: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_category:
    post:
      operationId: Admin_delete_category
      tags:
        - Admin API
      summary: Delete a category
      description: |-
        Deletes category `id`. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `edit_cat` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:637`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1262`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_category
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=reload_epg:
    post:
      operationId: Admin_reload_epg
      tags:
        - Admin API
      summary: Refresh EPG data
      description: |-
        Starts `console.php cron:epg` in the background (for one EPG source when `id` is given, else all) and returns immediately. Always STATUS_SUCCESS; the result is not reported.

        **Permission:** the key's group needs any one of the advanced permissions `epg`, `epg_edit` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:532`, `src/Public/Controllers/Api/AdminAPIWrapper.php:972`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - reload_epg
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: Optional record id (intval).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=reload_provider:
    post:
      operationId: Admin_reload_provider
      tags:
        - Admin API
      summary: Refresh provider catalogues
      description: |-
        Starts `console.php cron:providers` in the background (one provider when `id` is given, else all) and returns immediately. Always STATUS_SUCCESS; the result is not reported.

        **Permission:** the key's group needs any one of the advanced permissions `streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:552`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1026`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - reload_provider
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: Optional record id (intval).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_blocked_isps:
    get:
      operationId: Admin_get_blocked_isps
      tags:
        - Admin API
      summary: List blocked ISPs
      description: |-
        Returns `{"status":"STATUS_SUCCESS","data":[rows]}` (unlike the other blocklist lists, this one keeps the envelope). **Quirk:** show_columns/hide_columns are applied to the list itself, so they match list indices (`0,1,...`), not column names; passing column names empties `data`.

        **Permission:** the key's group needs any one of the advanced permissions `block_isps` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:640`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1293`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_blocked_isps
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            isp:
                              type: string
                            blocked:
                              type:
                                - string
                                - integer
                          additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '1'
                        isp: example hosting ltd
                        blocked: '1'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=add_blocked_isp:
    post:
      operationId: Admin_add_blocked_isp
      tags:
        - Admin API
      summary: Block an ISP (broken)
      description: |-
        **Broken in source:** the controller passes `$rData['id']` (an int/string) to a wrapper method typed `array $rData`, so every call raises a TypeError: HTTP 500 with an empty body. The audit entry is still written. Use the admin panel to add ISPs.

        **Permission:** the key's group needs any one of the advanced permissions `block_isps` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:643`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1297`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - add_blocked_isp
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: false
          schema:
            type: string
          description: Read by the controller (the only value passed on).
        - name: isp
          in: query
          required: false
          schema:
            type: string
          description: Intended ISP name (never reaches the service).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Always: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=delete_blocked_isp:
    post:
      operationId: Admin_delete_blocked_isp
      tags:
        - Admin API
      summary: Unblock an ISP
      description: |-
        Deletes blocked ISP `id`. STATUS_SUCCESS or STATUS_FAILURE. Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `block_isps` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:646`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1308`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_blocked_isp
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=get_blocked_uas:
    get:
      operationId: Admin_get_blocked_uas
      tags:
        - Admin API
      summary: List blocked user agents
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `block_uas` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:649`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1315`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_blocked_uas
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_BlockedUaRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '1'
                      user_agent: VLC/3.0.20
                      exact_match: 0
                      attempts_blocked: '14'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=add_blocked_ua:
    post:
      operationId: Admin_add_blocked_ua
      tags:
        - Admin API
      summary: Block a user agent (broken)
      description: |-
        **Broken in source:** BlocklistService::processUA reads a `blocked_ua` key that the API never supplies, so every call answers `{"status":"STATUS_INVALID_NAME", ...}` and nothing is stored.

        **Permission:** the key's group needs any one of the advanced permissions `block_uas` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:652`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1319`, `src/Domain/Security/BlocklistService.php:187`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - add_blocked_ua
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_BlockedUaInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                always:
                  summary: Every call
                  value:
                    status: STATUS_INVALID_NAME
                    data:
                      user_agent: VLC/3.0.20
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_blocked_ua:
    post:
      operationId: Admin_delete_blocked_ua
      tags:
        - Admin API
      summary: Unblock a user agent
      description: |-
        Deletes blocked UA `id`. Non-numeric id = TypeError (HTTP 500).

        **Permission:** the key's group needs any one of the advanced permissions `block_uas` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:655`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1330`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_blocked_ua
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=get_blocked_ips:
    get:
      operationId: Admin_get_blocked_ips
      tags:
        - Admin API
      summary: List blocked IPs
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row.

        **Permission:** the key's group needs any one of the advanced permissions `block_ips` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:658`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1337`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_blocked_ips
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_BlockedIpRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '3'
                      ip: 192.0.2.77
                      notes: Abuse
                      date: '1760600000'
                      attempts_blocked: '120'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=add_blocked_ip:
    post:
      operationId: Admin_add_blocked_ip
      tags:
        - Admin API
      summary: Block an IP (broken)
      description: |-
        **Broken in source:** same defect as add_blocked_isp: only `$rData['id']` is passed to an array-typed method, so every call is a TypeError (HTTP 500, empty body) after the audit entry is written.

        **Permission:** the key's group needs any one of the advanced permissions `block_ips` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:661`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1341`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - add_blocked_ip
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: false
          schema:
            type: string
          description: Read by the controller.
        - name: ip
          in: query
          required: false
          schema:
            type: string
          description: Intended IP (never reaches the service).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Always: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=delete_blocked_ip:
    post:
      operationId: Admin_delete_blocked_ip
      tags:
        - Admin API
      summary: Unblock an IP
      description: |-
        Deletes blocked IP `id` and rewrites the firewall list. Non-numeric id = TypeError (HTTP 500).

        **Permission:** the key's group needs any one of the advanced permissions `block_ips` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:664`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1352`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_blocked_ip
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=flush_blocked_ips:
    post:
      operationId: Admin_flush_blocked_ips
      tags:
        - Admin API
      summary: Remove every blocked IP
      description: |-
        Empties `blocked_ips` and flushes the firewall list on every server. Always STATUS_SUCCESS.

        **Permission:** the key's group needs any one of the advanced permissions `block_ips` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:667`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1359`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - flush_blocked_ips
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_stream:
    get:
      operationId: Admin_get_stream
      tags:
        - Admin API
      summary: Get a live stream
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. FAILURE when the id exists but is not a live stream (streams.type 1). Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:670`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1364`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_stream
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_StreamRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '25'
                      type: '1'
                      category_id: '[4]'
                      stream_display_name: BBC One HD
                      stream_source: '["http://src.example.net/live/bbc1.ts"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=create_stream:
    post:
      operationId: Admin_create_stream
      tags:
        - Admin API
      summary: Create a live stream
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:673`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1371`, `src/Domain/Stream/StreamService.php:40`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_stream
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_StreamInput'
                - type: object
                  required:
                    - stream_display_name
                    - server_tree_data
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '25'
                      type: '1'
                      category_id: '[4]'
                      stream_display_name: BBC One HD
                      stream_source: '["http://src.example.net/live/bbc1.ts"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                no_sources:
                  summary: No source
                  value:
                    status: STATUS_NO_SOURCES
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_stream:
    post:
      operationId: Admin_edit_stream
      tags:
        - Admin API
      summary: Edit a live stream
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:676`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1382`, `src/Domain/Stream/StreamService.php:40`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_stream
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_StreamInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '25'
                      type: '1'
                      category_id: '[4]'
                      stream_display_name: BBC One HD
                      stream_source: '["http://src.example.net/live/bbc1.ts"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                no_sources:
                  summary: No source
                  value:
                    status: STATUS_NO_SOURCES
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_stream:
    post:
      operationId: Admin_delete_stream
      tags:
        - Admin API
      summary: Delete a live stream
      description: |-
        Deletes live stream `id` from server `server_id`, or entirely (all servers, row removed) when server_id is -1 or omitted. FAILURE when the id is not a live stream.

        **Permission:** the key's group needs any one of the advanced permissions `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:681`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1404`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_stream
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
            default: -1
          description: '-1 = everywhere and delete the record.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=start_stream:
    post:
      operationId: Admin_start_stream
      tags:
        - Admin API
      summary: Start a live stream
      description: |-
        Starts (or restarts) live stream `id` on `server_id`; `server_id=-1` sends the command to every server the live stream is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:686`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1413`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - start_stream
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=start_channel:
    post:
      operationId: Admin_start_channel
      tags:
        - Admin API
      summary: Start a created channel
      description: |-
        Starts (or restarts) created channel `id` on `server_id`; `server_id=-1` sends the command to every server the created channel is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_cchannel`, `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:685`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1413`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - start_channel
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=start_station:
    post:
      operationId: Admin_start_station
      tags:
        - Admin API
      summary: Start a radio station
      description: |-
        Starts (or restarts) radio station `id` on `server_id`; `server_id=-1` sends the command to every server the radio station is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_radio`, `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:684`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1413`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - start_station
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=stop_stream:
    post:
      operationId: Admin_stop_stream
      tags:
        - Admin API
      summary: Stop a live stream
      description: |-
        Stops live stream `id` on `server_id`; `server_id=-1` sends the command to every server the live stream is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:691`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1425`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stop_stream
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=stop_channel:
    post:
      operationId: Admin_stop_channel
      tags:
        - Admin API
      summary: Stop a created channel
      description: |-
        Stops created channel `id` on `server_id`; `server_id=-1` sends the command to every server the created channel is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_cchannel`, `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:690`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1425`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stop_channel
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=stop_station:
    post:
      operationId: Admin_stop_station
      tags:
        - Admin API
      summary: Stop a radio station
      description: |-
        Stops radio station `id` on `server_id`; `server_id=-1` sends the command to every server the radio station is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_radio`, `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:689`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1425`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stop_station
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_channel:
    get:
      operationId: Admin_get_channel
      tags:
        - Admin API
      summary: Get a created channel
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. FAILURE when the id exists but is not a created channel (streams.type 3). Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `edit_cchannel` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:694`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1437`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_channel
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_StreamRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '60'
                      type: '3'
                      category_id: '[4]'
                      stream_display_name: Movie Marathon
                      stream_source: '["http://src.example.net/live/bbc1.ts"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: '3'
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=create_channel:
    post:
      operationId: Admin_create_channel
      tags:
        - Admin API
      summary: Create a created channel
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `create_channel` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:697`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1444`, `src/Domain/Stream/ChannelService.php:37`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_channel
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_ChannelInput'
                - type: object
                  required:
                    - stream_display_name
                    - server_tree_data
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '60'
                      type: '3'
                      category_id: '[4]'
                      stream_display_name: Movie Marathon
                      stream_source: '["http://src.example.net/live/bbc1.ts"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: '3'
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_channel:
    post:
      operationId: Admin_edit_channel
      tags:
        - Admin API
      summary: Edit a created channel
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_cchannel` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:700`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1455`, `src/Domain/Stream/ChannelService.php:37`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_channel
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ChannelInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '60'
                      type: '3'
                      category_id: '[4]'
                      stream_display_name: Movie Marathon
                      stream_source: '["http://src.example.net/live/bbc1.ts"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: '3'
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_channel:
    post:
      operationId: Admin_delete_channel
      tags:
        - Admin API
      summary: Delete a created channel
      description: |-
        Deletes created channel `id` from server `server_id`, or entirely (all servers, row removed) when server_id is -1 or omitted. FAILURE when the id is not a created channel.

        **Permission:** the key's group needs any one of the advanced permissions `edit_cchannel`, `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:705`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1471`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_channel
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
            default: -1
          description: '-1 = everywhere and delete the record.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_station:
    get:
      operationId: Admin_get_station
      tags:
        - Admin API
      summary: Get a radio station
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. FAILURE when the id exists but is not a radio station (streams.type 4). Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `edit_radio` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:708`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1480`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_station
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_StreamRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '80'
                      type: '4'
                      category_id: '[4]'
                      stream_display_name: Jazz FM
                      stream_source: '["http://radio.example.net/jazz.mp3"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=create_station:
    post:
      operationId: Admin_create_station
      tags:
        - Admin API
      summary: Create a radio station
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_radio` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:711`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1487`, `src/Domain/Stream/RadioService.php:36`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_station
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_StationInput'
                - type: object
                  required:
                    - stream_display_name
                    - server_tree_data
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '80'
                      type: '4'
                      category_id: '[4]'
                      stream_display_name: Jazz FM
                      stream_source: '["http://radio.example.net/jazz.mp3"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_station:
    post:
      operationId: Admin_edit_station
      tags:
        - Admin API
      summary: Edit a radio station
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_radio` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:714`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1498`, `src/Domain/Stream/RadioService.php:36`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_station
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_StationInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '80'
                      type: '4'
                      category_id: '[4]'
                      stream_display_name: Jazz FM
                      stream_source: '["http://radio.example.net/jazz.mp3"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: null
                      movie_subtitles: null
                      read_native: 0
                      target_container: null
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: '1'
                      channel_id: bbc1.uk
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_station:
    post:
      operationId: Admin_delete_station
      tags:
        - Admin API
      summary: Delete a radio station
      description: |-
        Deletes radio station `id` from server `server_id`, or entirely (all servers, row removed) when server_id is -1 or omitted. FAILURE when the id is not a radio station.

        **Permission:** the key's group needs any one of the advanced permissions `edit_radio`, `edit_stream` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:719`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1513`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_station
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
            default: -1
          description: '-1 = everywhere and delete the record.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_movie:
    get:
      operationId: Admin_get_movie
      tags:
        - Admin API
      summary: Get a movie
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. FAILURE when the id exists but is not a movie (streams.type 2). Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `edit_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:722`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1522`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_movie
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_StreamRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '310'
                      type: '2'
                      category_id: '[12]'
                      stream_display_name: Big Buck Bunny (2008)
                      stream_source: '["http://vod.example.net/bbb.mp4"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: '{"name":"Big Buck Bunny","year":"2008","plot":"...","tmdb_id":10378}'
                      movie_subtitles: null
                      read_native: 0
                      target_container: mp4
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: 0
                      channel_id: ''
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: '2008'
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: '10378'
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=create_movie:
    post:
      operationId: Admin_create_movie
      tags:
        - Admin API
      summary: Create a movie
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:725`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1529`, `src/Domain/Vod/MovieService.php:41`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_movie
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_MovieInput'
                - type: object
                  required:
                    - stream_display_name
                    - stream_source
                    - server_tree_data
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '310'
                      type: '2'
                      category_id: '[12]'
                      stream_display_name: Big Buck Bunny (2008)
                      stream_source: '["http://vod.example.net/bbb.mp4"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: '{"name":"Big Buck Bunny","year":"2008","plot":"...","tmdb_id":10378}'
                      movie_subtitles: null
                      read_native: 0
                      target_container: mp4
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: 0
                      channel_id: ''
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: '2008'
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: '10378'
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                no_source:
                  summary: stream_source missing
                  value:
                    status: STATUS_NO_SOURCE
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_movie:
    post:
      operationId: Admin_edit_movie
      tags:
        - Admin API
      summary: Edit a movie
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:728`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1540`, `src/Domain/Vod/MovieService.php:41`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_movie
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_MovieInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '310'
                      type: '2'
                      category_id: '[12]'
                      stream_display_name: Big Buck Bunny (2008)
                      stream_source: '["http://vod.example.net/bbb.mp4"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: '{"name":"Big Buck Bunny","year":"2008","plot":"...","tmdb_id":10378}'
                      movie_subtitles: null
                      read_native: 0
                      target_container: mp4
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: 0
                      channel_id: ''
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: '2008'
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: '10378'
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                no_source:
                  summary: stream_source missing
                  value:
                    status: STATUS_NO_SOURCE
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_movie:
    post:
      operationId: Admin_delete_movie
      tags:
        - Admin API
      summary: Delete a movie
      description: |-
        Deletes movie `id` from server `server_id`, or entirely (all servers, row removed) when server_id is -1 or omitted. FAILURE when the id is not a movie.

        **Permission:** the key's group needs any one of the advanced permissions `edit_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:733`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1560`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_movie
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
            default: -1
          description: '-1 = everywhere and delete the record.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=start_movie:
    post:
      operationId: Admin_start_movie
      tags:
        - Admin API
      summary: Start a movie (encode)
      description: |-
        Starts (or restarts) movie (encode) `id` on `server_id`; `server_id=-1` sends the command to every server the movie (encode) is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:737`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1569`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - start_movie
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=start_episode:
    post:
      operationId: Admin_start_episode
      tags:
        - Admin API
      summary: Start a episode (encode)
      description: |-
        Starts (or restarts) episode (encode) `id` on `server_id`; `server_id=-1` sends the command to every server the episode (encode) is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_episode` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:736`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1569`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - start_episode
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=stop_movie:
    post:
      operationId: Admin_stop_movie
      tags:
        - Admin API
      summary: Stop a movie (encode)
      description: |-
        Stops movie (encode) `id` on `server_id`; `server_id=-1` sends the command to every server the movie (encode) is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:741`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1581`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stop_movie
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=stop_episode:
    post:
      operationId: Admin_stop_episode
      tags:
        - Admin API
      summary: Stop a episode (encode)
      description: |-
        Stops episode (encode) `id` on `server_id`; `server_id=-1` sends the command to every server the episode (encode) is assigned to (API client), otherwise to that server over NodeRpc. STATUS_SUCCESS only when the server reported a truthy result. `server_id` is read without a default: omitting it passes null (treated as a single-server call that fails).

        **Permission:** the key's group needs any one of the advanced permissions `edit_episode` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:740`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1581`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stop_episode
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: true
          schema:
            type: integer
          description: Server id, or -1 for all assigned servers.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_episode:
    get:
      operationId: Admin_get_episode
      tags:
        - Admin API
      summary: Get a episode
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. FAILURE when the id exists but is not a episode (streams.type 5). Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `edit_episode` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:744`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1593`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_episode
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_StreamRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '420'
                      type: '5'
                      category_id: '[]'
                      stream_display_name: Show - S01E01 - Pilot
                      stream_source: '["/media/show/s01e01.mkv"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: '{"season":1,"plot":"..."}'
                      movie_subtitles: null
                      read_native: 0
                      target_container: mkv
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: 0
                      channel_id: ''
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=create_episode:
    post:
      operationId: Admin_create_episode
      tags:
        - Admin API
      summary: Create a episode
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input. EpisodeService may answer with a non-standard result (e.g. a multi-import summary, STATUS_SUCCESS_MULTI) when several sources are imported.

        **Permission:** the key's group needs any one of the advanced permissions `add_episode` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:747`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1600`, `src/Domain/Vod/EpisodeService.php:35`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_episode
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_EpisodeInput'
                - type: object
                  required:
                    - series
                    - season_num
                    - stream_source
                    - server_tree_data
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '420'
                      type: '5'
                      category_id: '[]'
                      stream_display_name: Show - S01E01 - Pilot
                      stream_source: '["/media/show/s01e01.mkv"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: '{"season":1,"plot":"..."}'
                      movie_subtitles: null
                      read_native: 0
                      target_container: mkv
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: 0
                      channel_id: ''
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_episode:
    post:
      operationId: Admin_edit_episode
      tags:
        - Admin API
      summary: Edit a episode
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_episode` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:750`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1611`, `src/Domain/Vod/EpisodeService.php:35`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_episode
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_EpisodeInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '420'
                      type: '5'
                      category_id: '[]'
                      stream_display_name: Show - S01E01 - Pilot
                      stream_source: '["/media/show/s01e01.mkv"]'
                      stream_icon: https://img.example.com/bbc1.png
                      notes: ''
                      enable_transcode: 0
                      transcode_attributes: '[]'
                      custom_ffmpeg: ''
                      movie_properties: '{"season":1,"plot":"..."}'
                      movie_subtitles: null
                      read_native: 0
                      target_container: mkv
                      stream_all: 0
                      remove_subtitles: 0
                      custom_sid: ''
                      epg_id: 0
                      channel_id: ''
                      epg_lang: ''
                      order: '1'
                      auto_restart: '[]'
                      transcode_profile_id: 0
                      gen_timestamps: '1'
                      added: '1760600000'
                      series_no: 0
                      direct_source: 0
                      tv_archive_duration: 0
                      tv_archive_server_id: 0
                      tv_archive_pid: 0
                      vframes_server_id: 0
                      vframes_pid: 0
                      movie_symlink: 0
                      rtmp_output: 0
                      allow_record: 0
                      probesize_ondemand: '128000'
                      custom_map: ''
                      external_push: '[]'
                      delay_minutes: 0
                      tmdb_language: ''
                      llod: 0
                      year: null
                      rating: 0
                      plex_uuid: ''
                      uuid: 8f0e...
                      epg_offset: 0
                      updated: '2026-10-16 12:00:00'
                      similar: null
                      tmdb_id: null
                      adaptive_link: null
                      title_sync: null
                      fps_restart: 0
                      fps_threshold: '90'
                      direct_proxy: 0
                      force_ffmpeg: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_episode:
    post:
      operationId: Admin_delete_episode
      tags:
        - Admin API
      summary: Delete a episode
      description: |-
        Deletes episode `id` from server `server_id`, or entirely (all servers, row removed) when server_id is -1 or omitted. FAILURE when the id is not a episode.

        **Permission:** the key's group needs any one of the advanced permissions `edit_episode` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:755`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1633`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_episode
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
            default: -1
          description: '-1 = everywhere and delete the record.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_series:
    get:
      operationId: Admin_get_series
      tags:
        - Admin API
      summary: Get a series
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. Non-numeric id = TypeError (HTTP 500, empty body).

        **Permission:** the key's group needs any one of the advanced permissions `edit_series` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:758`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1642`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_series
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_SeriesRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '3'
                      title: Example Show
                      category_id: '[14]'
                      cover: https://img.example.com/show.jpg
                      cover_big: ''
                      genre: Drama
                      plot: ...
                      cast: ''
                      rating: '7.9'
                      director: ''
                      release_date: '2024-01-10'
                      last_modified: '1760600000'
                      tmdb_id: '12345'
                      seasons: '[]'
                      episode_run_time: '45'
                      backdrop_path: '[]'
                      youtube_trailer: ''
                      tmdb_language: ''
                      year: '2024'
                      plex_uuid: ''
                      similar: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
        '500':
          description: 'Non-numeric id: PHP TypeError, HTTP 500 with an empty body'
  /{access_code}/?action=create_series:
    post:
      operationId: Admin_create_series
      tags:
        - Admin API
      summary: Create a series
      description: |-
        Creates the record. On success `data` is the stored record as `get_*` returns it; on a validation error `status` names the error and `data` echoes the (processed) input.

        **Permission:** the key's group needs any one of the advanced permissions `add_series` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:761`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1649`, `src/Domain/Vod/SeriesService.php:36`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_series
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_SeriesInput'
                - type: object
                  required:
                    - title
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '3'
                      title: Example Show
                      category_id: '[14]'
                      cover: https://img.example.com/show.jpg
                      cover_big: ''
                      genre: Drama
                      plot: ...
                      cast: ''
                      rating: '7.9'
                      director: ''
                      release_date: '2024-01-10'
                      last_modified: '1760600000'
                      tmdb_id: '12345'
                      seasons: '[]'
                      episode_run_time: '45'
                      backdrop_path: '[]'
                      youtube_trailer: ''
                      tmdb_language: ''
                      year: '2024'
                      plex_uuid: ''
                      similar: null
                no_title:
                  summary: title missing
                  value:
                    status: STATUS_NO_TITLE
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_series:
    post:
      operationId: Admin_edit_series
      tags:
        - Admin API
      summary: Edit a series
      description: |-
        Updates record `id`. Unknown id = `{"status":"STATUS_FAILURE"}`. Fields you leave out keep their stored values. On success `data` is the updated record.

        **Permission:** the key's group needs any one of the advanced permissions `edit_series` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:764`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1660`, `src/Domain/Vod/SeriesService.php:36`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_series
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_SeriesInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '3'
                      title: Example Show
                      category_id: '[14]'
                      cover: https://img.example.com/show.jpg
                      cover_big: ''
                      genre: Drama
                      plot: ...
                      cast: ''
                      rating: '7.9'
                      director: ''
                      release_date: '2024-01-10'
                      last_modified: '1760600000'
                      tmdb_id: '12345'
                      seasons: '[]'
                      episode_run_time: '45'
                      backdrop_path: '[]'
                      youtube_trailer: ''
                      tmdb_language: ''
                      year: '2024'
                      plex_uuid: ''
                      similar: null
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_series:
    post:
      operationId: Admin_delete_series
      tags:
        - Admin API
      summary: Delete a series
      description: |-
        Deletes series `id` and all of its episodes. FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `edit_series` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:769`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1675`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_series
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_servers:
    get:
      operationId: Admin_get_servers
      tags:
        - Admin API
      summary: List online streaming servers
      description: |-
        Returns every record as a **bare JSON array** (no `status` envelope, no paging; start/limit are ignored). show_columns/hide_columns are applied to each row. **Only online streaming servers** (server_type 0, ServerRepository::getStreamingSimple); offline servers and proxies are omitted. Each row gains `server_online` and `order`; `php_pids` is removed.

        **Permission:** the key's group needs any one of the advanced permissions `servers` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:772`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1684`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_servers
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Admin_ServerRow'
                    description: 'Bare JSON array: no `status` envelope (filterRows() returns the rows only). An empty list is `[]`.'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    - id: '2'
                      server_type: 0
                      xc_vm_version: 2.5.0
                      server_name: LB-1
                      domain_name: lb1.example.com
                      server_ip: 203.0.113.20
                      private_ip: ''
                      is_main: 0
                      enabled: '1'
                      parent_id: null
                      http_broadcast_port: '80'
                      https_broadcast_port: '443'
                      total_clients: '1000'
                      network_interface: eth0
                      status: '1'
                      enable_geoip: 0
                      geoip_countries: '[]'
                      last_check_ago: '1760699990'
                      total_services: '4'
                      rtmp_port: '8880'
                      enable_isp: 0
                      network_guaranteed_speed: '1000'
                      timeshift_only: 0
                      random_ip: 0
                      enable_proxy: 0
                      enable_https: '1'
                      uuid: f1c2...
                      requests_per_second: '12'
                      connections: '87'
                      users: '64'
                      governor: ''
                      enable_gzip: 0
                      server_online: true
                      order: '1'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_server:
    get:
      operationId: Admin_get_server
      tags:
        - Admin API
      summary: Get a server or proxy
      description: |-
        Returns one record as `{"status":"STATUS_SUCCESS","data":{...}}`; `{"status":"STATUS_FAILURE"}` when it does not exist. show_columns/hide_columns filter `data`. `php_pids` is removed.

        **Permission:** the key's group needs any one of the advanced permissions `servers`, `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:775`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1689`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_server
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        $ref: '#/components/schemas/Admin_ServerRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '2'
                      server_type: 0
                      xc_vm_version: 2.5.0
                      server_name: LB-1
                      domain_name: lb1.example.com
                      server_ip: 203.0.113.20
                      private_ip: ''
                      is_main: 0
                      enabled: '1'
                      parent_id: null
                      http_broadcast_port: '80'
                      https_broadcast_port: '443'
                      total_clients: '1000'
                      network_interface: eth0
                      status: '1'
                      enable_geoip: 0
                      geoip_countries: '[]'
                      last_check_ago: '1760699990'
                      total_services: '4'
                      rtmp_port: '8880'
                      enable_isp: 0
                      network_guaranteed_speed: '1000'
                      timeshift_only: 0
                      random_ip: 0
                      enable_proxy: 0
                      enable_https: '1'
                      uuid: f1c2...
                      requests_per_second: '12'
                      connections: '87'
                      users: '64'
                      governor: ''
                      enable_gzip: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=install_server:
    post:
      operationId: Admin_install_server
      tags:
        - Admin API
      summary: Install a load balancer over SSH
      description: |-
        Registers a new load balancer and launches the installer over SSH in the background (the controller forces `type=2`). Returns once the job is queued; follow progress in the panel. Credentials are passed to the installer and not stored.

        **Permission:** the key's group needs any one of the advanced permissions `add_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:778`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1698`, `src/Domain/Server/ServerService.php:357`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - install_server
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_ServerInstallInput'
                - type: object
                  required:
                    - ssh_port
                    - root_username
                    - root_password
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      insert_id: 4
                invalid_input:
                  summary: ssh_port/root_username/root_password missing
                  value:
                    status: STATUS_INVALID_INPUT
                invalid_ip:
                  summary: Bad IP
                  value:
                    status: STATUS_INVALID_IP
                    data: {}
                exists_ip:
                  summary: IP already a server
                  value:
                    status: STATUS_EXISTS_IP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=install_proxy:
    post:
      operationId: Admin_install_proxy
      tags:
        - Admin API
      summary: Install a proxy over SSH
      description: |-
        Registers a new proxy and launches the installer over SSH in the background (the controller forces `type=1`). Returns once the job is queued; follow progress in the panel. Credentials are passed to the installer and not stored.

        **Permission:** the key's group needs any one of the advanced permissions `add_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:783`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1698`, `src/Domain/Server/ServerService.php:357`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - install_proxy
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              allOf:
                - $ref: '#/components/schemas/Admin_ServerInstallInput'
                - type: object
                  required:
                    - ssh_port
                    - root_username
                    - root_password
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      insert_id: 4
                invalid_input:
                  summary: ssh_port/root_username/root_password missing
                  value:
                    status: STATUS_INVALID_INPUT
                invalid_ip:
                  summary: Bad IP
                  value:
                    status: STATUS_INVALID_IP
                    data: {}
                exists_ip:
                  summary: IP already a server
                  value:
                    status: STATUS_EXISTS_IP
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_server:
    post:
      operationId: Admin_edit_server
      tags:
        - Admin API
      summary: Edit a streaming server
      description: |-
        Updates streaming server `id`. FAILURE when it does not exist or is a proxy (server_type 1).

        **Permission:** the key's group needs any one of the advanced permissions `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:787`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1713`, `src/Domain/Server/ServerService.php:37`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_server
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ServerEditInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '2'
                      server_type: 0
                      xc_vm_version: 2.5.0
                      server_name: LB-1
                      domain_name: lb1.example.com
                      server_ip: 203.0.113.20
                      private_ip: ''
                      is_main: 0
                      enabled: '1'
                      parent_id: null
                      http_broadcast_port: '80'
                      https_broadcast_port: '443'
                      total_clients: '1000'
                      network_interface: eth0
                      status: '1'
                      enable_geoip: 0
                      geoip_countries: '[]'
                      last_check_ago: '1760699990'
                      total_services: '4'
                      rtmp_port: '8880'
                      enable_isp: 0
                      network_guaranteed_speed: '1000'
                      timeshift_only: 0
                      random_ip: 0
                      enable_proxy: 0
                      enable_https: '1'
                      uuid: f1c2...
                      requests_per_second: '12'
                      connections: '87'
                      users: '64'
                      governor: ''
                      enable_gzip: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                port:
                  summary: Port collision
                  value:
                    status: STATUS_PORT_IN_USE
                    data: {}
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_proxy:
    post:
      operationId: Admin_edit_proxy
      tags:
        - Admin API
      summary: Edit a proxy server
      description: |-
        Updates proxy `id`. FAILURE when it does not exist or is not a proxy.

        **Permission:** the key's group needs any one of the advanced permissions `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:792`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1731`, `src/Domain/Server/ServerService.php:290`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_proxy
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ProxyEditInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: '2'
                      server_type: '1'
                      xc_vm_version: 2.5.0
                      server_name: LB-1
                      domain_name: lb1.example.com
                      server_ip: 203.0.113.20
                      private_ip: ''
                      is_main: 0
                      enabled: '1'
                      parent_id: null
                      http_broadcast_port: '80'
                      https_broadcast_port: '443'
                      total_clients: '1000'
                      network_interface: eth0
                      status: '1'
                      enable_geoip: 0
                      geoip_countries: '[]'
                      last_check_ago: '1760699990'
                      total_services: '4'
                      rtmp_port: '8880'
                      enable_isp: 0
                      network_guaranteed_speed: '1000'
                      timeshift_only: 0
                      random_ip: 0
                      enable_proxy: 0
                      enable_https: '1'
                      uuid: f1c2...
                      requests_per_second: '12'
                      connections: '87'
                      users: '64'
                      governor: ''
                      enable_gzip: 0
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_server:
    post:
      operationId: Admin_delete_server
      tags:
        - Admin API
      summary: Delete a server
      description: |-
        Deletes server/proxy `id` (the main server cannot be deleted). FAILURE when it does not exist.

        **Permission:** the key's group needs any one of the advanced permissions `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:797`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1749`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_server
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_settings:
    get:
      operationId: Admin_get_settings
      tags:
        - Admin API
      summary: Get panel settings
      description: |-
        Returns the `settings` row (about 300 keys). Tokens other than `full` scope do not see secrets: the cluster-withheld keys (src/Core/Cluster/lb_settings_keys.php `withheld`), `metrics_token` and `reminders_webhook` are removed. show_columns/hide_columns filter `data`.

        **Permission:** the key's group needs any one of the advanced permissions `settings` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:800`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1769`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1765`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_settings
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      server_name: XC_VM
                      default_timezone: Europe/London
                      live_streaming_pass: 9b7c...
                      api_legacy_keys: '1'
                      streams_grouped: '1'
                      disallow_empty_user_agents: 0
                      encrypt_hls: 0
                      show_all_category_mag: '1'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_settings:
    post:
      operationId: Admin_edit_settings
      tags:
        - Admin API
      summary: Edit panel settings
      description: |-
        Saves settings; keys you leave out keep their values. Replies with the parsed service status and `data` = the settings after the save (secrets removed for non-full tokens).

        **Permission:** the key's group needs any one of the advanced permissions `settings` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:803`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1779`, `src/Domain/Server/SettingsService.php:222`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_settings
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_SettingsInput'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      server_name: XC_VM
                      default_timezone: Europe/London
                      live_streaming_pass: 9b7c...
                      api_legacy_keys: '1'
                      streams_grouped: '1'
                      disallow_empty_user_agents: 0
                      encrypt_hls: 0
                      show_all_category_mag: '1'
                invalid:
                  summary: Cluster validation failed
                  value:
                    status: STATUS_INVALID_DATA
                    data:
                      server_name: XC_VM
                      default_timezone: Europe/London
                      live_streaming_pass: 9b7c...
                      api_legacy_keys: '1'
                      streams_grouped: '1'
                      disallow_empty_user_agents: 0
                      encrypt_hls: 0
                      show_all_category_mag: '1'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_server_stats:
    get:
      operationId: Admin_get_server_stats
      tags:
        - Admin API
      summary: Server resource and connection stats
      description: |-
        Node `stats` (SystemInfo::getStats) plus DB counters: requests_per_second, open_connections, total_connections, online_users, total_users, total_streams, total_running_streams, offline_streams, network_guaranteed_speed. Counter keys are absent when their query returns no row. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `index`, `add_server`, `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:806`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1788`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_server_stats
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      cpu: 12.4
                      cpu_cores: 8
                      cpu_avg: 10.1
                      cpu_name: Intel Xeon E-2236
                      total_mem: 32768000
                      total_mem_free: 20480000
                      total_mem_used: 12288000
                      total_mem_used_percent: 37.5
                      total_disk_space: 500000000000
                      free_disk_space: 320000000000
                      kernel: 6.8.0-45-generic
                      uptime: 12d 4h 22m
                      total_running_streams: '42'
                      bytes_sent: 51200000
                      bytes_received: 1280000
                      network_speed: 1000
                      interfaces:
                        - eth0
                      gpu_info: []
                      video_devices: []
                      audio_devices: []
                      requests_per_second: '12'
                      open_connections: '87'
                      total_connections: '230'
                      online_users: 64
                      total_users: 190
                      total_streams: '120'
                      offline_streams: '3'
                      network_guaranteed_speed: '1000'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_fpm_status:
    get:
      operationId: Admin_get_fpm_status
      tags:
        - Admin API
      summary: PHP-FPM status page
      description: |-
        `data` is the raw PHP-FPM status text (not JSON). Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `add_server`, `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:809`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1827`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_fpm_status
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data: |
                      pool:                 xc_vm
                      process manager:      dynamic
                      active processes:     3
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_rtmp_stats:
    get:
      operationId: Admin_get_rtmp_stats
      tags:
        - Admin API
      summary: nginx-rtmp statistics
      description: |-
        `data` is the node's RTMP stat document decoded from JSON. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `rtmp` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:812`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1835`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_rtmp_stats
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      server:
                        application:
                          - name: live
                            live:
                              nclients: '0'
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_free_space:
    get:
      operationId: Admin_get_free_space
      tags:
        - Admin API
      summary: Disk usage (df)
      description: |-
        `data` is an array of `df -h` output lines. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `process_monitor`, `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:815`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1843`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_free_space
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: array
                        items:
                          type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - Filesystem      Size  Used Avail Use% Mounted on
                      - /dev/sda1       480G  160G  296G  36% /
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_pids:
    get:
      operationId: Admin_get_pids
      tags:
        - Admin API
      summary: Process list
      description: |-
        `data` is an array of `ps` output lines for the XC_VM user. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `process_monitor` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:818`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1851`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_pids
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: array
                        items:
                          type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - xc_vm  1234  2.1  0.4 ffmpeg -i http://src.example.net/live/bbc1.ts ...
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_certificate_info:
    get:
      operationId: Admin_get_certificate_info
      tags:
        - Admin API
      summary: TLS certificate info
      description: |-
        `data` describes the server's certificate. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `servers`, `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:821`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1859`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_certificate_info
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        properties:
                          serial:
                            type: string
                          expiration:
                            type: integer
                          subject:
                            type: string
                          path:
                            type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      serial: 04A1B2C3D4
                      expiration: 1798761600
                      subject: CN=lb1.example.com
                      path: /home/xc_vm/bin/certificates/fullchain.pem
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=reload_nginx:
    post:
      operationId: Admin_reload_nginx
      tags:
        - Admin API
      summary: Reload nginx
      description: |-
        Sends the reload; always STATUS_SUCCESS (the result is not checked). Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `edit_server` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:824`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1867`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - reload_nginx
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=clear_temp:
    post:
      operationId: Admin_clear_temp
      tags:
        - Admin API
      summary: Clear the temp directory
      description: |-
        STATUS_SUCCESS when the node reports success. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `process_monitor` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:827`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1872`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - clear_temp
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=clear_streams:
    post:
      operationId: Admin_clear_streams
      tags:
        - Admin API
      summary: Clear the streams directory
      description: |-
        Deletes stream segment files on the node. STATUS_SUCCESS when the node reports success. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `process_monitor` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:830`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1880`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - clear_streams
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_directory:
    get:
      operationId: Admin_get_directory
      tags:
        - Admin API
      summary: List a directory on a server
      description: |-
        Lists `dir` on the node (node-side allow-list). A refused directory gives STATUS_FAILURE. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `add_episode`, `edit_episode`, `add_movie`, `edit_movie`, `create_channel`, `edit_cchannel` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:833`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1888`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_directory
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
        - name: dir
          in: query
          required: true
          schema:
            type: string
            example: /media/
          description: Absolute directory path.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        properties:
                          dirs:
                            type: array
                            items:
                              type: string
                          files:
                            type: array
                            items:
                              type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      dirs:
                        - movies
                        - series
                      files:
                        - readme.txt
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=kill_pid:
    post:
      operationId: Admin_kill_pid
      tags:
        - Admin API
      summary: Kill a process
      description: |-
        Kills `pid` (intval) on the node; the node only kills XC_VM-owned processes. Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `process_monitor` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:836`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1903`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - kill_pid
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
        - name: pid
          in: query
          required: true
          schema:
            type: integer
          description: Process id.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=kill_connection:
    post:
      operationId: Admin_kill_connection
      tags:
        - Admin API
      summary: Close a client connection
      description: |-
        Closes the live connection `activity_id` (a lines_live row id, or the connection uuid when Redis tracks connections). Calls the node over NodeRpc; STATUS_FAILURE when the node does not answer.

        **Permission:** the key's group needs any one of the advanced permissions `connection_logs` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:839`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1911`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - kill_connection
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Target server (default: the main server, SERVER_ID).'
        - name: activity_id
          in: query
          required: true
          schema:
            type: string
          description: Connection id or uuid.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=adjust_credits:
    post:
      operationId: Admin_adjust_credits
      tags:
        - Admin API
      summary: Add or remove credits
      description: |-
        Adds `credits` (intval; negative removes, and fails if the balance does not cover it) to registered user `id` and logs it in users_credits_logs with `reason`. FAILURE when credits is not numeric, the user does not exist, or the user is in a reserved (admin) group. Note: the reseller API calls the same field `note`.

        **Permission:** the key's group needs any one of the advanced permissions `edit_reguser` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:842`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1921`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - adjust_credits
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Id'
        - name: credits
          in: query
          required: true
          schema:
            type: number
          description: Amount; decimals are truncated.
        - name: reason
          in: query
          required: false
          schema:
            type: string
          description: Log text (default empty).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                not_found:
                  $ref: '#/components/examples/Admin_Failure'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=reload_cache:
    post:
      operationId: Admin_reload_cache
      tags:
        - Admin API
      summary: Rebuild the cache
      description: |-
        Starts `console.php cron:cache_engine` in the background. Always STATUS_SUCCESS.

        **Permission:** the key's group needs any one of the advanced permissions `database` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:845`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1937`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - reload_cache
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_active_codes:
    get:
      operationId: Admin_get_active_codes
      tags:
        - Admin API
      summary: List activation codes
      description: |-
        Paged list of activation codes, newest first. Reply: `{status,total,count,start,limit,data}` where `data` is the row list filtered by show_columns/hide_columns. Every active-code method re-checks its own ACTION_PERMISSIONS entry.

        **Permission:** the key's group needs any one of the advanced permissions `users`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:848`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1954`, `src/Domain/Line/ActiveCodeService.php:1193`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_active_codes
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - name: batch_name
          in: query
          required: false
          schema:
            type: string
          description: Exact batch (alias `batch`).
        - name: package_id
          in: query
          required: false
          schema:
            type: integer
          description: Package (alias `package`).
        - name: status
          in: query
          required: false
          schema:
            type: string
          description: 0/disabled/suspended, 1/stock/ready, 2/active (not expired), 3/expired.
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: LIKE match on code, batch, line username, mac, device_id.
        - name: created_by
          in: query
          required: false
          schema:
            type: integer
          description: Owner filter (alias `reseller_id`).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      total:
                        type: integer
                      count:
                        type: integer
                      start:
                        type: integer
                      limit:
                        type: integer
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Admin_ActiveCodeRow'
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    total: 120
                    count: 1
                    start: 0
                    limit: 50
                    data:
                      - id: 4
                        activation_code: K7M3Q9TZ2H
                        batch_name: BATCH-20261017-A1B2C
                        status: 1
                        status_key: stock
                        status_label: Ready (Stock)
                        package_id: 3
                        package_name: 1 Month
                        subscriber_id: 55
                        line_username: ac_1f9e2d3c4
                        line_password: 8c1d2e3f4a
                        exp_date: null
                        exp_date_formatted: null
                        remaining_days: 0
                        mac: null
                        device_id: null
                        max_connections: 1
                        is_trial: 0
                        is_adult: 0
                        purchase_cost: 10
                        created_by: 5
                        creator_username: reseller1
                        created_at: 1760700000
                        created_at_formatted: '2026-10-17 11:20:00'
                        activated_at: null
                        activated_at_formatted: null
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_active_code:
    get:
      operationId: Admin_get_active_code
      tags:
        - Admin API
      summary: Get one activation code
      description: |-
        Full code detail (package, subscriber line with credentials, device binding, playlist URLs). Every active-code method re-checks its own ACTION_PERMISSIONS entry.

        **Permission:** the key's group needs any one of the advanced permissions `users` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:851`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1970`, `src/Domain/Line/ActiveCodeService.php:1379`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: Code id. Either `id` or `code`.
        - name: code
          in: query
          required: false
          schema:
            type: string
          description: The activation code string (looked up when `id` is absent; ActiveCodeService::reference).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      id: 4
                      activation_code: K7M3Q9TZ2H
                      batch_name: BATCH-20261017-A1B2C
                      status: 1
                      status_key: stock
                      status_label: Ready (Stock)
                      package:
                        id: 3
                        name: 1 Month
                        is_trial: false
                        official_duration: '1'
                        official_duration_in: months
                      subscriber_line:
                        id: 55
                        username: ac_1f9e2d3c4
                        password: 8c1d2e3f4a
                        exp_date: null
                        exp_date_formatted: null
                        enabled: false
                        admin_enabled: true
                        last_ip: null
                        last_activity: null
                      device_binding:
                        mac: null
                        device_id: null
                        is_locked: false
                      connection_limits:
                        max_connections: 1
                        active_connections: 0
                      playlists:
                        m3u_hls: http://tv.example.com/get.php?username=ac_1f9e2d3c4&password=8c1d2e3f4a&type=m3u_plus&output=hls
                        m3u_ts: http://tv.example.com/get.php?username=ac_1f9e2d3c4&password=8c1d2e3f4a&type=m3u_plus&output=ts
                      credentials:
                        server_url: http://tv.example.com
                        username: ac_1f9e2d3c4
                        password: 8c1d2e3f4a
                      created_by:
                        id: 5
                        username: reseller1
                      created_at: 1760700000
                      created_at_formatted: '2026-10-17 11:20:00'
                      activated_at: null
                      activated_at_formatted: null
                not_found:
                  summary: Active code not found.
                  value:
                    status: STATUS_FAILURE
                    error: Active code not found.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=generate_active_codes:
    post:
      operationId: Admin_generate_active_codes
      tags:
        - Admin API
      summary: Generate a batch of activation codes
      description: |-
        Creates `num_codes` codes, each with a disabled backing line that is switched on when the code is redeemed. No credits are charged. Note the reply key `qty` but the input key `num_codes`.

        **Permission:** the key's group needs any one of the advanced permissions `add_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:854`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1982`, `src/Domain/Line/ActiveCodeService.php:69`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - generate_active_codes
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ActiveCodeGenerate'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      message:
                        type: string
                      batch_name:
                        type: string
                      qty:
                        type: integer
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            line_id:
                              type: integer
                            username:
                              type: string
                            password:
                              type: string
                            batch_name:
                              type: string
                      error:
                        type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: Successfully generated 2 active codes.
                    batch_name: BATCH-20261017-A1B2C
                    qty: 2
                    data:
                      - code: K7M3Q9TZ2H
                        line_id: 55
                        username: ac_1f9e2d3c4
                        password: 8c1d2e3f4a
                        batch_name: BATCH-20261017-A1B2C
                      - code: P4W8N2XR6C
                        line_id: 56
                        username: ac_7a8b9c0d1
                        password: 3e4f5a6b7c
                        batch_name: BATCH-20261017-A1B2C
                bad_package:
                  summary: Invalid package selected.
                  value:
                    status: STATUS_FAILURE
                    error: Invalid package selected.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=create_active_code:
    post:
      operationId: Admin_create_active_code
      tags:
        - Admin API
      summary: Create activation codes (alias of generate_active_codes)
      description: |-
        Creates `num_codes` codes, each with a disabled backing line that is switched on when the code is redeemed. No credits are charged. Note the reply key `qty` but the input key `num_codes`. Same handler as generate_active_codes.

        **Permission:** the key's group needs any one of the advanced permissions `add_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:855`, `src/Public/Controllers/Api/AdminAPIWrapper.php:1982`, `src/Domain/Line/ActiveCodeService.php:69`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ActiveCodeGenerate'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      message:
                        type: string
                      batch_name:
                        type: string
                      qty:
                        type: integer
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            line_id:
                              type: integer
                            username:
                              type: string
                            password:
                              type: string
                            batch_name:
                              type: string
                      error:
                        type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: Successfully generated 2 active codes.
                    batch_name: BATCH-20261017-A1B2C
                    qty: 2
                    data:
                      - code: K7M3Q9TZ2H
                        line_id: 55
                        username: ac_1f9e2d3c4
                        password: 8c1d2e3f4a
                        batch_name: BATCH-20261017-A1B2C
                      - code: P4W8N2XR6C
                        line_id: 56
                        username: ac_7a8b9c0d1
                        password: 3e4f5a6b7c
                        batch_name: BATCH-20261017-A1B2C
                bad_package:
                  summary: Invalid package selected.
                  value:
                    status: STATUS_FAILURE
                    error: Invalid package selected.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=edit_active_code:
    post:
      operationId: Admin_edit_active_code
      tags:
        - Admin API
      summary: Edit an activation code
      description: |-
        Updates code `id`; replies with `message` and the refreshed detail in `data`. Every active-code method re-checks its own ACTION_PERMISSIONS entry.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:858`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2000`, `src/Domain/Line/ActiveCodeService.php:884`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - edit_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: true
          schema:
            type: integer
          description: Code id.
      requestBody:
        required: false
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Admin_ActiveCodeEdit'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: Active code updated successfully.
                    data:
                      id: 4
                      activation_code: K7M3Q9TZ2H
                      batch_name: BATCH-20261017-A1B2C
                      status: 1
                      status_key: stock
                      status_label: Ready (Stock)
                      package:
                        id: 3
                        name: 1 Month
                        is_trial: false
                        official_duration: '1'
                        official_duration_in: months
                      subscriber_line:
                        id: 55
                        username: ac_1f9e2d3c4
                        password: 8c1d2e3f4a
                        exp_date: null
                        exp_date_formatted: null
                        enabled: false
                        admin_enabled: true
                        last_ip: null
                        last_activity: null
                      device_binding:
                        mac: null
                        device_id: null
                        is_locked: false
                      connection_limits:
                        max_connections: 1
                        active_connections: 0
                      playlists:
                        m3u_hls: http://tv.example.com/get.php?username=ac_1f9e2d3c4&password=8c1d2e3f4a&type=m3u_plus&output=hls
                        m3u_ts: http://tv.example.com/get.php?username=ac_1f9e2d3c4&password=8c1d2e3f4a&type=m3u_plus&output=ts
                      credentials:
                        server_url: http://tv.example.com
                        username: ac_1f9e2d3c4
                        password: 8c1d2e3f4a
                      created_by:
                        id: 5
                        username: reseller1
                      created_at: 1760700000
                      created_at_formatted: '2026-10-17 11:20:00'
                      activated_at: null
                      activated_at_formatted: null
                failed:
                  summary: Failed to update active code.
                  value:
                    status: STATUS_FAILURE
                    error: Failed to update active code.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=delete_active_code:
    post:
      operationId: Admin_delete_active_code
      tags:
        - Admin API
      summary: Delete an activation code
      description: |-
        Deletes code `id` and its backing line. No refund.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:863`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2016`, `src/Domain/Line/ActiveCodeService.php:877`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - delete_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: true
          schema:
            type: integer
          description: Code id.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: 1 code(s) deleted successfully.
                failed:
                  summary: Failed to delete active code.
                  value:
                    status: STATUS_FAILURE
                    error: Failed to delete active code.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=enable_active_code:
    post:
      operationId: Admin_enable_active_code
      tags:
        - Admin API
      summary: Enable an activation code
      description: |-
        Enables code `id` (massAction `enable`), also switching its backing line.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:869`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2028`, `src/Domain/Line/ActiveCodeService.php:727`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - enable_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: true
          schema:
            type: integer
          description: Code id.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: 1 codes successfully enabled.
                failed:
                  summary: No accessible codes found for mass action.
                  value:
                    status: STATUS_FAILURE
                    error: No accessible codes found for mass action.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=disable_active_code:
    post:
      operationId: Admin_disable_active_code
      tags:
        - Admin API
      summary: Disable an activation code
      description: |-
        Disables code `id` (massAction `disable`), also switching its backing line.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:866`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2040`, `src/Domain/Line/ActiveCodeService.php:727`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - disable_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: true
          schema:
            type: integer
          description: Code id.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: 1 codes suspended.
                failed:
                  summary: No accessible codes found for mass action.
                  value:
                    status: STATUS_FAILURE
                    error: No accessible codes found for mass action.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=reset_active_code_device:
    post:
      operationId: Admin_reset_active_code_device
      tags:
        - Admin API
      summary: Reset device lock
      description: |-
        Clears `mac` and `device_id` on the code so it can be redeemed on another device.

        **Permission:** the key's group needs any one of the advanced permissions `edit_user`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:872`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2052`, `src/Domain/Line/ActiveCodeService.php:1566`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - reset_active_code_device
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: Code id. Either `id` or `code`.
        - name: code
          in: query
          required: false
          schema:
            type: string
          description: The activation code string (looked up when `id` is absent; ActiveCodeService::reference).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: Hardware and MAC address lock reset successfully.
                not_found:
                  summary: Activation code not found.
                  value:
                    status: STATUS_FAILURE
                    error: Activation code not found.
                denied:
                  summary: Access denied to this activation code.
                  value:
                    status: STATUS_FAILURE
                    error: Access denied to this activation code.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=mass_active_codes:
    post:
      operationId: Admin_mass_active_codes
      tags:
        - Admin API
      summary: Bulk action on activation codes
      description: |-
        Applies `sub_action` (alias `action_type`; the `action` parameter is taken by the dispatcher) to `ids`. Sub-actions (with or without a `mass_` prefix): enable, disable, extend (`days`, default 30; only lines that already expire), reset_device, change_package (`package_id`), delete (`refund_credits`/`refund`, refunds go to resellers only).

        **Permission:** the key's group needs any one of the advanced permissions `edit_user`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited. Not a read action, so the call is written to the admin audit trail (AdminAudit::start) before the permission check.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:875`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2064`, `src/Domain/Line/ActiveCodeService.php:727`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - mass_active_codes
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
      requestBody:
        required: true
        description: Form-encoded; the same fields are also accepted in the query string. PHP array syntax (`name[]=a&name[]=b`) is used for list fields unless a field says it is a JSON string.
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - sub_action
                - ids
              properties:
                sub_action:
                  type: string
                  enum:
                    - enable
                    - disable
                    - extend
                    - reset_device
                    - change_package
                    - delete
                    - mass_enable
                    - mass_disable
                    - mass_extend
                    - mass_reset_device
                    - mass_change_package
                    - mass_delete
                action_type:
                  type: string
                  description: Alias of sub_action.
                ids:
                  type:
                    - string
                    - array
                  items:
                    type: integer
                  description: Comma-separated string or `ids[]` array.
                  example: 4,5,6
                days:
                  type: integer
                package_id:
                  type: integer
                refund_credits:
                  type: boolean
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin_Envelope'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    message: Extended expiration of selected active codes by 30 days.
                no_ids:
                  summary: No active code IDs provided.
                  value:
                    status: STATUS_FAILURE
                    error: No active code IDs provided.
                none_accessible:
                  summary: No accessible codes found for mass action.
                  value:
                    status: STATUS_FAILURE
                    error: No accessible codes found for mass action.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_active_codes_batches:
    get:
      operationId: Admin_get_active_codes_batches
      tags:
        - Admin API
      summary: Batch summary
      description: |-
        One row per (batch_name, created_by, package_id, is_trial) with counts. Numbers are raw DB strings. Every active-code method re-checks its own ACTION_PERMISSIONS entry.

        **Permission:** the key's group needs any one of the advanced permissions `users` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:878`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2083`, `src/Domain/Line/ActiveCodeService.php:1076`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_active_codes_batches
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: batch_name
          in: query
          required: false
          schema:
            type: string
          description: Limit to one batch.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - batch_name: BATCH-20261017-A1B2C
                        created_by: '5'
                        package_id: '3'
                        is_trial: '0'
                        created_at: '1760700000'
                        total_codes: '2'
                        stock_count: '2'
                        active_count: '0'
                        disabled_count: '0'
                        package_name: 1 Month
                        creator_name: reseller1
                        ready_codes: '2'
                        active_codes: '0'
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=export_active_code_batch:
    get:
      operationId: Admin_export_active_code_batch
      tags:
        - Admin API
      summary: Export a batch
      description: |-
        `format=txt` (or `text`) returns printable voucher text in `content`; anything else returns JSON vouchers in `data`.

        **Permission:** the key's group needs any one of the advanced permissions `users` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:881`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2092`, `src/Domain/Line/ActiveCodeService.php:1136`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - export_active_code_batch
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: batch_name
          in: query
          required: true
          schema:
            type: string
          description: Batch to export.
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum:
              - json
              - txt
              - text
            default: json
          description: Output format.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      format:
                        type: string
                        enum:
                          - json
                          - txt
                      content:
                        type: string
                      data:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                      error:
                        type: string
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    format: json
                    data:
                      - voucher_no: 1
                        activation_code: K7M3Q9TZ2H
                        batch_name: BATCH-20261017-A1B2C
                        package_name: 1 Month
                        status: Ready
                        max_connections: 1
                        portal_url: http://tv.example.com/portal
                        credentials:
                          username: ac_1f9e2d3c4
                          password: 8c1d2e3f4a
                        created_at: 1760700000
                        created_at_formatted: '2026-10-17 11:20:00'
                txt:
                  summary: format=txt
                  value:
                    status: STATUS_SUCCESS
                    format: txt
                    content: |-
                      ========================================================================
                                         ACTIVATION CODES VOUCHER BATCH                      
                      ...
                no_batch:
                  summary: Batch name is required.
                  value:
                    status: STATUS_FAILURE
                    error: Batch name is required.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=check_active_code:
    get:
      operationId: Admin_check_active_code
      tags:
        - Admin API
      summary: Check an activation code
      description: |-
        Looks up any code (not limited to yours). **Always** `status: STATUS_SUCCESS`; the outcome is in `data.status` (SUCCESS, INVALID_CODE, DISABLED, EXPIRED) and `data.valid`. The wrapper's "Invalid or inactive code." branch is unreachable because checkCode never returns an empty array.

        **Permission:** the key's group needs any one of the advanced permissions `users` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** token scopes `full`, `read`, `lines` (src/Core/Auth/ApiTokens.php:106-128); legacy keys are not scope-limited.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:884`, `src/Public/Controllers/Api/AdminAPIWrapper.php:2108`, `src/Domain/Line/ActiveCodeService.php:1501`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - check_active_code
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - name: code
          in: query
          required: true
          schema:
            type: string
            example: K7M3Q9TZ2H
          description: Code (trimmed, upper-cased).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - status
                    properties:
                      status:
                        $ref: '#/components/schemas/Admin_Status'
                      data:
                        type: object
                        additionalProperties: true
                  - $ref: '#/components/schemas/Admin_Error'
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      status: SUCCESS
                      valid: true
                      code: K7M3Q9TZ2H
                      code_status: 1
                      status_label: Ready (Stock)
                      package_name: 1 Month
                      is_trial: false
                      max_connections: 1
                      is_activated: false
                      activated_at: null
                      exp_date: null
                      exp_date_formatted: null
                      is_device_locked: false
                invalid:
                  summary: Unknown code
                  value:
                    status: STATUS_SUCCESS
                    data:
                      status: INVALID_CODE
                      valid: false
                      message: Invalid or unknown activation code.
                expired:
                  summary: Expired
                  value:
                    status: STATUS_SUCCESS
                    data:
                      status: EXPIRED
                      valid: false
                      code_status: 3
                      exp_date: 1757000000
                      exp_date_formatted: '2025-09-04 15:33:20'
                      message: This activation code has expired.
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_lines:
    get:
      operationId: Admin_get_lines
      tags:
        - Admin API
      summary: List lines (subscriptions)
      description: |-
        Returns the `lines` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleLines` :414). See the tag description for paging, search, ordering and the response shape.

        Excludes MAG/Enigma lines and activation-code lines not yet redeemed (ActiveCodeService::LISTED_LINES). With Redis enabled `active_connections` is an integer.

        Search (`search[value]`, LIKE %v%): username, password, FROM_UNIXTIME(exp_date), max_connections, reseller_notes, admin_notes.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`lines.id`, 3=`username`, 4=`password`, 5=`member_id`, 6=`enabled-admin_enabled`, 7=`online`, 8=`is_trial`, 9=`is_restreamer`, 10=`active_connections`, 11=`max_connections`, 12=`exp_date`, 13=`active_connections,last_activity`, 14=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `users`, `mass_edit_lines` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_lines` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:296`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:414`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_lines
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: reseller
          in: query
          required: false
          schema:
            type: integer
          description: Only rows owned by this registered user id (`member_id` / `owner_id`).
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
              - 7
              - 8
          description: 'Status filter: 1 active (admin_enabled=1, enabled=1, not expired), 2 disabled (enabled=0), 3 banned (admin_enabled=0), 4 expired, 5 trial, 6 restreamer, 7 stalker, 8 expiring within 14 days.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '12'
                        member_id: '1'
                        last_activity: '3456'
                        last_activity_array: '{"stream_id":"25","date_end":null}'
                        username: john01
                        password: Xk29dLp0
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        is_restreamer: 0
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        max_connections: '1'
                        is_trial: 0
                        contact: ''
                        active_connections: 0
                        owner_name: admin
                        stream_display_name: BBC One HD
                        stream_id: '25'
                        last_active: '1760700000'
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_mags:
    get:
      operationId: Admin_get_mags
      tags:
        - Admin API
      summary: List MAG devices
      description: |-
        Returns the `mags` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleMags` :603). See the tag description for paging, search, ordering and the response shape.

        RIGHT JOIN from mag_devices, so an orphan device has `id` null. Rows may also carry online_ip / online_isp / online_since (OnlineConnectionInfo).

        Search (`search[value]`, LIKE %v%): username, mac, stb_type, FROM_UNIXTIME(exp_date), reseller_notes, admin_notes.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`lines.id`, 3=`username`, 4=`mag_devices.mac`, 5=`stb_type`, 6=`member_id`, 7=`enabled`, 8=`online`, 9=`is_trial`, 10=`exp_date`, 11=`active_connections,last_activity`, 12=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `manage_mag`, `mass_edit_mags` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_mags` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:299`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:603`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_mags
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: reseller
          in: query
          required: false
          schema:
            type: integer
          description: Only rows owned by this registered user id (`member_id` / `owner_id`).
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 1
              - 2
              - 3
              - 4
              - 5
          description: 'Status filter: 1 active (admin_enabled=1, enabled=1, not expired), 2 disabled (enabled=0), 3 banned (admin_enabled=0), 4 expired, 5 trial.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '40'
                        username: b8f1e0c2d4a6...
                        member_id: '1'
                        last_activity: null
                        last_activity_array: null
                        mac: 00:1A:79:12:34:56
                        stb_type: MAG250
                        mag_id: '7'
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        max_connections: '1'
                        is_trial: 0
                        active_connections: 0
                        owner_name: admin
                        stream_display_name: null
                        stream_id: null
                        last_active: null
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_enigmas:
    get:
      operationId: Admin_get_enigmas
      tags:
        - Admin API
      summary: List Enigma2 devices
      description: |-
        Returns the `enigmas` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleEnigmas` :768). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): username, mac, public_ip, exp_date, notes.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`lines.id`, 3=`username`, 4=`enigma2_devices.mac`, 5=`public_ip`, 6=`member_id`, 7=`enabled`, 8=`online`, 9=`is_trial`, 10=`exp_date`, 11=`active_connections,last_activity`, 12=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `manage_e2`, `mass_edit_enigmas` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_enigmas` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:302`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:768`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_enigmas
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: reseller
          in: query
          required: false
          schema:
            type: integer
          description: Only rows owned by this registered user id (`member_id` / `owner_id`).
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 1
              - 2
              - 3
              - 4
              - 5
          description: 'Status filter: 1 active (admin_enabled=1, enabled=1, not expired), 2 disabled (enabled=0), 3 banned (admin_enabled=0), 4 expired, 5 trial.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '41'
                        username: e2user
                        member_id: '1'
                        last_activity: null
                        last_activity_array: null
                        mac: 00:1D:EC:AA:BB:CC
                        public_ip: 203.0.113.5
                        device_id: '3'
                        exp_date: '1798761600'
                        admin_enabled: '1'
                        enabled: '1'
                        admin_notes: ''
                        reseller_notes: ''
                        max_connections: '1'
                        is_trial: 0
                        active_connections: 0
                        owner_name: admin
                        stream_display_name: null
                        stream_id: null
                        last_active: null
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_users:
    get:
      operationId: Admin_get_users
      tags:
        - Admin API
      summary: List registered users (admins and resellers)
      description: |-
        Returns the `reg_users` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleRegUsers` :3305). See the tag description for paging, search, ordering and the response shape.

        `credits` is a number (int when whole). `date_registered`/`last_login` are `Y-m-d H:i:s` or null. `user_count` is always 0.

        Search (`search[value]`, LIKE %v%): id, username, notes, FROM_UNIXTIME(date_registered), FROM_UNIXTIME(last_login), email, ip.

        **order[0][column]** index map: 0=(none), 1=`id`, 2=`username`, 3=`owner_id`, 4=`ip`, 5=`status`, 6=`member_group_id`, 7=`credits`, 8=(none), 9=(none), 10=(none), 11=(none), 12=`last_login`, 13=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `mng_regusers`, `mass_edit_users` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_reg_users` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:305`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3305`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_users
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: reseller
          in: query
          required: false
          schema:
            type: integer
          description: Only rows owned by this registered user id (`member_id` / `owner_id`).
        - name: filter
          in: query
          required: false
          schema:
            type: integer
          description: '-1 enabled (status 1), -2 disabled (status 0), any other value = member_group_id.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - member_group_id: '2'
                        id: '5'
                        status: '1'
                        notes: ''
                        owner_id: '1'
                        credits: 150
                        username: reseller1
                        email: r1@example.com
                        ip: 198.51.100.7
                        date_registered: '2026-01-04 10:12:00'
                        last_login: '2026-10-16 18:01:44'
                        owner_username: admin
                        is_reseller: 1
                        user_lines: 34
                        mag_lines: 2
                        e2_lines: 0
                        user_count: 0
                        group_name: Resellers
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_streams:
    get:
      operationId: Admin_get_streams
      tags:
        - Admin API
      summary: List live streams
      description: |-
        Returns the `streams` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleStreams` :927). See the tag description for paging, search, ordering and the response shape.

        `stream_source` is removed from rows. `stream_info`, `progress_info` and `category_id` are JSON strings. Grouped mode adds `stream_id` (streams_servers).

        Search (`search[value]`, LIKE %v%): streams.id, stream_display_name, notes, streams_servers.current_source.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`streams.id`, 3=`stream_icon`, 4=`stream_display_name`, 5=`streams_servers.current_source`, 6=`clients`, 7=`stream_started`, 8=(none), 9=(none), 10=(none), 11=(none), 12=`streams_servers.bitrate`.

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `streams`, `mass_edit_streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_streams` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:308`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:927`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_streams
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Only this stream (ignores search and filters).
        - name: category
          in: query
          required: false
          schema:
            type: integer
          description: Category id (JSON_CONTAINS on `category_id`); -1 = uncategorised.
        - name: server
          in: query
          required: false
          schema:
            type: integer
          description: Server id; -1 = streams without a server.
        - name: refresh
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated stream ids; replaces the WHERE clause and forces start=0, limit=1000.
        - name: single
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per stream/server pair (ungrouped). Default follows the `streams_grouped` setting.
        - name: audio
          in: query
          required: false
          schema:
            type: string
          description: Audio codec name, or -1 for none.
        - name: video
          in: query
          required: false
          schema:
            type: string
          description: Video codec name, or -1 for none.
        - name: resolution
          in: query
          required: false
          schema:
            type: integer
          description: Vertical resolution, e.g. 1080.
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 13
          description: 1 online, 2 down, 3 stopped, 4 starting, 5 on-demand, 6 direct source, 7 timeshift, 8 >144 fails in 24h, 9 has EPG, 10 no EPG, 11 adaptive link, 12 title sync, 13 transcode.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '25'
                        type: '1'
                        stream_icon: https://img.example.com/bbc1.png
                        adaptive_link: null
                        title_sync: null
                        cchannel_rsources: null
                        stream_display_name: BBC One HD
                        tv_archive_duration: 0
                        tv_archive_server_id: 0
                        server_id: '1'
                        notes: null
                        direct_source: 0
                        direct_proxy: 0
                        pid: '18342'
                        monitor_pid: '18330'
                        stream_status: 0
                        stream_started: '1760690000'
                        stream_info: '{"codecs":{"video":{"codec_name":"h264","width":1920,"height":1080}}}'
                        current_source: http://upstream.example.com/live/bbc1.ts
                        bitrate: '4521'
                        progress_info: '{"speed":"1x"}'
                        cc_info: null
                        on_demand: 0
                        category_id: '[3]'
                        server_name: Main Server
                        clients: 4
                        epg_id: '1'
                        channel_id: bbc1.uk
                        parent_id: null
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_channels:
    get:
      operationId: Admin_get_channels
      tags:
        - Admin API
      summary: List created channels
      description: |-
        Returns the `streams` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleStreams` :927). See the tag description for paging, search, ordering and the response shape.

        The controller sets `created=true`, which selects streams of type 3 (TableController.php:942). Row shape is the same as get_streams.

        Search (`search[value]`, LIKE %v%): streams.id, stream_display_name, notes, streams_servers.current_source.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`streams.id`, 3=`stream_icon`, 4=`stream_display_name`, 5=`streams_servers.current_source`, 6=`clients`, 7=`stream_started`, 8=(none), 9=(none), 10=(none), 11=(none), 12=`streams_servers.bitrate`.

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `streams`, `mass_edit_streams` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_streams` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:314`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:927`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_channels
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Only this stream (ignores search and filters).
        - name: category
          in: query
          required: false
          schema:
            type: integer
          description: Category id (JSON_CONTAINS on `category_id`); -1 = uncategorised.
        - name: server
          in: query
          required: false
          schema:
            type: integer
          description: Server id; -1 = streams without a server.
        - name: refresh
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated stream ids; replaces the WHERE clause and forces start=0, limit=1000.
        - name: single
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per stream/server pair (ungrouped). Default follows the `streams_grouped` setting.
        - name: audio
          in: query
          required: false
          schema:
            type: string
          description: Audio codec name, or -1 for none.
        - name: video
          in: query
          required: false
          schema:
            type: string
          description: Video codec name, or -1 for none.
        - name: resolution
          in: query
          required: false
          schema:
            type: integer
          description: Vertical resolution, e.g. 1080.
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 1
              - 2
              - 3
              - 4
          description: 1 running, 2 ready, 3 creating, 4 transcode.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data: []
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_provider_streams:
    get:
      operationId: Admin_get_provider_streams
      tags:
        - Admin API
      summary: List streams discovered on upstream providers
      description: |-
        Returns the `provider_streams` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleProviderStreams` :4801). See the tag description for paging, search, ordering and the response shape.

        Only enabled providers with status 1. **Rows expose the provider's username and password.** `id` is the provider id; `data` is a JSON string. Default sort (column 0) is provider name.

        Search (`search[value]`, LIKE %v%): providers.name, providers.ip, stream_display_name, providers_streams.stream_id.

        **order[0][column]** index map: 0=`providers.name`, 1=`stream_icon`, 2=`stream_display_name`, 3=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `streams`, `add_stream`, `edit_stream`, `add_movie`, `edit_movie` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_provider_streams` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:311`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:4801`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_provider_streams
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: type
          in: query
          required: false
          schema:
            type: string
          description: providers_streams.type, e.g. `live` or `movie`.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '2'
                        type: live
                        username: upuser
                        password: uppass
                        ssl: 0
                        legacy: 0
                        hls: 0
                        ip: provider.example.net
                        port: '8080'
                        name: Upstream A
                        data: '{}'
                        stream_id: '1001'
                        category_array: '[5]'
                        stream_display_name: CNN
                        stream_icon: ''
                        channel_id: cnn.us
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_stations:
    get:
      operationId: Admin_get_stations
      tags:
        - Admin API
      summary: List radio stations
      description: |-
        Returns the `radios` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleRadios` :1377). See the tag description for paging, search, ordering and the response shape.

        Streams of type 4. `stream_source` is removed.

        Search (`search[value]`, LIKE %v%): streams.id, stream_display_name, notes, streams_servers.current_source.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`id`, 3=`stream_icon`, 4=`stream_display_name`, 5=`server_name`, 6=`clients`, 7=`stream_started`, 8=(none), 9=`bitrate`.

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `radio`, `mass_edit_radio` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_radios` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:318`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:1377`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_stations
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Only this stream (ignores search and filters).
        - name: category
          in: query
          required: false
          schema:
            type: integer
          description: Category id (JSON_CONTAINS on `category_id`); -1 = uncategorised.
        - name: server
          in: query
          required: false
          schema:
            type: integer
          description: Server id; -1 = streams without a server.
        - name: refresh
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated stream ids; replaces the WHERE clause and forces start=0, limit=1000.
        - name: single
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per stream/server pair (ungrouped). Default follows the `streams_grouped` setting.
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 6
          description: 1 online, 2 down, 3 stopped, 4 starting, 5 on-demand, 6 direct source.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '90'
                        stream_icon: ''
                        movie_properties: null
                        to_analyze: 0
                        target_container: null
                        stream_display_name: Jazz FM
                        server_id: '1'
                        notes: null
                        direct_source: 0
                        pid: '2231'
                        monitor_pid: '2220'
                        stream_status: 0
                        stream_started: '1760600000'
                        stream_info: '{}'
                        current_source: http://radio.example.com/jazz
                        bitrate: '128'
                        progress_info: '{}'
                        on_demand: 0
                        category_id: '[9]'
                        server_name: Main Server
                        clients: 0
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_movies:
    get:
      operationId: Admin_get_movies
      tags:
        - Admin API
      summary: List movies (VOD)
      description: |-
        Returns the `movies` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleMovies` :1584). See the tag description for paging, search, ordering and the response shape.

        Streams of type 2. Quirk: `source` (MD5 of the source) stays in every row because the unset at TableController.php:1743 targets the response instead of the row.

        Search (`search[value]`, LIKE %v%): streams.id, stream_display_name, notes, streams_servers.current_source.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`id`, 3=(none), 4=`stream_display_name`, 5=`server_name`, 6=`clients`, 7=`stream_started`, 8=(none), 9=(none), 10=(none), 11=`bitrate`.

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `movies`, `mass_sedits_vod` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_movies` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:321`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:1584`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_movies
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Only this stream (ignores search and filters).
        - name: category
          in: query
          required: false
          schema:
            type: integer
          description: Category id (JSON_CONTAINS on `category_id`); -1 = uncategorised.
        - name: server
          in: query
          required: false
          schema:
            type: integer
          description: Server id; -1 = streams without a server.
        - name: refresh
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated stream ids; replaces the WHERE clause and forces start=0, limit=1000.
        - name: single
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per stream/server pair (ungrouped). Default follows the `streams_grouped` setting.
        - name: grouped
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per movie.
        - name: audio
          in: query
          required: false
          schema:
            type: string
          description: Audio codec name, or -1 for none.
        - name: video
          in: query
          required: false
          schema:
            type: string
          description: Video codec name, or -1 for none.
        - name: resolution
          in: query
          required: false
          schema:
            type: integer
          description: Vertical resolution, e.g. 1080.
        - name: source_id
          in: query
          required: false
          schema:
            type: string
          description: MD5 of the stream source.
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 8
          description: 1 encoded, 2 encoding, 3 down, 4 ready, 5 direct, 6 no TMDb, 7 duplicates, 8 transcode.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '300'
                        source: d41d8cd98f00b204e9800998ecf8427e
                        movie_properties: '{"name":"Example Movie","year":"2024"}'
                        year: '2024'
                        to_analyze: 0
                        target_container: mp4
                        stream_display_name: Example Movie (2024)
                        server_id: '1'
                        notes: null
                        direct_source: 0
                        direct_proxy: 0
                        pid: null
                        monitor_pid: null
                        stream_status: '1'
                        stream_started: null
                        stream_info: '{}'
                        current_source: null
                        bitrate: '2500'
                        progress_info: null
                        on_demand: 0
                        category_id: '[12]'
                        clients: 0
                        server_name: Main Server
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_series_list:
    get:
      operationId: Admin_get_series_list
      tags:
        - Admin API
      summary: List series
      description: |-
        Returns the `series` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleSeries` :3485). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): id, title, release_date.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`id`, 3=`cover`, 4=`title`, 5=`category_id`, 6=`latest_season`, 7=`episode_count`, 8=(none), 9=`release_date`, 10=`last_modified`, 11=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `series`, `mass_sedits` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_series` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:324`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3485`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_series_list
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: category
          in: query
          required: false
          schema:
            type: integer
          description: Category id; -1 = no TMDb id, -2 = uncategorised.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '15'
                        year: '2019'
                        rating: '8.1'
                        cover: https://img.example.com/cover.jpg
                        title: Example Show
                        category_id: '[20]'
                        tmdb_id: '12345'
                        release_date: '2019-04-01'
                        last_modified: '1760000000'
                        latest_season: '3'
                        episode_count: '24'
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=get_episodes:
    get:
      operationId: Admin_get_episodes
      tags:
        - Admin API
      summary: List episodes
      description: |-
        Returns the `episodes` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleEpisodes` :3569). See the tag description for paging, search, ordering and the response shape.

        Streams of type 5. Same `source` quirk as get_movies (TableController.php:3727).

        Search (`search[value]`, LIKE %v%): id, stream_display_name, streams_series.title, notes, current_source.

        **order[0][column]** index map: 0=(none), 1=(none), 2=`id`, 3=(none), 4=`stream_display_name`, 5=`server_name`, 6=`clients`, 7=`stream_started`, 8=(none), 9=(none), 10=(none), 11=`bitrate`.

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `episodes`, `mass_sedits` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_episodes` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:327`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3569`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_episodes
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Only this stream (ignores search and filters).
        - name: category
          in: query
          required: false
          schema:
            type: integer
          description: Category id (JSON_CONTAINS on `category_id`); -1 = uncategorised.
        - name: server
          in: query
          required: false
          schema:
            type: integer
          description: Server id; -1 = streams without a server.
        - name: refresh
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated stream ids; replaces the WHERE clause and forces start=0, limit=1000.
        - name: single
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per stream/server pair (ungrouped). Default follows the `streams_grouped` setting.
        - name: grouped
          in: query
          required: false
          schema:
            type: string
          description: Present = one row per episode.
        - name: audio
          in: query
          required: false
          schema:
            type: string
          description: Audio codec name, or -1 for none.
        - name: video
          in: query
          required: false
          schema:
            type: string
          description: Video codec name, or -1 for none.
        - name: resolution
          in: query
          required: false
          schema:
            type: integer
          description: Vertical resolution, e.g. 1080.
        - name: series
          in: query
          required: false
          schema:
            type: integer
          description: Series id.
        - name: source_id
          in: query
          required: false
          schema:
            type: string
          description: MD5 of the stream source.
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 7
          description: 1 encoded, 2 encoding, 3 down, 4 ready, 5 direct, 6 duplicates, 7 transcode.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: '501'
                        source: 0cc175b9c0f1b6a831c399e269772661
                        to_analyze: 0
                        movie_properties: '{}'
                        updated: null
                        target_container: mkv
                        stream_display_name: Example Show - S01E01
                        server_id: '1'
                        notes: null
                        direct_source: 0
                        direct_proxy: 0
                        pid: null
                        monitor_pid: null
                        stream_status: '1'
                        stream_started: null
                        stream_info: '{}'
                        current_source: null
                        bitrate: null
                        progress_info: null
                        on_demand: 0
                        category_id: null
                        server_name: Main Server
                        clients: 0
                        title: Example Show
                        seasons: '3'
                        sid: '15'
                        season_num: '1'
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=activity_logs:
    get:
      operationId: Admin_activity_logs
      tags:
        - Admin API
      summary: Line activity (closed connection) log
      description: |-
        Returns the `line_activity` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleLineActivity` :1941). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): hmac_identifier, user_agent, user_ip, container, FROM_UNIXTIME(date_start), FROM_UNIXTIME(date_end), geoip_country_code.

        **order[0][column]** index map: 0=(none), 1=`username`, 2=`stream_display_name`, 3=`server_name`, 4=`user_agent`, 5=`isp`, 6=`user_ip`, 7=`date_start`, 8=`activity_id`, 9=`date_end-date_start`, 10=`container`, 11=`is_restreamer`.

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `connection_logs` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_line_activity` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:330`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:1941`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - activity_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: range
          in: query
          required: false
          schema:
            type: string
            example: 2026-10-01 - 2026-10-17
          description: Date range `YYYY-MM-DD - YYYY-MM-DD` (first and last 10 characters are used; 00:00:00 to 23:59:59).
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Stream id (alias `stream`).
        - name: user_id
          in: query
          required: false
          schema:
            type: integer
          description: Line id (alias `user`).
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: Server id, matching server_id or proxy_id (alias `server`).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - activity_id: 9912
                        user_label: john01
                        user_sub: null
                        user_url: line?id=12
                        stream_name: BBC One HD
                        stream_url: stream_view?id=25
                        server_name: Main Server
                        server_url: server_view?id=1
                        proxy_via: null
                        player: VLC/3.0.20 LibVLC/3.0.20
                        isp: Example ISP
                        user_ip: 198.51.100.20
                        country: gb
                        date_start: 1760690000
                        date_end: 1760693600
                        duration: 3600
                        container: TS
                        is_restreamer: false
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=live_connections:
    get:
      operationId: Admin_live_connections
      tags:
        - Admin API
      summary: Live (open) connections
      description: |-
        Returns the `live_connections` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleLiveConnections` :2093). See the tag description for paging, search, ordering and the response shape.

        With the `redis_handler` setting on, connections come from Redis: only `order[0][dir]` (by date_start) is honoured, there is no search or filter, and rows are the Redis record (user_id, stream_id, server_id, proxy_id, user_agent, user_ip, container, pid, date_start, geoip_country_code, isp, external_device, hls_end, hls_last_read, on_demand, identity, uuid) plus activity_id (= uuid), identifier, active_time, server_name, divergence, series_no, stream_display_name, type, is_mag, is_e2, is_restreamer, username, mag_id, mac, device_id. The example shows MySQL mode.

        Search (`search[value]`, LIKE %v%): hmac_identifier, user_agent, user_ip, container, FROM_UNIXTIME(date_start), geoip_country_code, lines.username, MAG/Enigma mac, stream_display_name (MySQL mode only).

        **order[0][column]** index map: 0=(none), 1=`activity_id`, 2=`divergence`, 3=`username`, 4=`stream_display_name`, 5=`server_name`, 6=`user_agent`, 7=`isp`, 8=`user_ip`, 9=`active_time`, 10=`container`, 11=`is_restreamer`, 12=(none).

        Rows are raw DB rows: non-zero numbers are strings, falsy values (0, null, "") pass through as-is, and text is HTML-escaped (`<`/`>` to `&lt;`/`&gt;`). `recordsTotal` is a numeric string.

        **Permission:** the key's group needs any one of the advanced permissions `live_connections` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_live_connections` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:333`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:2093`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - live_connections
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: server_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Server id (MySQL mode: server_id or proxy_id).'
        - name: stream_id
          in: query
          required: false
          schema:
            type: integer
          description: Stream id.
        - name: user_id
          in: query
          required: false
          schema:
            type: integer
          description: Line id.
        - name: refresh
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated activity ids (MySQL) or UUIDs (Redis).
        - name: filter
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 6
          description: 'MySQL mode only: 1 plain lines, 2 MAG, 3 Enigma, 4 trial, 5 restreamer, 6 stalker.'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - mag_id: null
                        mac: null
                        device_id: null
                        is_e2: 0
                        is_mag: 0
                        activity_id: '5521'
                        hmac_id: null
                        hmac_identifier: null
                        proxy_id: 0
                        divergence: '0'
                        user_id: '12'
                        stream_id: '25'
                        series_no: null
                        is_restreamer: 0
                        isp: Example ISP
                        server_id: '1'
                        user_agent: VLC/3.0.20
                        user_ip: 198.51.100.20
                        container: ts
                        pid: '22011'
                        uuid: 6f1c2c1e-...
                        date_start: '1760699000'
                        geoip_country_code: GB
                        username: john01
                        stream_display_name: BBC One HD
                        type: '1'
                        server_name: Main Server
                    recordsTotal: '1'
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=credit_logs:
    get:
      operationId: Admin_credit_logs
      tags:
        - Admin API
      summary: Credit transfer log
      description: |-
        Returns the `credits_log` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleCreditsLog` :2911). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): target username, owner username, FROM_UNIXTIME(date), amount, reason.

        **order[0][column]** index map: 0=(none), 1=`id`, 2=`owner_username`, 3=`target_username`, 4=`amount`, 5=`reason`, 6=`date`.

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `credits_log` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_credits_log` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:336`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:2911`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - credit_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: range
          in: query
          required: false
          schema:
            type: string
            example: 2026-10-01 - 2026-10-17
          description: Date range `YYYY-MM-DD - YYYY-MM-DD` (first and last 10 characters are used; 00:00:00 to 23:59:59).
        - name: reseller
          in: query
          required: false
          schema:
            type: integer
          description: Rows where target_id or admin_id is this user id.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 77
                        admin_id: 1
                        owner_username: admin
                        owner_url: user?id=1
                        target_id: 5
                        target_username: reseller1
                        target_url: user?id=5
                        amount: 100
                        reason: Top-up
                        date: 1760600000
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=client_logs:
    get:
      operationId: Admin_client_logs
      tags:
        - Admin API
      summary: Client request (rejected request) log
      description: |-
        Returns the `client_logs` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleClientLogs` :2974). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): client_status, query_string, FROM_UNIXTIME(date), user_agent, ip, extra_data, stream_display_name, username.

        **order[0][column]** index map: 0=(none), 1=`lines_logs.id`, 2=`username`, 3=`stream_display_name`, 4=`client_status`, 5=`user_agent`, 6=`ip`, 7=`date`.

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `client_request_log` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_client_logs` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:339`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:2974`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - client_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: range
          in: query
          required: false
          schema:
            type: string
            example: 2026-10-01 - 2026-10-17
          description: Date range `YYYY-MM-DD - YYYY-MM-DD` (first and last 10 characters are used; 00:00:00 to 23:59:59).
        - name: filter
          in: query
          required: false
          schema:
            type: string
          description: Exact `client_status` value.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 301
                        user_id: 12
                        username: john01
                        user_url: line?id=12
                        stream_id: 25
                        stream_name: BBC One HD
                        stream_url: stream_view?id=25
                        reason: Line expired
                        extra: null
                        user_agent: VLC/3.0.20
                        ip: 198.51.100.20
                        date: 1760690000
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=user_logs:
    get:
      operationId: Admin_user_logs
      tags:
        - Admin API
      summary: Registered-user (reseller) activity log
      description: |-
        Returns the `reg_user_logs` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleRegUserLogs` :3047). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): users.username, deleted_info, action.

        **order[0][column]** index map: 0=(none), 1=`users.username`, 2=`log_id`, 3=`type,action`, 4=`cost`, 5=`credits_after`, 6=`date`.

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `reg_userlog` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_reg_user_logs` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:342`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3047`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - user_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: range
          in: query
          required: false
          schema:
            type: string
            example: 2026-10-01 - 2026-10-17
          description: Date range `YYYY-MM-DD - YYYY-MM-DD` (first and last 10 characters are used; 00:00:00 to 23:59:59).
        - name: reseller
          in: query
          required: false
          schema:
            type: integer
          description: users_logs.owner id.
        - name: filter
          in: query
          required: false
          schema:
            type: string
          description: Exact `action` (new, extend, edit, ...).
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 88
                        owner: reseller1
                        owner_url: user?id=5
                        line_label: john01
                        line_url: line?id=12
                        text: Extended line
                        cost: 1
                        credits_after: 149
                        date: 1760690000
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=stream_errors:
    get:
      operationId: Admin_stream_errors
      tags:
        - Admin API
      summary: Stream error log
      description: |-
        Returns the `stream_errors` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleStreamErrors` :3151). See the tag description for paging, search, ordering and the response shape.

        Search (`search[value]`, LIKE %v%): stream_display_name, server_name, FROM_UNIXTIME(date), error.

        **order[0][column]** index map: 0=(none), 1=`stream_display_name`, 2=`server_name`, 3=`error`, 4=`date`.

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `stream_errors` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_stream_errors` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:345`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3151`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stream_errors
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
        - name: range
          in: query
          required: false
          schema:
            type: string
            example: 2026-10-01 - 2026-10-17
          description: Date range `YYYY-MM-DD - YYYY-MM-DD` (first and last 10 characters are used; 00:00:00 to 23:59:59).
        - name: server
          in: query
          required: false
          schema:
            type: integer
          description: Server id.
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 4410
                        stream_id: 25
                        stream_name: BBC One HD
                        stream_url: stream_view?id=25
                        server_id: 1
                        server_name: Main Server
                        error: Connection refused
                        date: 1760690000
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=system_logs:
    get:
      operationId: Admin_system_logs
      tags:
        - Admin API
      summary: Panel / system log
      description: |-
        Returns the `mysql_syslog` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleMysqlSyslog` :3855). See the tag description for paging, search, ordering and the response shape.

        The handler also requires the key's group to be an admin group (`is_admin`).

        Search (`search[value]`, LIKE %v%): ip, type, error.

        **order[0][column]** index map: 0=(none), 1=`date`, 2=`server_name`, 3=`type`, 4=`error`, 5=`ip`, 6=(none).

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `panel_logs` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_mysql_syslog` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:348`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3855`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - system_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 1201
                        date: 1760690000
                        server_id: 1
                        server_name: Main Server
                        type: php
                        error: 'Undefined index: foo'
                        ip: 198.51.100.9
                        blocked: false
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=login_logs:
    get:
      operationId: Admin_login_logs
      tags:
        - Admin API
      summary: Panel login log
      description: |-
        Returns the `login_logs` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleLoginLogs` :3951). See the tag description for paging, search, ordering and the response shape.

        The handler also requires the key's group to be an admin group (`is_admin`).

        Search (`search[value]`, LIKE %v%): login_ip, status, username, code.

        **order[0][column]** index map: 0=(none), 1=`date`, 2=`type`, 3=`status`, 4=`users.username`, 5=`access_codes.code`, 6=`login_ip`, 7=(none).

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `login_logs` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_login_logs` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:351`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:3951`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - login_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 650
                        date: 1760690000
                        type: ADMIN
                        status: SUCCESS
                        user_id: 1
                        username: admin
                        code: admin
                        login_ip: 198.51.100.9
                        blocked: false
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=restream_logs:
    get:
      operationId: Admin_restream_logs
      tags:
        - Admin API
      summary: Restream detection log
      description: |-
        Returns the `restream_logs` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleRestreamLogs` :4100). See the tag description for paging, search, ordering and the response shape.

        The handler also requires the key's group to be an admin group (`is_admin`).

        Search (`search[value]`, LIKE %v%): ip, username, stream_display_name.

        **order[0][column]** index map: 0=(none), 1=`lines.username`, 2=`stream_display_name`, 3=`ip`, 4=`time`, 5=(none).

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `restream_logs` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_restream_logs` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:354`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:4100`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - restream_logs
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 31
                        user_id: 12
                        username: john01
                        user_url: line?id=12
                        stream_id: 25
                        stream_name: BBC One HD
                        stream_url: stream_view?id=25
                        ip: 203.0.113.50
                        blocked: false
                        date: 1760690000
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
  /{access_code}/?action=mag_events:
    get:
      operationId: Admin_mag_events
      tags:
        - Admin API
      summary: MAG event log
      description: |-
        Returns the `mag_events` table through the panel's DataTables handler, run in-process (src/Public/Controllers/Admin/TableController.php `handleMagEvents` :4162). See the tag description for paging, search, ordering and the response shape.

        The handler also requires the key's group to be an admin group (`is_admin`).

        Search (`search[value]`, LIKE %v%): mac, event, msg.

        **order[0][column]** index map: 0=(none), 1=`send_time`, 2=`mac`, 3=`event`, 4=`msg`, 5=(none).

        Rows are built as typed values (ints, bools, null); `recordsTotal` is an integer.

        **Permission:** the key's group needs any one of the advanced permissions `manage_events` (src/Public/Controllers/Api/AdminApiController.php ACTION_PERMISSIONS); otherwise `{"status":"STATUS_NO_PERMISSIONS"}`.

        **Token scope:** the table is re-checked as `get_mag_events` (ApiTokens::allows), so a `lines`-scope token can only read lines/mags/enigmas tables.

        **Source:** `src/Public/Controllers/Api/AdminApiController.php:357`, `src/Public/Controllers/Api/AdminAPIWrapper.php:89`, `src/Public/Controllers/Admin/TableController.php:4162`
      parameters:
        - $ref: '#/components/parameters/Admin_AccessCode'
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - mag_events
          description: Action name. May also be sent in a form-encoded POST body (POST overrides GET).
        - $ref: '#/components/parameters/Admin_Start'
        - $ref: '#/components/parameters/Admin_Limit'
        - $ref: '#/components/parameters/Admin_ShowColumns'
        - $ref: '#/components/parameters/Admin_HideColumns'
        - $ref: '#/components/parameters/Admin_SearchValue'
        - $ref: '#/components/parameters/Admin_OrderColumn'
        - $ref: '#/components/parameters/Admin_OrderDir'
      responses:
        '200':
          description: JSON reply. Errors are also returned with HTTP 200; check `status`.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Admin_TableResponse'
                  - $ref: '#/components/schemas/Admin_Error'
                  - type: string
                    const: ''
                    description: Empty body (handler permission failure).
              examples:
                success:
                  summary: Success
                  value:
                    status: STATUS_SUCCESS
                    data:
                      - id: 9
                        date: 1760690000
                        mac: 00:1A:79:12:34:56
                        mag_device_id: 7
                        event: send_msg
                        msg: Hello
                    recordsTotal: 1
                    recordsFiltered: 1
                table_permission_denied:
                  summary: 'Handler permission check failed: empty body (HTTP 200, no JSON)'
                  value: ''
                invalid_key:
                  $ref: '#/components/examples/Admin_InvalidKey'
                no_permissions:
                  $ref: '#/components/examples/Admin_NoPermissions'
