ServerAvatarDocs
API Reference

Application feature endpoints

Files, logs, PHP settings, environment, password protection, web firewall, AI bot blocker, Fail2ban, staging, clone, one-click updates, WP-CLI and workers through the OSS Panel API.

Every screen on an application's own sidebar is an API group under /applications/{application}/…. This page covers the groups for files, logs, PHP, environment, password protection, the web firewall, the AI bot blocker, Fail2ban, staging, clone, one-click updates, WP-CLI and workers.

The application itself (create, list, domains, certificate, deployments, container) is on Applications API. Application backups are on Backups and storage API.

All paths are relative to https://<your-panel-host>/api; {application} is the application's numeric id. Read Authentication first. The examples use:

PANEL=https://panel.example.com
TOKEN='1|xcMq8K3vZ2pL…'

Permissions

Each group has its own permission. View reads; manage changes, and implies view. A group the site type does not have (Staging, for example, exists only for WordPress sites) answers 404 instead of 403.

GroupPermission keyTitle in Roles
Filesapp_fileFiles
Logsapp_logLogs
PHP settingsapp_phpPHP Settings
Environmentapp_environmentEnvironment
Password protectionapp_securityPassword Protection
Web firewallapp_firewallWeb Firewall
AI bot blockerapp_bot_blockerAI Bot Blocker
Fail2banapp_fail2banFail2ban
Stagingapp_stagingStaging Area
Cloneapp_cloneApplication Clone
Workersapp_workerWorkers
One-click update, WP-CLIapplicationApplications

Many of these endpoints carry their own per-minute limit, listed in the tables. It counts that endpoint only, per user, and sits on top of the shared 180-per-minute budget (see Rate limits).

Files

All paths are relative to the application's folder: no leading /, no .., at most 1024 characters. Several endpoints take one path or a list paths of up to 250 paths.

MethodPathPermissionLimit per minutePurpose
GET…/filesviewsharedList a folder.
GET…/files/searchview10Search names.
GET…/files/breakdownview30Size by kind of file.
GET…/files/sizeview20Size of one folder.
GET…/files/sizesview60Sizes of the folders in a path.
GET…/files/contentmanage60Read a text file.
PUT…/files/contentmanage20Save a text file.
POST…/files/content/restoremanage10Restore a saved copy of a file.
GET…/files/previewmanage60Show a file inline (images and so on).
GET…/files/downloadmanage20Download a file.
POST…/files/directoriesmanage20Create a folder.
PUT…/files/renamemanage20Rename or move.
POST…/files/copymanage10Copy.
PUT…/files/permissionsmanage20Change the mode (chmod).
DELETE…/filesmanage10Delete (to the trash, or permanently).
POST…/files/compressmanage10Make an archive. Answers 202.
POST…/files/extractmanage5Unpack an archive. Answers 202.
GET…/files/archive-jobsviewprogressStatus of compress and extract jobs.
GET…/files/trashview60What is in the trash.
POST…/files/trash/restoremanage30Restore from the trash.
DELETE…/files/trashmanage10Empty the trash.
POST…/files/uploadmanage10Upload one file in one request.
POST…/files/uploadsmanage240Begin a chunked upload.
GET…/files/uploads/spaceview240Free space for an upload.
PUT…/files/uploads/{uploadId}manage1200Send one chunk.
GET…/files/uploads/{uploadId}view240How much arrived.
POST…/files/uploads/{uploadId}/finalizemanage240Finish.
DELETE…/files/uploads/{uploadId}manage240Abort.
POST…/fix-permissionsmanage5Reset ownership and modes. Returns {"fixed": true}.

Here … stands for /applications/{application}.

Reading a file's content, previewing and downloading need manage, not view: the listing is a view, the bytes are not.

GET …/files takes path (optional, default is the site folder), hidden (0 or 1) and refresh (0 or 1). Returns {"path", "files": [ … ], "hidden_count"}.

GET …/files/search takes q (required, 1 to 255 characters) and an optional path to start from. Returns {"path", "query", "files": [ … ], "truncated"}; truncated is true when more matched than were returned.

Read and save a text file

curl "$PANEL/api/applications/12/files/content?path=wp-config.php" \
  -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json'

Returns {"path", "content", "size", "version", "backups": [ … ]}. A file that is not text answers 422. Files up to 5 MB can be read and saved.

PUT …/files/content:

FieldRules
pathRequired.
contentRequired (may be null or empty), at most 5 MB.
versionOptional, 40 characters: the version you read. If the file changed since, the save is refused.
safety_copyOptional boolean. Keep a copy of the current file before overwriting.

Returns {"saved": true, "version": "…"}.

POST …/files/content/restore takes path, backup (the name of a saved copy from backups, required) and safety_copy. Returns {"restored": true, …}.

