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.
| Group | Permission key | Title in Roles |
|---|---|---|
| Files | app_file | Files |
| Logs | app_log | Logs |
| PHP settings | app_php | PHP Settings |
| Environment | app_environment | Environment |
| Password protection | app_security | Password Protection |
| Web firewall | app_firewall | Web Firewall |
| AI bot blocker | app_bot_blocker | AI Bot Blocker |
| Fail2ban | app_fail2ban | Fail2ban |
| Staging | app_staging | Staging Area |
| Clone | app_clone | Application Clone |
| Workers | app_worker | Workers |
| One-click update, WP-CLI | application | Applications |
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.
| Method | Path | Permission | Limit per minute | Purpose |
|---|---|---|---|---|
GET | …/files | view | shared | List a folder. |
GET | …/files/search | view | 10 | Search names. |
GET | …/files/breakdown | view | 30 | Size by kind of file. |
GET | …/files/size | view | 20 | Size of one folder. |
GET | …/files/sizes | view | 60 | Sizes of the folders in a path. |
GET | …/files/content | manage | 60 | Read a text file. |
PUT | …/files/content | manage | 20 | Save a text file. |
POST | …/files/content/restore | manage | 10 | Restore a saved copy of a file. |
GET | …/files/preview | manage | 60 | Show a file inline (images and so on). |
GET | …/files/download | manage | 20 | Download a file. |
POST | …/files/directories | manage | 20 | Create a folder. |
PUT | …/files/rename | manage | 20 | Rename or move. |
POST | …/files/copy | manage | 10 | Copy. |
PUT | …/files/permissions | manage | 20 | Change the mode (chmod). |
DELETE | …/files | manage | 10 | Delete (to the trash, or permanently). |
POST | …/files/compress | manage | 10 | Make an archive. Answers 202. |
POST | …/files/extract | manage | 5 | Unpack an archive. Answers 202. |
GET | …/files/archive-jobs | view | progress | Status of compress and extract jobs. |
GET | …/files/trash | view | 60 | What is in the trash. |
POST | …/files/trash/restore | manage | 30 | Restore from the trash. |
DELETE | …/files/trash | manage | 10 | Empty the trash. |
POST | …/files/upload | manage | 10 | Upload one file in one request. |
POST | …/files/uploads | manage | 240 | Begin a chunked upload. |
GET | …/files/uploads/space | view | 240 | Free space for an upload. |
PUT | …/files/uploads/{uploadId} | manage | 1200 | Send one chunk. |
GET | …/files/uploads/{uploadId} | view | 240 | How much arrived. |
POST | …/files/uploads/{uploadId}/finalize | manage | 240 | Finish. |
DELETE | …/files/uploads/{uploadId} | manage | 240 | Abort. |
POST | …/fix-permissions | manage | 5 | Reset 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.
List and search
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:
| Field | Rules |
|---|---|
path | Required. |
content | Required (may be null or empty), at most 5 MB. |
version | Optional, 40 characters: the version you read. If the file changed since, the save is refused. |
safety_copy | Optional 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
| Endpoint | Body |
|---|---|
POST …/files/directories | path (required). Returns {"created": true}. |
PUT …/files/rename | path, 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/copy | The same fields as rename. Returns {"copied": true, …}. |
PUT …/files/permissions | path 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:
| Field | Rules |
|---|---|
path or paths | One of them required. |
confirm | Required, must be accepted (true). |
permanent | Optional boolean. false (default) moves to the trash; true deletes for good. |
count | Required 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:
POST …/files/uploadswithpathandsize(bytes). Returns{"upload_id", "max_chunk"}: the size of chunk the server will accept.PUT …/files/uploads/{uploadId}with a chunk as the raw request body. Returns{"received": <total bytes so far>}.POST …/files/uploads/{uploadId}/finalizewithpath. 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
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /applications/{application}/logs | view | The logs this site has. |
GET | /applications/{application}/logs/{key} | view | Read one (120 per minute). |
DELETE | /applications/{application}/logs/{key} | manage | Empty it. |
GET | /applications/{application}/logs/{key}/download | view | Download (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:
| Query | Rules |
|---|---|
lines | 1 to 5000. |
grep | Text to search for, up to 200 characters. |
from | A 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, url | Filters 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.
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /applications/{application}/php | view | Current settings. |
PUT | /applications/{application}/php | manage (10 per minute) | Change them. |
POST | /applications/{application}/php/isolate | manage (5 per minute) | Give the site its own FPM pool. |
POST | /applications/{application}/php/v7-extra-conf | manage (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):
| Field | Rules |
|---|---|
php_version | An 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_time | 0 to 3600. |
max_input_time | -1 to 3600. |
max_input_vars | 100 to 100000. |
session_gc_maxlifetime | 60 to 604800. |
pm_type | ondemand, dynamic or static. |
pm_max_children, pm_start_servers, pm_min_spare_servers, pm_max_spare_servers | 1 to 100. |
pm_max_requests | 0 to 100000. |
pm_process_idle_timeout | 1 to 86400. |
pm_max_spawn_rate | 1 to 1024. |
open_basedir_enabled | Boolean. |
open_basedir_paths | Absolute paths separated by :, comma or new line; no ..; up to 2000 characters. |
disable_functions | Function names separated by commas; letters, digits, _; up to 2000 characters. |
allow_url_fopen | Boolean. |
php_timezone | A PHP timezone name. |
auto_prepend_file | A file inside the site, up to 255 characters. |
additional_directives | Extra 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.
| Method | Path | Limit per minute | Purpose |
|---|---|---|---|
GET | …/environment | shared | The file as the panel sees it. |
POST | …/environment/check | 60 | Check text before saving. |
PUT | …/environment | 20 | Save. |
GET | …/environment/history | shared | Saved copies. |
GET | …/environment/history/{log}/diff | 60 | Compare a change. |
POST | …/environment/restore | 10 | Restore 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.
| Field | Rules |
|---|---|
enabled | Required boolean. |
username | Required when enabled. Up to 255 printable characters, no : and no spaces. |
password | Required when enabled. 8 to 255 characters. |
Returns {"application": { … }} with basic_auth_enabled.
Web firewall
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /waf-options | view | Whether this web server supports the firewall, and the category list. |
GET | /applications/{application}/waf | view | The site's firewall settings. |
PUT | /applications/{application}/waf | manage (10 per minute) | Change them. |
PUT body:
| Field | Rules |
|---|---|
enabled | Required boolean. |
mode | Required: detect (log only) or enforce (block). |
categories | Array of query_string, request_uri, user_agent, referrer, cookie, method. |
exceptions | Up to 50 strings, each 4 to 255 characters, no control characters, no .. or ?. |
custom_rules | Up 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
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /ai-bot-policies | view | The policies and which bots each blocks. |
PUT | /applications/{application}/bot-blocker | manage (10 per minute) | Set the policy and your own lists. |
GET | /applications/{application}/bot-traffic | Logs view (30 per minute) | Bot traffic report. |
PUT body:
| Field | Rules |
|---|---|
policy | Required: allow_all, block_training, block_agents, block_all or legacy_v7. |
blocked | Optional array of up to 50 bot user-agent names to block as well. |
allowed | Optional 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
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /applications/{application}/fail2ban | view | The site's jail, or the templates to start from. |
POST | /applications/{application}/fail2ban | manage (10 per minute) | Create or replace the jail. |
DELETE | /applications/{application}/fail2ban | manage (10 per minute) | Turn it off. |
GET | /applications/{application}/fail2ban/bans | view | The IPs now banned in the jail. |
POST | /applications/{application}/fail2ban/bans | manage (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.
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /applications/{application}/staging | view | The staging copy and the latest run. |
POST | /applications/{application}/staging | manage (5 per minute) | Create one. |
POST | /applications/{application}/staging/push | manage (5 per minute) | Copy staging to the live site. |
POST | /applications/{application}/staging/pull | manage (5 per minute) | Copy the live site to staging. |
GET | /applications/{application}/staging/runs/{run} | view | One run. |
GET | /applications/{application}/staging/safety-copies | view | The database copies kept before a push. |
POST | /applications/{application}/staging/safety-copies/{name}/restore | manage (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
| Method | Path | Permission | Purpose |
|---|---|---|---|
POST | /applications/{application}/clone | manage (5 per minute) | Clone the site to a new application. |
GET | /clones | view | Clones, paged. |
GET | /clones/{clone} | view | One 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
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /applications/{application}/update | view | Update status and history. |
POST | /applications/{application}/update | manage (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.
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /applications/{application}/workers | view | Workers, presets and checks. |
POST | /applications/{application}/workers | manage (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-supervisor | manage (6 per minute) | Install Supervisor. |
GET returns {"workers": [ … ], "presets": [ … ], "checks": [ … ]}.
POST and PUT body:
| Field | Rules |
|---|---|
name | Required, up to 60 characters, one line, unique among the site's workers. |
command | Required, up to 500 characters, none of ; | & ` $ < > ( ) and no new line. |
kind | queue, horizon or custom. |
directory | Nullable, up to 255, no ... |
user | Nullable, up to 32 characters: ^[a-z_][a-z0-9_-]*$. |
log_file | Nullable, an absolute path up to 255, no ... |
log_level | Nullable: critical, error, warn, info, debug, trace or blather. |
extra_config | Nullable, up to 2000 characters, no [. |
processes | 1 to 16. |
stop_wait_seconds | 1 to 3600. |
auto_start, auto_restart, restart_on_deploy, enabled | Booleans. |
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
| Status | Message or cause |
|---|---|
403 | Your role does not include management for <feature>. |
404 | Unknown application, worker, run, clone or upload; or a group the site type does not have. |
409 | A clone is already running; a Fail2ban jail is not enabled. |
422 | Validation ({"message", "errors": {"field": ["…"]}}), a file that is not text, an unsupported stack. |
429 | A per-endpoint or shared limit; wait for Retry-After. |
500 | {"message", "reference"}: find the reference in the error log. |
Related
Applications API
List, create, change, run and delete applications, and manage their domains, certificates, deployments and containers through the OSS Panel API.
Databases API
Database engines and connections, databases and their users, exports, imports, per-database backups and one-click Adminer and phpMyAdmin sign-in through the OSS Panel API.