API reference
Site configuration and tools
Configuration files, workers, maintenance, Artisan, Composer, the queue, files and the terminal.
Configuration files
nginx, .env and PHP-FPM configuration, with version history.
/api/sites/{id}/config/nginx
Get nginx config
Returns the site's nginx vhost from /etc/nginx/sites-available/<domain> on the site's server. When the file does not exist, a default Laravel vhost template is returned instead (nothing is written).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- The response does not say whether the content is the real file or the template.
curl "https://panel.example.com/api/sites/12/config/nginx" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"content": "server {\n listen 80;\n server_name shop.example.com;\n root /var/www/sites/shop.example.com/current/public;\n ...\n}\n",
"path": "/etc/nginx/sites-available/shop.example.com"
}
/api/sites/{id}/config/nginx
Save nginx config
Replaces the site's nginx vhost: backs up the current file, writes the new one, makes sure it is enabled, runs nginx -t and reloads nginx. When the test fails the previous config is restored (or the new file removed on a first save). Saved content is recorded in the config history.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
contentstringrequired- Full file content.max 65536 chars
Errors
- 400
Nginx config test failed โ reverted.nginx -t failed; body also has "details" with the nginx output.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
Nginx reload failedThe test passed but systemctl reload nginx failed; the new file stays on disk. Body also has "details".
- Developers (with site access) may save the vhost; only admins may save PHP-FPM and supervisor configs.
- No audit entry is written.
- Before saving, the file currently on disk is added to the history if it is not there yet (note before-first-edit or external-change).
curl -X PUT "https://panel.example.com/api/sites/12/config/nginx" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "server {\n listen 80;\n server_name shop.example.com;\n root /var/www/sites/shop.example.com/current/public;\n ...\n}\n"
}'{
"ok": true,
"message": "Nginx config saved and reloaded."
}
/api/sites/{id}/config/env
Get .env file
Returns the site's <rootPath>/shared/.env from the site's server. When the file does not exist, a Laravel .env template with a freshly generated APP_KEY is returned instead (nothing is written).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- The content is returned in plain text, secrets included, to every role with site access (viewers too).
- The template generates a new random APP_KEY on every call.
curl "https://panel.example.com/api/sites/12/config/env" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"content": "APP_NAME=\"shop.example.com\"\nAPP_ENV=production\nAPP_DEBUG=false\nAPP_URL=https://shop.example.com\nDB_DATABASE=shop\n",
"path": "/var/www/sites/shop.example.com/shared/.env"
}
/api/sites/{id}/config/env
Save .env file
Normalises and writes the site's shared .env (after backing up the old file to .env.bak) and stores an encrypted version in the .env history (latest 50 kept). The running app only picks it up after the next deploy.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
contentstringrequired- Full file content.max 65536 chars
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- Normalisation: CRLF/CR โ LF, trailing spaces/tabs removed on every line, runs of 3+ newlines collapsed to one blank line, exactly one trailing newline.
- On the first save through the panel the pre-existing file is stored as a version with note "Before first panel edit".
- No audit entry is written. A write failure on the server surfaces as a 500.
curl -X PUT "https://panel.example.com/api/sites/12/config/env" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "APP_NAME=\"shop.example.com\"\nAPP_ENV=production\nAPP_DEBUG=false\nAPP_URL=https://shop.example.com\nDB_DATABASE=shop\n"
}'{
"ok": true,
"message": ".env saved. Re-deploy to apply changes."
}
/api/sites/{id}/config/env/versions
List .env versions
Lists the stored .env versions of the site, newest first (metadata only).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.
- note is null for a normal save, "Before first panel edit" or "Before restore". createdBy is null when the author is unknown or deleted.
- No 404: an unknown site returns {"versions": []}.
curl "https://panel.example.com/api/sites/12/config/env/versions" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"versions": [
{
"id": 41,
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdBy": {
"email": "[email protected]"
}
},
{
"id": 40,
"note": "Before first panel edit",
"createdAt": "2026-11-20T09:30:00.000Z",
"createdBy": {
"email": "[email protected]"
}
}
]
}
/api/sites/{id}/config/env/versions/{vid}
Get a .env version
Returns the decrypted content of one stored .env version.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
vidintegerrequired- .env version id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Version not foundNo such version, or it belongs to another site.
- content is "" when the version can no longer be decrypted (encryption key changed).
curl "https://panel.example.com/api/sites/12/config/env/versions/1" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"content": "APP_NAME=\"shop.example.com\"\nAPP_ENV=production\nAPP_DEBUG=false\nAPP_URL=https://shop.example.com\nDB_DATABASE=shop\n",
"createdAt": "2026-11-27T10:00:00.000Z"
}
/api/sites/{id}/config/env/versions/{vid}/restore
Restore a .env version
Writes a stored version back to the site's shared .env. The current file is first saved as a version ("Before restore") and copied to .env.bak, so the restore can be undone.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
env.restored
Path parameters
idintegerrequired- Site id.
vidintegerrequired- .env version id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 404
Version not foundNo such version, or it belongs to another site.
- A version that can no longer be decrypted is restored as an EMPTY file.
- No request body. Send this request without a body (or with a JSON body such as {}). Sending Content-Type: application/json with an empty body is rejected by Fastify with 400 FST_ERR_CTP_EMPTY_JSON_BODY.
curl -X POST "https://panel.example.com/api/sites/12/config/env/versions/1/restore" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"content": "APP_NAME=\"shop.example.com\"\nAPP_ENV=production\nAPP_DEBUG=false\nAPP_URL=https://shop.example.com\nDB_DATABASE=shop\n",
"message": ".env restored. Re-deploy to apply."
}
/api/sites/{id}/php-versions
List installed PHP versions
Returns the site's PHP version and the PHP versions installed on the site's server (from /etc/php/<x.y>, update-alternatives, or which php8.0โฆphp8.4).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
curl "https://panel.example.com/api/sites/12/php-versions" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"current": "8.3",
"available": [
"8.2",
"8.3",
"8.4"
]
}
/api/sites/{id}/php-version
Switch PHP version
Switches the site to another installed PHP version: replaces php<old>-fpm.sock with php<new>-fpm.sock in the nginx vhost, tests and reloads nginx, then saves the new version on the site.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
php.switched
Path parameters
idintegerrequired- Site id.
Body
versionstringrequired- Target PHP version.pattern ^\d+\.\d+$; must be installed on the server
Errors
- 400
Nginx config test failed โ previous config restored.nginx -t failed after the edit; body also has "details".- 400
PHP 8.4 is not installed on this server.version is not among the detected versions.- 400
Site is already using PHP 8.4.version equals the current version (message contains it).- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
Nginx reload failed โ reverted.Reload failed; the old vhost is put back and the DB is not changed. Body also has "details".
- When the vhost does not exist yet, only the database is updated: {"ok": true, "reloaded": false, "message": "PHP version updated to 8.4 in database. Re-provision to apply to nginx."}.
- When the vhost has no php<old>-fpm.sock reference, only the database is updated: {"ok": true, "reloaded": false, "message": "PHP version updated to 8.4. No socket reference found in nginx config โ may need manual nginx update."}.
- Only nginx is changed: the site's PHP-FPM pool file is not moved to the new version, supervisor/cron configs keep the old php binary until regenerated, and the change applies to the next deploy.
- The vhost change is recorded in the nginx config history with note "php-switch".
curl -X POST "https://panel.example.com/api/sites/12/php-version" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"version": "8.4"
}'{
"ok": true,
"reloaded": true,
"message": "Switched to PHP 8.4 and reloaded nginx."
}
/api/sites/{id}/config/nginx/versions
List nginx config versions
Lists the stored versions of the site's nginx vhost, newest first (metadata only).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- note is null for a normal save, or a code: before-first-edit (the original file), external-change (file was changed outside the panel), php-switch, ssl-change, restored:<versionId>. The latest 50 versions per site and kind are kept; content is stored encrypted.
- Declared in a loop over the kinds nginx, phpfpm and supervisor (one route per kind).
curl "https://panel.example.com/api/sites/12/config/nginx/versions" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"versions": [
{
"id": 88,
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdByEmail": "[email protected]"
},
{
"id": 71,
"note": "before-first-edit",
"createdAt": "2026-11-20T09:30:00.000Z",
"createdByEmail": null
}
]
}
/api/sites/{id}/config/nginx/versions/{vid}
Get a nginx config version
Returns one stored version of the site's nginx vhost, decrypted.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
vidintegerrequired- Config version id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Version not foundNo such version, it belongs to another site or kind, or it can no longer be decrypted.
curl "https://panel.example.com/api/sites/12/config/nginx/versions/1" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"id": 88,
"content": "server {\n listen 80;\n server_name shop.example.com;\n root /var/www/sites/shop.example.com/current/public;\n ...\n}\n",
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdByEmail": "[email protected]"
}
/api/sites/{id}/config/nginx/versions/{vid}/restore
Restore a nginx config version
Writes a stored version of the nginx vhost back to the server through the same guarded path as a normal save (nginx -t, revert on failure, reload). The file currently on disk is first added to the history if it is not there yet, so the restore can be undone.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
config.nginx.restored
Path parameters
idintegerrequired- Site id.
vidintegerrequired- Config version id.
Errors
- 400
Nginx config test failed โ reverted.nginx -t failed; body also has "details".- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 404
Version not foundNo such version for this site and kind, or it can no longer be decrypted.- 409
This version was saved for a different domain and does not mention shop.example.com โ restoring it would take the site offline. Copy what you need from it by hand instead.The version does not contain the current domain, or references php<x.y>-fpm for other PHP versions only (then the PHP message is used). Body also has "code": "version_mismatch".- 500
Nginx reload failedReload failed after a passing test (file stays written); body also has "details".
- The response is {"ok": true, "content": "<restored content>"}.
- The restored content is recorded as a new version with note restored:<vid> (also when the file was written but the reload/update failed).
- No request body. Send this request without a body (or with a JSON body such as {}). Sending Content-Type: application/json with an empty body is rejected by Fastify with 400 FST_ERR_CTP_EMPTY_JSON_BODY.
curl -X POST "https://panel.example.com/api/sites/12/config/nginx/versions/1/restore" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"content": "server {\n listen 80;\n server_name shop.example.com;\n root /var/www/sites/shop.example.com/current/public;\n ...\n}\n"
}
/api/sites/{id}/config/phpfpm/versions
List PHP-FPM config versions
Lists the stored versions of the site's PHP-FPM pool, newest first (metadata only).
- Token or session
- Admin
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- note is null for a normal save, or a code: before-first-edit (the original file), external-change (file was changed outside the panel), php-switch, ssl-change, restored:<versionId>. The latest 50 versions per site and kind are kept; content is stored encrypted.
- Declared in a loop over the kinds nginx, phpfpm and supervisor (one route per kind).
curl "https://panel.example.com/api/sites/12/config/phpfpm/versions" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"versions": [
{
"id": 88,
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdByEmail": "[email protected]"
},
{
"id": 71,
"note": "before-first-edit",
"createdAt": "2026-11-20T09:30:00.000Z",
"createdByEmail": null
}
]
}
/api/sites/{id}/config/phpfpm/versions/{vid}
Get a PHP-FPM config version
Returns one stored version of the site's PHP-FPM pool, decrypted.
- Token or session
- Admin
- Needs site access
Path parameters
idintegerrequired- Site id.
vidintegerrequired- Config version id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Version not foundNo such version, it belongs to another site or kind, or it can no longer be decrypted.
curl "https://panel.example.com/api/sites/12/config/phpfpm/versions/1" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"id": 88,
"content": "[shop.example.com]\nuser = www-data\ngroup = www-data\nlisten = /run/php/php8.3-fpm-shop.example.com.sock\npm = dynamic\npm.max_children = 10\n",
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdByEmail": "[email protected]"
}
/api/sites/{id}/config/phpfpm/versions/{vid}/restore
Restore a PHP-FPM config version
Writes a stored version of the PHP-FPM pool back to the server through the same guarded path as a normal save (php-fpm -t, revert on failure, reload). The file currently on disk is first added to the history if it is not there yet, so the restore can be undone.
- Token or session
- Admin
- Needs site access
- Audit:
config.phpfpm.restored
Path parameters
idintegerrequired- Site id.
vidintegerrequired- Config version id.
Errors
- 400
Invalid PHP-FPM pool configThe content has no "[" (no pool name).- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 404
Version not foundNo such version for this site and kind, or it can no longer be decrypted.- 409
This version was saved for PHP 8.2, but the site now runs PHP 8.3 โ restoring it could break PHP for other sites. Copy what you need from it by hand instead.The version references php<x.y> versions none of which is the site's current PHP version. Body also has "code": "version_mismatch".- 500
Config syntax error: <php-fpm -t output>php-fpm -t failed; the previous pool file is put back.
- reloaded is false when the php-fpm reload failed (the file is still installed).
- The restored content is recorded as a new version with note restored:<vid> (also when the file was written but the reload/update failed).
- No request body. Send this request without a body (or with a JSON body such as {}). Sending Content-Type: application/json with an empty body is rejected by Fastify with 400 FST_ERR_CTP_EMPTY_JSON_BODY.
curl -X POST "https://panel.example.com/api/sites/12/config/phpfpm/versions/1/restore" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"content": "[shop.example.com]\nuser = www-data\ngroup = www-data\nlisten = /run/php/php8.3-fpm-shop.example.com.sock\npm = dynamic\npm.max_children = 10\n",
"reloaded": true
}
/api/sites/{id}/config/supervisor/versions
List supervisor config versions
Lists the stored versions of the site's supervisor worker config, newest first (metadata only).
- Token or session
- Admin
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- note is null for a normal save, or a code: before-first-edit (the original file), external-change (file was changed outside the panel), php-switch, ssl-change, restored:<versionId>. The latest 50 versions per site and kind are kept; content is stored encrypted.
- Declared in a loop over the kinds nginx, phpfpm and supervisor (one route per kind).
curl "https://panel.example.com/api/sites/12/config/supervisor/versions" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"versions": [
{
"id": 88,
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdByEmail": "[email protected]"
},
{
"id": 71,
"note": "before-first-edit",
"createdAt": "2026-11-20T09:30:00.000Z",
"createdByEmail": null
}
]
}
/api/sites/{id}/config/supervisor/versions/{vid}
Get a supervisor config version
Returns one stored version of the site's supervisor worker config, decrypted.
- Token or session
- Admin
- Needs site access
Path parameters
idintegerrequired- Site id.
vidintegerrequired- Config version id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Version not foundNo such version, it belongs to another site or kind, or it can no longer be decrypted.
curl "https://panel.example.com/api/sites/12/config/supervisor/versions/1" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"id": 88,
"content": "[program:shop.example.com-worker]\ncommand=php8.3 /var/www/sites/shop.example.com/current/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600\nnumprocs=2\nstdout_logfile=/var/www/sites/shop.example.com/shared/logs/worker.log\n",
"note": null,
"createdAt": "2026-11-27T10:00:00.000Z",
"createdByEmail": "[email protected]"
}
/api/sites/{id}/config/supervisor/versions/{vid}/restore
Restore a supervisor config version
Writes a stored version of the supervisor worker config back to the server through the same guarded path as a normal save (supervisorctl reread && update). The file currently on disk is first added to the history if it is not there yet, so the restore can be undone.
- Token or session
- Admin
- Needs site access
- Audit:
config.supervisor.restored
Path parameters
idintegerrequired- Site id.
vidintegerrequired- Config version id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 404
Version not foundNo such version for this site and kind, or it can no longer be decrypted.- 409
This version was saved for a different site folder and does not mention /var/www/sites/shop.example.com โ restoring it would break the queue workers. Copy what you need from it by hand instead.The version does not contain the site's current rootPath. Body also has "code": "version_mismatch".- 500
supervisorctl update failedsupervisorctl reread/update failed; the file stays written. Body also has "details".
- output is the supervisorctl output.
- The restored content is recorded as a new version with note restored:<vid> (also when the file was written but the reload/update failed).
- No request body. Send this request without a body (or with a JSON body such as {}). Sending Content-Type: application/json with an empty body is rejected by Fastify with 400 FST_ERR_CTP_EMPTY_JSON_BODY.
curl -X POST "https://panel.example.com/api/sites/12/config/supervisor/versions/1/restore" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"content": "[program:shop.example.com-worker]\ncommand=php8.3 /var/www/sites/shop.example.com/current/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600\nnumprocs=2\nstdout_logfile=/var/www/sites/shop.example.com/shared/logs/worker.log\n",
"output": "shop.example.com-worker: changed\nshop.example.com-worker: stopped\nshop.example.com-worker: updated process group"
}
/api/sites/{id}/phpfpm
Get PHP-FPM pool config
Returns the site's PHP-FPM pool file /etc/php/<phpVersion>/fpm/pool.d/<domain>.conf from the site's server. When it does not exist, a default pool template is returned with exists=false (nothing is written).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- Characters other than letters, digits, "." and "-" in the domain are replaced by "_" in the file name.
curl "https://panel.example.com/api/sites/12/phpfpm" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"content": "[shop.example.com]\nuser = www-data\ngroup = www-data\nlisten = /run/php/php8.3-fpm-shop.example.com.sock\npm = dynamic\npm.max_children = 10\n",
"path": "/etc/php/8.3/fpm/pool.d/shop.example.com.conf",
"exists": true
}
/api/sites/{id}/phpfpm
Save PHP-FPM pool config
Installs a new PHP-FPM pool file for the site (via sudo install), runs php-fpm<version> -t and reloads php<version>-fpm. A failing syntax test puts the previous file back (or removes the new one). The saved content is recorded in the config history.
- Token or session
- Admin
- Needs site access
- Audit:
phpfpm.updated
Path parameters
idintegerrequired- Site id.
Body
contentstringrequired- Full file content.1โ20000 chars
Errors
- 400
Invalid PHP-FPM pool configcontent contains no "[" (no pool name).- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
<error message>The site's server could not be resolved or a command failed.- 500
Config syntax error: <php-fpm -t output>php-fpm -t reported FAILED; the previous pool is restored.
- reloaded is false when the php-fpm reload failed; the file is still installed.
- Admin only: pool settings (user, php_admin_valueโฆ) control how PHP runs.
curl -X PUT "https://panel.example.com/api/sites/12/phpfpm" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "[shop.example.com]\nuser = www-data\ngroup = www-data\nlisten = /run/php/php8.3-fpm-shop.example.com.sock\npm = dynamic\npm.max_children = 10\n"
}'{
"ok": true,
"reloaded": true,
"path": "/etc/php/8.3/fpm/pool.d/shop.example.com.conf"
}
Workers and scheduler
Supervisor queue workers and the Laravel scheduler.
/api/sites/{id}/supervisor
Get queue worker config
Returns the site's supervisor config /etc/supervisor/conf.d/<domain>-worker.conf from the site's server. When it does not exist, a default Laravel queue:work template (2 processes, redis) is returned instead (nothing is written).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- The response does not say whether the content is the real file or the template.
curl "https://panel.example.com/api/sites/12/supervisor" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"content": "[program:shop.example.com-worker]\ncommand=php8.3 /var/www/sites/shop.example.com/current/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600\nnumprocs=2\nstdout_logfile=/var/www/sites/shop.example.com/shared/logs/worker.log\n",
"path": "/etc/supervisor/conf.d/shop.example.com-worker.conf"
}
/api/sites/{id}/supervisor
Save queue worker config
Writes the site's supervisor worker config (creating <rootPath>/shared/logs if needed) and runs supervisorctl reread && supervisorctl update. The saved content is recorded in the config history.
- Token or session
- Admin
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
contentstringrequired- Full file content.max 8192 chars
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleCaller is not an admin.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
supervisorctl update failedreread/update failed; the file stays written and is recorded in history. Body also has "details".
- No validation of the content and no revert: the file is written as sent.
- No audit entry is written.
- Admin only: supervisor programs run commands as any user, root included.
curl -X PUT "https://panel.example.com/api/sites/12/supervisor" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "[program:shop.example.com-worker]\ncommand=php8.3 /var/www/sites/shop.example.com/current/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600\nnumprocs=2\nstdout_logfile=/var/www/sites/shop.example.com/shared/logs/worker.log\n"
}'{
"ok": true,
"output": "shop.example.com-worker: changed\nshop.example.com-worker: stopped\nshop.example.com-worker: updated process group"
}
/api/sites/{id}/supervisor/status
Get queue worker status
Runs supervisorctl status "<domain>-worker:" on the site's server and returns the parsed process list.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- state is upper-cased (RUNNING, STOPPED, FATAL, BACKOFF, โฆ).
- Output lines are parsed as "<name> <state> <description>", so when the group does not exist supervisorctl's message yields an entry like {"name": "shop.example.com-worker:", "state": "ERROR", "description": "(no such group)"} rather than an empty list.
curl "https://panel.example.com/api/sites/12/supervisor/status" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"processes": [
{
"name": "shop.example.com-worker:shop.example.com-worker_00",
"state": "RUNNING",
"description": "pid 4121, uptime 2:14:07"
},
{
"name": "shop.example.com-worker:shop.example.com-worker_01",
"state": "RUNNING",
"description": "pid 4122, uptime 2:14:07"
}
]
}
/api/sites/{id}/supervisor/control
Start, stop or restart workers
Runs supervisorctl start|stop|restart on the site's worker group and returns the output and the fresh process status. On start, a missing worker config is first created from the default template.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
actionstringrequired- Action to run.one of: start, stop, restart
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
Supervisor group not found. Config was written but failed to load โ check supervisor logs."no such group", the default config was written and the retry still failed. Body also has "details".- 500
Supervisor group not found. Try saving the supervisor config to reload it."no such group" and a config file exists. Body also has "details".
- ok is false (still HTTP 200) when supervisorctl failed for another reason; output then holds the error text.
- No audit entry is written.
curl -X POST "https://panel.example.com/api/sites/12/supervisor/control" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "restart"
}'{
"ok": true,
"action": "restart",
"output": "shop.example.com-worker:shop.example.com-worker_00: stopped\nshop.example.com-worker:shop.example.com-worker_00: started",
"processes": [
{
"name": "shop.example.com-worker:shop.example.com-worker_00",
"state": "RUNNING",
"description": "pid 4121, uptime 2:14:07"
},
{
"name": "shop.example.com-worker:shop.example.com-worker_01",
"state": "RUNNING",
"description": "pid 4122, uptime 2:14:07"
}
]
}
/api/sites/{id}/cron
Get scheduler cron file
Returns the site's Laravel scheduler cron file /etc/cron.d/<domain with dots replaced by "-">-scheduler, whether it exists, and the line the panel would write.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- active=false and content "" when the file does not exist (or cannot be read).
- This and GET /api/sites/{id}/scheduler manage the same cron file for ordinary domains but write slightly different content; see the scheduler endpoints.
curl "https://panel.example.com/api/sites/12/cron" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"active": true,
"content": "# Laravel Scheduler โ shop.example.com\n* * * * * www-data php8.3 /var/www/sites/shop.example.com/current/artisan schedule:run >> /dev/null 2>&1\n",
"path": "/etc/cron.d/shop-example-com-scheduler",
"expected": "# Laravel Scheduler โ shop.example.com\n* * * * * www-data php8.3 /var/www/sites/shop.example.com/current/artisan schedule:run >> /dev/null 2>&1"
}
/api/sites/{id}/cron
Enable scheduler cron
Writes the Laravel scheduler cron file (runs php<version> artisan schedule:run every minute as www-data) on the site's server and sets mode 644.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- Writes directly (no sudo): if the panel process cannot write to /etc/cron.d the request fails with a 500. The PUT /api/sites/{id}/scheduler variant writes through sudo install.
- No audit entry is written. No request body is read (the web client sends {}).
curl -X PUT "https://panel.example.com/api/sites/12/cron" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"path": "/etc/cron.d/shop-example-com-scheduler"
}
/api/sites/{id}/cron
Disable scheduler cron
Deletes the site's Laravel scheduler cron file on the site's server.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- Deletes without sudo; a permission error surfaces as a 500. No audit entry is written.
curl -X DELETE "https://panel.example.com/api/sites/12/cron" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/api/sites/{id}/scheduler
Get Laravel scheduler state
Reports whether the site's scheduler cron file exists on the site's server, its path, and the content the panel writes when enabling it.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- cronContent is the template the panel would write, not the file's actual content.
- The path replaces every character other than letters, digits and "-" in the domain with "-" (/etc/cron.d/<domain>-scheduler).
curl "https://panel.example.com/api/sites/12/scheduler" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"active": true,
"cronPath": "/etc/cron.d/shop-example-com-scheduler",
"cronContent": "# Laravel Scheduler โ managed by Orchestrator\nSHELL=/bin/bash\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n* * * * * www-data php8.3 \"/var/www/sites/shop.example.com/current/artisan\" schedule:run >> /dev/null 2>&1\n"
}
/api/sites/{id}/scheduler
Enable Laravel scheduler
Installs the scheduler cron file (php<version> artisan schedule:run every minute as www-data) on the site's server via sudo install.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
scheduler.enabled
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
Failed to write cron file: <reason>Writing or installing the file failed.
- No request body is read (the web client sends {}).
curl -X PUT "https://panel.example.com/api/sites/12/scheduler" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"cronPath": "/etc/cron.d/shop-example-com-scheduler"
}
/api/sites/{id}/scheduler
Disable Laravel scheduler
Removes the scheduler cron file from the site's server via sudo rm -f.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
scheduler.disabled
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- Errors while removing are ignored: the response is always {"ok": true} (and the audit entry written) once the site exists.
curl -X DELETE "https://panel.example.com/api/sites/12/scheduler" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
Maintenance mode
Take a Laravel site down for maintenance and bring it back.
/api/sites/{id}/maintenance
Turn maintenance mode on or off
Runs php artisan down (optionally with a bypass secret) or php artisan up in the site's current release on its server, then stores the new maintenanceMode flag.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
maintenance.enabled, maintenance.disabled
Path parameters
idintegerrequired- Site id.
Body
actionstringrequired- down enables maintenance mode, up disables it.one of: down, up
secretstring- Bypass secret for artisan down --secret (visit https://<domain>/<secret> to bypass). Ignored for up.max 128 chars, pattern ^[A-Za-z0-9_-]{1,128}$
Errors
- 400
Secret may only contain letters, numbers, hyphen and underscoresecret has other characters.- 400
Site is not activeSite status is not "active".- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.- 500
<artisan output or error message>The artisan command failed or timed out (15 s); maintenanceMode is not changed.
- Uses Laravel's artisan, so it only works for Laravel sites.
curl -X POST "https://panel.example.com/api/sites/12/maintenance" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "down",
"secret": "team-preview-2026"
}'{
"ok": true,
"action": "down",
"output": "INFO Application is now in maintenance mode."
}
/api/sites/{id}/maintenance
Get maintenance mode state
Returns the maintenance-mode flag stored in the panel.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteYour account has no access to this site.- 404
Site not foundNo site with this id.
- This is the panel's stored flag, not a live check of the application (artisan down run outside the panel is not detected).
curl "https://panel.example.com/api/sites/12/maintenance" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"maintenanceMode": false
}
Artisan and Composer
Run allowed Artisan commands and manage Composer packages.
/api/sites/{id}/artisan/commands
List allowed Artisan commands
Returns the fixed allow-list of Artisan commands that POST /artisan/run accepts, with a label, description and group for each. The list is the same for every site.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.
- Allow-list (15 commands): cache:clear, config:cache, config:clear, view:clear, route:cache, route:clear, optimize, optimize:clear, migrate, migrate:status, migrate:rollback, queue:restart, storage:link, telescope:clear, horizon:terminate. Any other value, including arguments or options (e.g. "migrate --force"), is rejected.
- Groups: Cache, Database, Queue, Other.
- The site is not looked up (no 404).
curl "https://panel.example.com/api/sites/12/artisan/commands" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"commands": [
{
"cmd": "cache:clear",
"label": "Clear cache",
"description": "Clear the application cache",
"group": "Cache"
},
{
"cmd": "migrate",
"label": "Migrate",
"description": "Run pending database migrations",
"group": "Database"
}
]
}
/api/sites/{id}/artisan/run
Run an Artisan command
Starts php<phpVersion> <rootPath>/current/artisan <command> --no-interaction --ansi in <rootPath>/current on the site's server. Returns immediately; follow the output with GET /api/sites/{id}/artisan/stream.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
commandstringrequired- One command from the allow-list, exactly as listed.1โ100 chars; one of: cache:clear, config:cache, config:clear, view:clear, route:cache, route:clear, optimize, optimize:clear, migrate, migrate:status, migrate:rollback, queue:restart, storage:link, telescope:clear, horizon:terminate
Errors
- 400
Command not in allowlist: <command>command is not one of the allowed commands.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (write method on a site route).- 404
Site not foundNo site with this id.- 409
Another artisan command is already running for this site.A command for this site is running or finished less than 10 seconds ago.- 500
<error message>The process could not be spawned (e.g. SSH not configured for the server).
- Allow-list (15 commands): cache:clear, config:cache, config:clear, view:clear, route:cache, route:clear, optimize, optimize:clear, migrate, migrate:status, migrate:rollback, queue:restart, storage:link, telescope:clear, horizon:terminate. Any other value, including arguments or options (e.g. "migrate --force"), is rejected.
- Only --no-interaction and --ansi are added; --force is never passed, so commands that ask for confirmation in production (e.g. migrate) follow Laravel's non-interactive default.
- One command per site at a time; the lock is held until 10 seconds after the process exits.
- No audit entry is written.
curl -X POST "https://panel.example.com/api/sites/12/artisan/run" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"command": "optimize:clear"
}'{
"started": true,
"command": "optimize:clear",
"siteId": 12
}
/api/sites/{id}/artisan/stream
Stream Artisan output
Server-Sent Events stream of the site's current Artisan command. Buffered lines are replayed first, then live lines follow until the process exits.
- Token or session
- Any role
- Needs site access
- Server-Sent Events
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.
- Events (unnamed, data only): {"line": "<one output line>"} โ stdout and stderr are split on newlines, empty lines dropped, ANSI colour codes kept (--ansi); {"done": true, "status": "success" | "failed"} when the process exits โ the server then closes the stream.
- When no command is running (or its buffer was already released) the stream sends {"done": true, "status": "idle"} and closes immediately.
- Edge case: connecting in the 10 seconds after a command finished replays its lines but receives no done event (it was already emitted); the stream then stays open until the client disconnects.
- If the process fails to start after spawning, a line "Error: <message>" and {"done": true, "status": "failed"} are sent.
- No keep-alive comments are sent. The site id is not checked for existence.
curl -N "https://panel.example.com/api/sites/12/artisan/stream" \
-H "Authorization: Bearer $ORCH_TOKEN"SSE stream; each event is a "data: <JSON>" line.
/api/sites/{id}/composer/outdated
List outdated Composer packages
Runs composer outdated --format=json in <rootPath>/current with the site's PHP version and returns Composer's package objects unchanged.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 404
Site not foundNo site with this id.- 500
<error message>composer failed and printed no parseable JSON.
- The package objects are passed through from Composer, so their fields depend on the Composer version (the web client reads name, version, latest, latest-status, description).
- Timeout 60 seconds. A non-zero exit with valid JSON output still returns 200.
curl "https://panel.example.com/api/sites/12/composer/outdated" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"packages": [
{
"name": "laravel/framework",
"direct-dependency": true,
"homepage": "https://laravel.com",
"source": "https://github.com/laravel/framework/tree/v11.30.0",
"version": "v11.30.0",
"latest": "v12.2.0",
"latest-status": "update-possible",
"description": "The Laravel Framework.",
"abandoned": false
}
]
}
/api/sites/{id}/composer/update
Update Composer packages
Runs composer as www-data in <rootPath>/current: composer update (all packages), composer update <package> -W (one package), or composer require <package>:^<targetVersion> -W for a major upgrade (keeping it in require-dev when it was there). Waits for Composer and returns its combined output.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
composer.update
Path parameters
idintegerrequired- Site id.
Body
packagestring- Package to update; omit to update everything.max 200 chars; pattern ^[a-z0-9]([a-z0-9._-]*)/[a-z0-9]([a-z0-9._-]*)(:[A-Za-z0-9._^~*<>=. -]+)?$
targetVersionstring- Major upgrade target; sets the constraint to ^targetVersion. Requires package.max 32 chars; pattern ^\d+(\.\d+){0,2}$ (e.g. 13 or 13.4.1)
Errors
- 400
A package is required for a major upgradetargetVersion given without package.- 400
Invalid composer package namepackage does not match the allowed pattern.- 400
Invalid target version (expected e.g. 13 or 13.4.1)targetVersion is not 1โ3 dot-separated numbers.- 400
Site is not activeSite status is not "active".- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (write method on a site route).- 404
Site not foundNo site with this id.- 500
<composer output or error message>Composer exited non-zero or timed out; error holds its output.
- Timeout 5 minutes. Runs with --no-interaction --ignore-platform-reqs; COMPOSER_HOME is <rootPath>/shared/.composer.
- Send a JSON body (at least {}): the route has a body schema, and a missing body fails validation with 400 "body must be object".
- Changes composer.json/composer.lock in the current release only; the next deploy uses the repository's files again.
- The audit entry is written without the calling user. Meta: { package (or "all"), domain, majorTo? }.
curl -X POST "https://panel.example.com/api/sites/12/composer/update" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"package": "laravel/framework",
"targetVersion": "12"
}'{
"ok": true,
"output": "Loading composer repositories with package information\nUpdating dependencies\nLock file operations: 0 installs, 3 updates, 0 removals\nโฆ"
}
/api/sites/{id}/composer/info
Get the root package info
Runs composer show --self --format=json in <rootPath>/current and returns the root package's name, description and first listed version.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 404
Site not foundNo site with this id.
- Timeout 15 seconds. Any failure returns { name: null, description: null, version: null } with status 200.
curl "https://panel.example.com/api/sites/12/composer/info" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"name": "laravel/laravel",
"description": "The skeleton application for the Laravel framework.",
"version": "dev-main"
}
Queue
Pending and failed queue jobs.
/api/sites/{id}/queue/stats
Get queue counts
Counts rows in the Laravel jobs and failed_jobs tables through artisan tinker. Read-only.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 404
Site not foundNo site with this id.
- Both values are null when tinker fails or the database queue tables do not exist (e.g. redis or sync queue drivers).
- Timeout 15 seconds.
curl "https://panel.example.com/api/sites/12/queue/stats" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"pending": 3,
"failed": 1
}
/api/sites/{id}/failed-jobs
List failed jobs
Returns the 50 most recent rows of the Laravel failed_jobs table (newest first) through artisan tinker. Falls back to parsing artisan queue:failed text output when tinker fails.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 404
Site not foundNo site with this id.
- Rows are passed through from the site's own failed_jobs table, so their columns depend on the Laravel version.
- Fallback shape (text parse of queue:failed): { id, connection, queue, class, failed_at } โ all strings.
- Returns { jobs: [] } when both methods fail. Timeout 15 seconds each; output above 1 MB makes tinker fail and triggers the fallback.
curl "https://panel.example.com/api/sites/12/failed-jobs" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"jobs": [
{
"id": 17,
"uuid": "6f1c2b9e-1a2b-4c3d-9e8f-0a1b2c3d4e5f",
"connection": "database",
"queue": "default",
"payload": "{\"displayName\":\"App\\\\Jobs\\\\SendInvoice\",โฆ}",
"exception": "RuntimeException: Mail server unreachable in /var/www/shop.example.com/current/app/Jobs/SendInvoice.php:42 โฆ",
"failed_at": "2026-11-27 09:58:12"
}
]
}
/api/sites/{id}/failed-jobs/{jobId}/retry
Retry a failed job
Runs artisan queue:retry <jobId> on the site's server and returns its output.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
queue.retry
Path parameters
idintegerrequired- Site id.
jobIdstringrequired- Failed job id as listed (passed to artisan queue:retry / queue:forget).pattern ^[a-zA-Z0-9_-]+$
Errors
- 400
Invalid job IDjobId does not match ^[a-zA-Z0-9_-]+$.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (write method on a site route).- 404
Site not foundNo site with this id.- 500
<error message>artisan exited non-zero or timed out (15 s).
- The audit entry is written without the calling user. Meta: { jobId }.
curl -X POST "https://panel.example.com/api/sites/12/failed-jobs/17/retry" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"output": " INFO Pushing failed queue jobs back onto the queue.\n\n 17 ... DONE\n"
}
/api/sites/{id}/failed-jobs/{jobId}
Delete a failed job
Runs artisan queue:forget <jobId> on the site's server.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
jobIdstringrequired- Failed job id as listed (passed to artisan queue:retry / queue:forget).pattern ^[a-zA-Z0-9_-]+$
Errors
- 400
Invalid job IDjobId does not match ^[a-zA-Z0-9_-]+$.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (write method on a site route).- 404
Site not foundNo site with this id.- 500
<error message>artisan exited non-zero or timed out (10 s).
- No audit entry is written.
curl -X DELETE "https://panel.example.com/api/sites/12/failed-jobs/17" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/api/sites/{id}/failed-jobs
Delete all failed jobs
Runs artisan queue:flush on the site's server, deleting every failed job.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
queue.flush
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (write method on a site route).- 404
Site not foundNo site with this id.- 500
<error message>artisan exited non-zero or timed out (10 s).
- The audit entry is written without the calling user. Meta: { domain }.
curl -X DELETE "https://panel.example.com/api/sites/12/failed-jobs" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"output": " INFO All failed jobs deleted successfully.\n"
}
/api/sites/{id}/failed-jobs/retry-all
Retry all failed jobs
Runs artisan queue:retry all on the site's server and returns its output.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
queue.retry_all
Path parameters
idintegerrequired- Site id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedMissing or invalid session token. An unknown or expired personal access token gets "Invalid or expired access token".- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteCaller is not an admin, has no all-sites access and no grant on this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (write method on a site route).- 404
Site not foundNo site with this id.- 500
<error message>artisan exited non-zero or timed out (15 s).
- The audit entry is written without the calling user and without meta.
- Fastify matches this static path before /failed-jobs/{jobId}/retry, so "retry-all" is never treated as a job id.
curl -X POST "https://panel.example.com/api/sites/12/failed-jobs/retry-all" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true,
"output": " INFO Pushing failed queue jobs back onto the queue.\n\n 17 ... DONE\n 18 ... DONE\n"
}
File manager
Read and change files inside a siteโs folder.
/api/sites/{id}/files
List a directory
Lists the entries of a directory inside the site's root path, on the server the site lives on (local host or a remote server over SSH). Directories are always listed first, then entries are sorted by the chosen key. Dotfiles are hidden unless hidden=1.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Query parameters
pathstring- Directory relative to the site root. Leading slashes are optional; "/" or empty means the site root.default "/"; jailed to the site root
hiddenstring- Set to 1 to include entries whose name starts with a dot.only the value "1" enables it
sortstring- Sort key. Any other value sorts by name (case-insensitive).one of: name, size, modified; default name; not validated
orderstring- Sort direction. Any value other than desc is ascending.one of: asc, desc; default asc; not validated
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Path traversal deniedThe resolved path is outside the site root.- 404
Site not foundNo site with this id.- 500
<system error message>Listing a local directory failed (e.g. ENOENT for a directory that does not exist). Body is {"error": "โฆ"}.
- Path rule (all file manager endpoints): the given path is normalised as if rooted at "/" and joined to the site's rootPath, so "../" segments are clamped at the site root rather than escaping it. Symlinks are NOT resolved, so a symlink inside the root that points elsewhere is followed by later operations.
- type is one of file, dir, symlink. For directories size is 0. permissions is the octal mode (e.g. "755"), permsDisplay the rwx form.
- On a remote server a listing error returns an empty entries array instead of an error.
- mime is derived from the file extension only (fixed map); unknown or missing extensions give application/octet-stream.
curl "https://panel.example.com/api/sites/12/files" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"entries": [
{
"name": "current",
"type": "symlink",
"size": 38,
"modified": "2026-11-27T10:00:00.000Z",
"permissions": "777",
"permsDisplay": "rwxrwxrwx",
"owner": "www-data",
"group": "www-data",
"ext": "",
"mime": "application/octet-stream"
},
{
"name": "deploy.log",
"type": "file",
"size": 2048,
"modified": "2026-11-27T10:00:00.000Z",
"permissions": "644",
"permsDisplay": "rw-r--r--",
"owner": "www-data",
"group": "www-data",
"ext": "log",
"mime": "text/plain"
}
],
"path": "/",
"rootPath": "/var/www/shop.example.com"
}
/api/sites/{id}/files/read
Read a file
Returns the content of a file inside the site root for inline viewing or editing. Text types are returned as UTF-8 text; everything else is returned base64-encoded with binary=true. Files larger than 10 MB are refused.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Query parameters
pathstringrequired- File path relative to the site root.jailed to the site root
Errors
- 400
path requiredThe path query parameter is missing or empty.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Path traversal deniedThe resolved path is outside the site root.- 404
File not foundThe path does not exist or is not a regular file.- 404
Site not foundNo site with this id.- 413
File too large (12.4 MB). Max 10 MB for inline editing.The file is larger than 10 MB (10485760 bytes); the size in the message is the actual size.
- binary is true when the extension's mime is not text/* and not application/json or application/xml; then content is base64.
- The type comes from the extension only. Files without an extension โ including dotfiles such as .env (path.extname('.env') is empty) โ map to application/octet-stream and are therefore returned base64-encoded with binary=true. SVG (image/svg+xml) is also returned as base64.
- path in the response echoes the query value as given, not a normalised path.
curl "https://panel.example.com/api/sites/12/files/read?path=value" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"content": "APP_NAME=Shop\nAPP_ENV=production\n",
"ext": "txt",
"mime": "text/plain",
"size": 34,
"binary": false,
"path": "/shared/notes.txt"
}
/api/sites/{id}/files/write
Write a file
Creates or overwrites a text file inside the site root with the given UTF-8 content. Missing parent directories are created.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.write
Path parameters
idintegerrequired- Site id.
Body
pathstringrequired- File path relative to the site root.jailed to the site root
contentstringrequired- Full new file content (UTF-8 text).max 10485760 chars by schema, but the JSON body is capped at Fastify's default 1 MiB bodyLimit
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal deniedThe resolved path is outside the site root.- 404
Site not foundNo site with this id.
- No bodyLimit is configured on the Fastify instance, so a JSON body larger than 1 MiB is rejected with 413 FST_ERR_CTP_BODY_TOO_LARGE before the handler runs, even though the schema allows up to 10 MB of content.
- Write failures (permissions, unreachable server) are not caught and surface as Fastify's default 500 error body.
- Only text content is supported; there is no base64 input for binary files (use the upload endpoint).
curl -X PUT "https://panel.example.com/api/sites/12/files/write" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "/shared/notes.txt",
"content": "Deployed by the ops team.\n"
}'{
"ok": true
}
/api/sites/{id}/files/mkdir
Create a directory
Creates a directory (and any missing parents, like mkdir -p) inside the site root.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.mkdir
Path parameters
idintegerrequired- Site id.
Body
pathstringrequired- Directory path relative to the site root.jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal deniedThe resolved path is outside the site root.- 404
Site not foundNo site with this id.
- Succeeds silently when the directory already exists (recursive mkdir).
curl -X POST "https://panel.example.com/api/sites/12/files/mkdir" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "/shared/storage/exports"
}'{
"ok": true
}
/api/sites/{id}/files/touch
Create an empty file
Creates an empty file inside the site root (parent directories are created). Runs touch, so an existing file is kept and only its modification time is updated.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.touch
Path parameters
idintegerrequired- Site id.
Body
pathstringrequired- File path relative to the site root.jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal deniedThe resolved path is outside the site root.- 404
Site not foundNo site with this id.
curl -X POST "https://panel.example.com/api/sites/12/files/touch" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "/shared/storage/logs/.gitkeep"
}'{
"ok": true
}
/api/sites/{id}/files/delete
Delete files and directories
Recursively deletes each given path (rm -rf) inside the site root and reports a result per path. A path that fails the jail check is reported as failed and the others still run.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.delete
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Paths relative to the site root.array of strings, max 500 items; each jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 404
Site not foundNo site with this id.
- DELETE with a JSON body: send Content-Type: application/json.
- Dangerous: the path "/" (or an empty string) resolves to the site root itself, so it deletes the whole site directory.
- rm -rf of a non-existent path succeeds, so ok is true for paths that did not exist.
- Each rm runs with the default 30-second command timeout.
curl -X DELETE "https://panel.example.com/api/sites/12/files/delete" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/storage/exports/old.csv",
"/tmp-build"
]
}'{
"results": [
{
"path": "/shared/storage/exports/old.csv",
"ok": true
},
{
"path": "/tmp-build",
"ok": false,
"error": "Command failed: โฆ"
}
]
}
/api/sites/{id}/files/rename
Rename or move one path
Renames a file or directory (mv), creating the destination's parent directory if needed. Both paths are relative to the site root.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.rename
Path parameters
idintegerrequired- Site id.
Body
fromstringrequired- Current path.jailed to the site root
tostringrequired- New path (full path, not just the new name).jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal deniedEither path resolves outside the site root.- 404
Site not foundNo site with this id.
- A failing mv (e.g. source missing) is not caught and returns Fastify's default 500 error body.
curl -X POST "https://panel.example.com/api/sites/12/files/rename" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": "/shared/notes.txt",
"to": "/shared/docs/notes.txt"
}'{
"ok": true
}
/api/sites/{id}/files/copy
Copy paths into a directory
Recursively copies each path into the destination directory, keeping its base name (cp -r src dest/<basename>).
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.copy
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Source paths relative to the site root.array of strings; each jailed to the site root
deststringrequired- Destination directory relative to the site root.jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal denieddest resolves outside the site root.- 404
Site not foundNo site with this id.
- Sources that fail the jail check or whose copy fails are skipped silently; the response is still {"ok": true}. The destination directory is not created.
curl -X POST "https://panel.example.com/api/sites/12/files/copy" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/.env"
],
"dest": "/backups"
}'{
"ok": true
}
/api/sites/{id}/files/move
Move paths into a directory
Moves each path into the destination directory, keeping its base name (mv src dest/<basename>).
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.move
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Source paths relative to the site root.array of strings; each jailed to the site root
deststringrequired- Destination directory relative to the site root.jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal denieddest resolves outside the site root.- 404
Site not foundNo site with this id.
- Sources that fail the jail check or whose move fails are skipped silently; the response is still {"ok": true}.
curl -X POST "https://panel.example.com/api/sites/12/files/move" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/storage/exports/report.csv"
],
"dest": "/backups"
}'{
"ok": true
}
/api/sites/{id}/files/zip
Create a zip archive
Runs zip -r from the site root to pack the given paths into the archive at dest, and returns the command output. Paths are stored in the archive relative to the site root.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.zip
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Paths to include, relative to the site root.array of strings; each jailed to the site root (invalid ones dropped)
deststringrequired- Archive file path to create, relative to the site root (e.g. /backups/site.zip).jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal denieddest resolves outside the site root.- 404
Site not foundNo site with this id.
- ok is always true: a failing zip is reported only through output. Timeout 5 minutes.
curl -X POST "https://panel.example.com/api/sites/12/files/zip" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/storage/app"
],
"dest": "/backups/storage.zip"
}'{
"ok": true,
"output": "adding: shared/storage/app/ (stored 0%)"
}
/api/sites/{id}/files/unzip
Extract a zip archive
Extracts a zip archive into the destination directory (created if missing), overwriting existing files (unzip -o).
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.unzip
Path parameters
idintegerrequired- Site id.
Body
pathstringrequired- Zip file relative to the site root.jailed to the site root
deststringrequired- Target directory relative to the site root.jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal deniedpath or dest resolves outside the site root.- 404
Site not foundNo site with this id.
- ok is always true: a failing unzip is reported only through output. Timeout 5 minutes.
- Entries inside the archive are extracted by unzip itself; the API does not check archive member paths.
curl -X POST "https://panel.example.com/api/sites/12/files/unzip" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "/backups/storage.zip",
"dest": "/restore"
}'{
"ok": true,
"output": "Archive: /var/www/shop.example.com/backups/storage.zip\n inflating: /var/www/shop.example.com/restore/shared/storage/app/a.txt"
}
/api/sites/{id}/files/tar
Create a tar.gz archive
Runs tar -czf from the site root to pack the given paths into a gzip-compressed tarball at dest.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Paths to include, relative to the site root.array of strings; each jailed to the site root (invalid ones dropped)
deststringrequired- Archive file path to create (e.g. /backups/site.tar.gz).jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal denieddest resolves outside the site root.- 404
Site not foundNo site with this id.
- Unlike zip, a failing tar is not caught and returns Fastify's default 500 error body.
- Not audited. Timeout 5 minutes.
curl -X POST "https://panel.example.com/api/sites/12/files/tar" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared"
],
"dest": "/backups/shared.tar.gz"
}'{
"ok": true
}
/api/sites/{id}/files/untar
Extract a tar archive
Extracts a tar archive (tar -xf, compression auto-detected) into the destination directory, which is created if missing.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
pathstringrequired- Tar file relative to the site root.jailed to the site root
deststringrequired- Target directory relative to the site root.jailed to the site root
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal deniedpath or dest resolves outside the site root.- 404
Site not foundNo site with this id.
- ok is always true: a failing tar is reported only through output. Not audited. Timeout 5 minutes.
curl -X POST "https://panel.example.com/api/sites/12/files/untar" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "/backups/shared.tar.gz",
"dest": "/restore"
}'{
"ok": true,
"output": ""
}
/api/sites/{id}/files/chmod
Change permissions
Runs chmod with an octal mode on each given path, optionally recursively.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.chmod
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Paths relative to the site root.array of strings; each jailed to the site root
modestringrequired- Octal permission mode.pattern ^[0-7]{3,4}$
recursiveboolean- Apply recursively (chmod -R).default false
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 404
Site not foundNo site with this id.
- Paths that fail the jail check or whose chmod fails are skipped silently.
curl -X POST "https://panel.example.com/api/sites/12/files/chmod" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/storage"
],
"mode": "775",
"recursive": true
}'{
"ok": true
}
/api/sites/{id}/files/chown
Change owner
Runs chown owner[:group] on each given path, optionally recursively.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.chown
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Paths relative to the site root.array of strings; each jailed to the site root
ownerstringrequired- User name.max 64 chars, pattern ^[a-zA-Z0-9._-]+$
groupstring- Group name; when omitted only the owner changes.max 64 chars, pattern ^[a-zA-Z0-9._-]+$
recursiveboolean- Apply recursively (chown -R).default false
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 404
Site not foundNo site with this id.
- Paths that fail the jail check or whose chown fails (e.g. the API user lacks privileges) are skipped silently.
curl -X POST "https://panel.example.com/api/sites/12/files/chown" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/storage"
],
"owner": "www-data",
"group": "www-data",
"recursive": true
}'{
"ok": true
}
/api/sites/{id}/files/download
Download a file
Streams a single file from the site root as an attachment. Works for any size and type (no 10 MB limit).
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Query parameters
pathstringrequired- File path relative to the site root.jailed to the site root
Errors
- 400
path requiredThe path query parameter is missing or empty.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Path traversal deniedThe resolved path is outside the site root.- 404
File not foundThe path does not exist or is not a regular file.- 404
Site not foundNo site with this id.
- No Content-Type is set by the handler, so Fastify sends application/octet-stream for the stream.
- Content-Length is sent only for sites on the local host; remote files are streamed over SSH (cat) without a length.
- Auth is read from the Authorization header only; a plain browser link without the header is rejected with 401.
curl "https://panel.example.com/api/sites/12/files/download?path=value" \
-H "Authorization: Bearer $ORCH_TOKEN"The raw file bytes with Content-Disposition: attachment; filename="<basename>".
/api/sites/{id}/files/download-zip
Download paths as a zip
Builds a temporary zip of the given paths (relative to the site root) in /tmp on the site's server, streams it back as <name>.zip and deletes the temporary file afterwards.
- Token or session
- Admin ยท Developer
- Needs site access
Path parameters
idintegerrequired- Site id.
Body
pathsarrayrequired- Paths to include, relative to the site root.array of strings; each jailed to the site root (invalid ones dropped silently)
namestring- Download file name without the .zip extension.default "download"
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role (this is a POST, so viewers are blocked even though it only reads).- 404
Site not foundNo site with this id.
- No Content-Type is set by the handler, so Fastify sends application/octet-stream.
- zip has a 2-minute timeout; a zip failure (e.g. no valid paths) is not caught and returns Fastify's default 500 error body.
- name is not sanitised and is placed directly in the Content-Disposition header.
curl -X POST "https://panel.example.com/api/sites/12/files/download-zip" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paths": [
"/shared/storage/app",
"/shared/.env"
],
"name": "shop-files"
}'The zip bytes with Content-Disposition: attachment; filename="<name>.zip".
/api/sites/{id}/files/upload
Upload files
Accepts a multipart/form-data request and writes every file part into the destination directory (created if missing), streaming to the site's server. Returns a result per file.
- Token or session
- Admin ยท Developer
- Needs site access
- Audit:
filemanager.upload
Path parameters
idintegerrequired- Site id.
Query parameters
deststring- Destination directory relative to the site root.default "/"; jailed to the site root
overwritestring- Set to 0 to skip files that already exist; any other value (or omitted) overwrites.default overwrite; only "0" disables it
Form data (multipart)
filesfilerequired- One or more file parts. The web client uses the field name "files"; every file part is processed regardless of its field name. Only the base name of the part's filename is used.max 512 MB per file (multipart fileSize limit); nginx client_max_body_size 512m for the whole request; max 1000 parts
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Forbidden: viewer role is read-onlyCaller has the viewer role.- 403
Path traversal denieddest resolves outside the site root.- 404
Site not foundNo site with this id.- 406
the request is not multipartThe request is not multipart/form-data (@fastify/multipart FST_INVALID_MULTIPART_CONTENT_TYPE, Fastify error body).- 413
request file too largeA file exceeds 512 MB (@fastify/multipart FST_REQ_FILE_TOO_LARGE, Fastify error body).
- One filemanager.upload audit entry is written per successfully stored file.
- Per-file failures are returned in results with ok=false and the error message; the request itself still answers 200.
- Uncertain: when a file exceeds the size limit, the truncated part may already have been written before the 413 is raised from the multipart iterator.
curl -X POST "https://panel.example.com/api/sites/12/files/upload" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-F "[email protected]"{
"results": [
{
"filename": "logo.png",
"ok": true,
"size": 18234
},
{
"filename": "robots.txt",
"ok": false,
"error": "File already exists"
}
]
}
/api/sites/{id}/files/search
Search files
Searches below a directory of the site root, either by file name (case-insensitive substring, find -iname) or by content (grep -rl). Returns at most 100 matches.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Query parameters
qstring- Search term. Empty or whitespace-only returns no results.
pathstring- Directory to search in, relative to the site root.default "/"; jailed to the site root
typestring- content searches file contents; any other value searches names.one of: name, content; default name; not validated
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Path traversal deniedpath resolves outside the site root.- 404
Site not foundNo site with this id.
- type in each result is always "file", even when a name search matches a directory.
- The search command times out after 20 seconds; partial output collected so far is still returned.
curl "https://panel.example.com/api/sites/12/files/search" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"results": [
{
"path": "/shared/.env",
"name": ".env",
"type": "file"
}
]
}
/api/sites/{id}/files/diff
Diff two files
Returns the unified diff (diff -u) between two files of the site root. An empty string means the files are identical.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Query parameters
astringrequired- First file, relative to the site root.jailed to the site root
bstringrequired- Second file, relative to the site root.jailed to the site root
Errors
- 400
a and b requireda or b is missing.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Path traversal denieda or b resolves outside the site root.- 404
Site not foundNo site with this id.
- The diff headers contain absolute server paths.
- A missing file yields an empty diff rather than an error. Timeout 10 seconds.
curl "https://panel.example.com/api/sites/12/files/diff?a=value&b=value" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"diff": "--- /var/www/shop.example.com/shared/.env.example\n+++ /var/www/shop.example.com/shared/.env\n@@ -1 +1 @@\n-APP_DEBUG=true\n+APP_DEBUG=false\n"
}
/api/sites/{id}/files/properties
Get file properties
Returns the metadata of one file or directory. For directories totalSize is the recursive disk usage in bytes (du -sb); for files it equals size.
- Token or session
- Any role
- Needs site access
Path parameters
idintegerrequired- Site id.
Query parameters
pathstringrequired- Path relative to the site root.jailed to the site root
Errors
- 400
path requiredThe path query parameter is missing or empty.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: no access to this siteNon-admin caller without a grant for this site.- 403
Path traversal deniedpath resolves outside the site root.- 404
Not foundThe path does not exist.- 404
Site not foundNo site with this id.
- Uses lstat locally, so a symlink is reported as type symlink, not as its target.
curl "https://panel.example.com/api/sites/12/files/properties?path=value" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"name": "storage",
"type": "dir",
"size": 0,
"modified": "2026-11-27T10:00:00.000Z",
"permissions": "775",
"permsDisplay": "rwxrwxr-x",
"owner": "www-data",
"group": "www-data",
"ext": "",
"mime": "application/octet-stream",
"totalSize": 52428800
}
Terminal
The site terminal (WebSocket).
/api/terminal/{siteId}
Open a site web terminal
WebSocket that opens an interactive shell for a site: a bash pty in <rootPath>/current (falling back to the site root, then /tmp) on the panel host, or an interactive SSH session into the site's remote server starting in the same directory. It is a real, unsandboxed shell running as the API user, not restricted to the site.
- Browser session only
- Admin ยท Developer
- Needs site access
- WebSocket
- Audit:
terminal.connect
Path parameters
siteIdintegerrequired- Site id.
Query parameters
tokenstringrequired- The panel session JWT (browsers cannot set headers on WebSocket requests). URL-encode it.session JWT only; personal access tokens (orch_โฆ) are rejected
Errors
- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Forbidden: no access to this siteYour account has no access to this site.
- URL: wss://<panel-host>/api/terminal/{siteId}?token=<JWT> (ws:// on plain HTTP). nginx proxies /api/terminal/ with the Upgrade headers and a 3600 s read timeout.
- Client โ server messages: {"type": "input", "data": "<keystrokes>"} and {"type": "resize", "cols": 120, "rows": 30}. Other or malformed messages are ignored. The initial pty size is 120ร30.
- Server โ client messages: {"type": "output", "data": "<terminal output>"} and, when the shell exits, {"type": "exit", "exitCode": 0} followed by the socket closing.
- Auth/permission failures are not HTTP errors: the upgrade succeeds, the server sends one JSON message and closes. Messages: {"error": "Unauthorized"} (no token), {"error": "Invalid token"} (JWT verification failed, also for PATs), {"error": "Site not found"}, {"error": "Forbidden: no access to this site"} (non-admin without a site grant or allSitesAccess), {"error": "Forbidden: viewer role cannot use the terminal"}.
- Admins may open any site. Developers need a grant for the site (or allSitesAccess). Viewers are always refused.
- Audit: terminal.connect on open and terminal.disconnect on close (both with siteId and meta.domain).
- The shell gets a minimal environment (PATH, HOME, LANG, LC_ALL, USER, LOGNAME, SHELL, TZ, TERM=xterm-256color); the API's secrets are not inherited.
- The JWT in the query string can end up in proxy access logs.
// Browser only: WebSockets use the panel's login session, not personal access tokens.
const ws = new WebSocket(`wss://panel.example.com/api/terminal/12?token=${sessionToken}`);
ws.addEventListener('message', (event) => console.log(event.data));
ws.addEventListener('close', (event) => console.log('closed', event.code));{
"type": "output",
"data": "deploy@panel-01:/var/www/shop.example.com/current$ "
}