Create, rename, copy, change mode

EndpointBody
POST …/files/directoriespath (required). Returns {"created": true}.
PUT …/files/renamepath, or paths for many. One item: target (required). Many: target_directory (the folder to move them into, null for the site folder). Returns {"renamed": true, …}.
POST …/files/copyThe same fields as rename. Returns {"copied": true, …}.
PUT …/files/permissionspath or paths, and mode: three or four octal digits, ^[0-3]?[0-7]{3}$ (for example 755). Returns {"chmoded": true, …}.

For the many-path forms the response also lists what failed; the first key is true only when nothing failed.

Delete and the trash

DELETE …/files:

FieldRules
path or pathsOne of them required.
confirmRequired, must be accepted (true).
permanentOptional boolean. false (default) moves to the trash; true deletes for good.
countRequired with paths: how many you are deleting, as a check.

Returns {"deleted": true|false, …}.

GET …/files/trash returns what is in the trash and retention_days (7 unless the administrator changed it). POST …/files/trash/restore takes batch (required, YYYYMMDD-HHMMSS) and an optional path inside that batch. DELETE …/files/trash takes confirm (required) and an optional batch to empty only one.

Archives

POST …/files/compress takes path or paths and target (the archive to make). POST …/files/extract takes path (the archive) and target (the folder to unpack into; the key must be present, may be null). Both answer 202 with {"job": { … }}. Read GET …/files/archive-jobs for progress: {"data": [ … ]}.

Upload

For a file up to 50 MB, POST …/files/upload as multipart/form-data with path (the destination) and file. Larger files use the chunked upload:

  1. POST …/files/uploads with path and size (bytes). Returns {"upload_id", "max_chunk"}: the size of chunk the server will accept.
  2. PUT …/files/uploads/{uploadId} with a chunk as the raw request body. Returns {"received": <total bytes so far>}.
  3. POST …/files/uploads/{uploadId}/finalize with path. Returns {"uploaded": true}.

GET …/files/uploads/{uploadId} returns how much arrived. DELETE aborts and returns {"aborted": true}. GET …/files/uploads/space reports the free space.

Logs

MethodPathPermissionPurpose
GET/applications/{application}/logsviewThe logs this site has.
GET/applications/{application}/logs/{key}viewRead one (120 per minute).
DELETE/applications/{application}/logs/{key}manageEmpty it.
GET/applications/{application}/logs/{key}/downloadviewDownload (6 per minute).

GET …/logs returns {"logs": [ … ]}. {key} is one of the keys it lists; the names are access, error, access_ssl, error_ssl, application, application_error, container and waf_detect, and which of them a site has depends on its type and web server.

GET …/logs/{key} takes:

QueryRules
lines1 to 5000.
grepText to search for, up to 200 characters.
fromA line number to start from, 1 or more. Only for log files; the system journal and container output have no line numbers (422).
ip, status, method, urlFilters for the access log only. status is like 404 or 5xx; method is a standard HTTP method; url is up to 500 characters. Other logs refuse them with 422.

Returns {"log": {"key", "label", "kind", "exists", "lines", "first_line", "truncated"}}. DELETE returns the log emptied.

PHP settings

For PHP sites. Several settings need the site to be isolated in its own PHP-FPM pool.

MethodPathPermissionPurpose
GET/applications/{application}/phpviewCurrent settings.
PUT/applications/{application}/phpmanage (10 per minute)Change them.
POST/applications/{application}/php/isolatemanage (5 per minute)Give the site its own FPM pool.
POST/applications/{application}/php/v7-extra-confmanage (30 per minute)Translate an old ServerAvatar v7 extra-config block.

GET and PUT return {"php": { … }}. PUT also returns cronjobs_to_review, the cron jobs that run on the PHP version you left.

PUT body (send only what changes; every field except php_version and open_basedir_enabled accepts null):

FieldRules
php_versionAn installed version, not being installed or removed, inside the site type's range.
memory_limit, upload_max_filesize, post_max_size-1, or a number with an optional K, M or G; up to 12 characters.
max_execution_time0 to 3600.
max_input_time-1 to 3600.
max_input_vars100 to 100000.
session_gc_maxlifetime60 to 604800.
pm_typeondemand, dynamic or static.
pm_max_children, pm_start_servers, pm_min_spare_servers, pm_max_spare_servers1 to 100.
pm_max_requests0 to 100000.
pm_process_idle_timeout1 to 86400.
pm_max_spawn_rate1 to 1024.
open_basedir_enabledBoolean.
open_basedir_pathsAbsolute paths separated by :, comma or new line; no ..; up to 2000 characters.
disable_functionsFunction names separated by commas; letters, digits, _; up to 2000 characters.
allow_url_fopenBoolean.
php_timezoneA PHP timezone name.
auto_prepend_fileA file inside the site, up to 255 characters.
additional_directivesExtra php.ini lines, up to 4000 characters; no [section] lines, and directives the panel manages itself are refused.

A setting that needs an isolated pool on a site that is not isolated answers 422. POST …/php/isolate takes no body; it answers 422 if the stack does not support pools or the site already has one.

POST …/php/v7-extra-conf takes extra_conf (the key must be present, up to 20000 characters) and returns {"settings": { … }, "refused": [ … ]}: what could be turned into settings and what could not, with a message for each refused line.

Environment

.env editing for the site types that have one. Needs manage for every call, including reading, because the file holds secrets.

MethodPathLimit per minutePurpose
GET…/environmentsharedThe file as the panel sees it.
POST…/environment/check60Check text before saving.
PUT…/environment20Save.
GET…/environment/historysharedSaved copies.
GET…/environment/history/{log}/diff60Compare a change.
POST…/environment/restore10Restore a saved copy.

GET returns {"environment": { … }}. POST …/environment/check and PUT …/environment take raw (required, may be empty, up to 262144 characters) and, for PUT, an optional safety_copy boolean. check returns {"checks": [ … ], "refused": [ … ], "saveable": true|false}; PUT returns {"environment", "applied", "restarted"}, or 422 on the raw field with the reasons. A key the panel manages itself is refused with a message on raw.

GET …/environment/history is paged like other lists ({"history": [ … ], "meta": { … }}). …/diff returns {"diff": { … }} and 404 for an entry of another site. POST …/environment/restore takes backup (required, a name like .env.bak-20261102-091403), optional restart and safety_copy, and returns {"environment": { … }}.

Password protection

PUT /applications/{application}/security

Turns HTTP basic authentication on or off for the whole site. Needs manage on Password Protection; 10 per minute.

FieldRules
enabledRequired boolean.
usernameRequired when enabled. Up to 255 printable characters, no : and no spaces.
passwordRequired when enabled. 8 to 255 characters.

Returns {"application": { … }} with basic_auth_enabled.

Web firewall

MethodPathPermissionPurpose
GET/waf-optionsviewWhether this web server supports the firewall, and the category list.
GET/applications/{application}/wafviewThe site's firewall settings.
PUT/applications/{application}/wafmanage (10 per minute)Change them.

PUT body:

FieldRules
enabledRequired boolean.
modeRequired: detect (log only) or enforce (block).
categoriesArray of query_string, request_uri, user_agent, referrer, cookie, method.
exceptionsUp to 50 strings, each 4 to 255 characters, no control characters, no .. or ?.
custom_rulesUp to 50 strings, each 1 to 255 characters, no control characters.

Both GET and PUT return {"application": { … }} with the waf_* fields. A web server without firewall support reports waf_supported: false.

AI bot blocker

MethodPathPermissionPurpose
GET/ai-bot-policiesviewThe policies and which bots each blocks.
PUT/applications/{application}/bot-blockermanage (10 per minute)Set the policy and your own lists.
GET/applications/{application}/bot-trafficLogs view (30 per minute)Bot traffic report.

PUT body:

FieldRules
policyRequired: allow_all, block_training, block_agents, block_all or legacy_v7.
blockedOptional array of up to 50 bot user-agent names to block as well.
allowedOptional array of up to 50 names to let through.

Send blocked and allowed as they should end up: an empty array clears the list, and leaving the key out keeps it. Returns {"application": { … }} with ai_bot_policy, bot_blocked and bot_allowed.

GET …/bot-traffic?days=7 takes days from 1 to 90 (default 7) and returns {"bot_traffic": { … }}.

Fail2ban for the site

MethodPathPermissionPurpose
GET/applications/{application}/fail2banviewThe site's jail, or the templates to start from.
POST/applications/{application}/fail2banmanage (10 per minute)Create or replace the jail.
DELETE/applications/{application}/fail2banmanage (10 per minute)Turn it off.
GET/applications/{application}/fail2ban/bansviewThe IPs now banned in the jail.
POST/applications/{application}/fail2ban/bansmanage (20 per minute)Ban an IP.
DELETE/applications/{application}/fail2ban/bans/{ip}manage (20 per minute)Unban an IP.

GET returns {"fail2ban": null, "jail_template", "filter_template", …} when none is set, or {"fail2ban": {"jail_name", "jail_content", "filter_content"}, …}.

POST …/fail2ban body: jail_config_content and filter_config_content (both required, up to 65535 characters) and an optional safety_copy. The panel tests the configuration first; a refused configuration answers 422 with {"testOk": false, "message", "output"}. Success returns {"testOk": true, "message"}. DELETE takes an optional safety_copy and answers 422 when there is no jail.

POST …/fail2ban/bans body: ip (a valid IP). The panel refuses the server's own address and the caller's own address (422). Returns {"ban": {"ip", "jail"}}. DELETE …/bans/{ip} returns {"unbanned": {"ip", "jail"}}; an invalid IP is 404, and a site with no jail is 409 with reason: jail_not_enabled.

Staging

WordPress sites. A staging copy is its own application.

MethodPathPermissionPurpose
GET/applications/{application}/stagingviewThe staging copy and the latest run.
POST/applications/{application}/stagingmanage (5 per minute)Create one.
POST/applications/{application}/staging/pushmanage (5 per minute)Copy staging to the live site.
POST/applications/{application}/staging/pullmanage (5 per minute)Copy the live site to staging.
GET/applications/{application}/staging/runs/{run}viewOne run.
GET/applications/{application}/staging/safety-copiesviewThe database copies kept before a push.
POST/applications/{application}/staging/safety-copies/{name}/restoremanage (5 per minute)Restore one.

GET returns {"staging": { … } | null, "latest_run": { … } | null}.

POST …/staging takes domain (required: a valid hostname, up to 255 characters, unused anywhere on the server, not the panel's own host). It answers 201 with {"staging": { … }}, or 500 with step and reference when creating failed.

push and pull take mode (required: files, database or full) and an optional safety_copy; push also takes backup (boolean). They answer 202 with {"run": { … }}; poll …/runs/{run} (404 for another site's run). A second push while one runs is 422 on mode.

GET …/safety-copies returns {"safety_copies": [ … ], "kept": <number>}. The restore endpoint takes no body and returns {"restored": "<name>", "safety_copies": [ … ]}.

Clone

MethodPathPermissionPurpose
POST/applications/{application}/clonemanage (5 per minute)Clone the site to a new application.
GET/clonesviewClones, paged.
GET/clones/{clone}viewOne clone's progress.

POST body: domain (required; a valid hostname up to 255, not used by any application, domain, or clone in progress, not the panel's own host) and an optional name (up to 255 characters, unused). Answers 202 with {"clone": { … }}. A second clone of the same site while one runs is 409.

GET /clones returns {"clones": [ … ], "meta": { … }}. GET /clones/{clone} returns {"clone": { … }} and uses the progress budget, so it can be polled.

One-click updates

MethodPathPermissionPurpose
GET/applications/{application}/updateviewUpdate status and history.
POST/applications/{application}/updatemanage (10 per minute)Start an update.

GET returns {"update": { … }, "history": [ … ]} and uses the progress budget. POST takes no body and answers 202 with {"update": { … }}.

WP-CLI

POST /wp-cli/install

Installs WP-CLI on the server so WordPress sites can use it. No body. Needs manage on Applications; 10 per minute. Answers 202 with a message, or 422 when it is already installed.

Workers

Supervisor-managed background processes for the site.

MethodPathPermissionPurpose
GET/applications/{application}/workersviewWorkers, presets and checks.
POST/applications/{application}/workersmanage (20 per minute)Add one.
PUT/applications/{application}/workers/{worker}manage (20 per minute)Change one.
DELETE/applications/{application}/workers/{worker}manage (20 per minute)Remove. Answers 204.
POST/applications/{application}/workers/{worker}/{action}manage (30 per minute)start, stop or restart.
POST/applications/{application}/workers/install-supervisormanage (6 per minute)Install Supervisor.

GET returns {"workers": [ … ], "presets": [ … ], "checks": [ … ]}.

POST and PUT body:

FieldRules
nameRequired, up to 60 characters, one line, unique among the site's workers.
commandRequired, up to 500 characters, none of ; | & ` $ < > ( ) and no new line.
kindqueue, horizon or custom.
directoryNullable, up to 255, no ...
userNullable, up to 32 characters: ^[a-z_][a-z0-9_-]*$.
log_fileNullable, an absolute path up to 255, no ...
log_levelNullable: critical, error, warn, info, debug, trace or blather.
extra_configNullable, up to 2000 characters, no [.
processes1 to 16.
stop_wait_seconds1 to 3600.
auto_start, auto_restart, restart_on_deploy, enabledBooleans.

POST answers 201 with {"worker": { … }}; PUT returns the worker. A worker that did not start answers 422 with what Supervisor said and a reference. …/{action} returns the worker; any other action is 404. install-supervisor answers 202, or 422 if it is already installed.

Common errors

StatusMessage or cause
403Your role does not include management for <feature>.
404Unknown application, worker, run, clone or upload; or a group the site type does not have.
409A clone is already running; a Fail2ban jail is not enabled.
422Validation ({"message", "errors": {"field": ["…"]}}), a file that is not text, an unsupported stack.
429A per-endpoint or shared limit; wait for Retry-After.
500{"message", "reference"}: find the reference in the error log.

On this page