Webspace-API: SSH, Befehle und Dateien
Befehle ausführen, SSH-Schlüssel verwalten und per SFTP mit den Dateien deines Webspace arbeiten, über die Sitequest REST-API.
Befehle ausführen, SSH-Schlüssel verwalten und per SFTP mit den Dateien deines Webspace arbeiten, über die Sitequest REST-API.
Einmaligen Shell-Befehl als unprivilegierter System-User (ws_<slug>) ausführen. CWD = ~/. Cgroup-Limits greifen.
Erforderlicher Scope: webspace:exec
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
command |
Ja | Shell-Befehl (max. 8192 Zeichen). |
timeout |
Nein | Timeout in Sekunden (1–300, Standard 60). |
{
"data": {
"exitCode": 0,
"stdout": "Linux node-bf015 6.6.20-cloud-amd64 ...\n",
"stderr": "",
"durationMs": 142,
"truncated": false
}
}
| Feld | Typ | Beschreibung |
|---|---|---|
truncated |
boolean | true, wenn stdout bei 32 MB oder stderr bei 256 KB abgeschnitten wurde. |
| Status | Code | Beschreibung |
|---|---|---|
| 400 | INVALID_COMMAND |
command fehlt oder ist kein String. |
| 400 | COMMAND_TOO_LONG |
Befehl überschreitet 8192 Zeichen. |
| 408 | COMMAND_TIMEOUT |
Befehl hat das Timeout überschritten. |
| 502 | SSH_CONN_ERROR |
Verbindung zum Webspace-Node fehlgeschlagen. |
curl -X POST https://site.quest/api/v1/webspaces/69e80ac1.../exec \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "command": "ls -la public_html", "timeout": 10 }'
Diese Aktion ist auch über das webspace_exec MCP-Tool verfügbar.
SSH-Public-Keys in ~/.ssh/authorized_keys auflisten. Enthält den Panel-Schlüssel für das Web-Terminal.
Erforderlicher Scope: webspace:read
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
{
"data": [
{
"id": "sha256-hQ0YFLi6TKgF3E9pn-lcUxVLx1VjSQwc",
"type": "ssh-ed25519",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5...",
"comment": "root@node-bf015.sitequest.eu"
}
]
}
| Feld | Typ | Beschreibung |
|---|---|---|
id |
string | SHA-256-Fingerprint (URL-safe). Wird als keyId beim Löschen verwendet. |
curl https://site.quest/api/v1/webspaces/69e80ac1.../ssh-keys \
-H "Authorization: Bearer sq_live_..."
Diese Aktion ist auch über das webspace_list_ssh_keys MCP-Tool verfügbar.
SSH-Public-Key zu authorized_keys hinzufügen. Unterstützt ssh-ed25519, ssh-rsa und ecdsa-*.
Erforderlicher Scope: webspace:exec
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
publicKey |
Ja | Vollständige Public-Key-Zeile (ssh-ed25519 AAA…). |
comment |
Nein | Optionales Label (Standard: Kommentar aus dem Key). |
{
"data": {
"id": "sha256-hQ0YFLi6TKgF...",
"type": "ssh-ed25519",
"publicKey": "ssh-ed25519 AAAA...",
"comment": "my-laptop"
}
}
| Status | Code | Beschreibung |
|---|---|---|
| 400 | MISSING_PUBLIC_KEY |
publicKey fehlt. |
| 400 | INVALID_PUBLIC_KEY |
Public-Key konnte nicht verarbeitet werden. |
curl -X POST https://site.quest/api/v1/webspaces/69e80ac1.../ssh-keys \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "publicKey": "ssh-ed25519 AAAA... my-laptop", "comment": "my-laptop" }'
Diese Aktion ist auch über das webspace_add_ssh_key MCP-Tool verfügbar.
SSH-Key per Fingerprint-ID entfernen. Der Web-Terminal-Key kann nicht gelöscht werden.
Erforderlicher Scope: webspace:manage
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
{ "data": { "id": "sha256-hQ0YFLi6TKgF...", "deleted": true } }
| Status | Code | Beschreibung |
|---|---|---|
| 404 | KEY_NOT_FOUND |
Key-ID nicht in authorized_keys gefunden. |
curl -X DELETE https://site.quest/api/v1/webspaces/69e80ac1.../ssh-keys/sha256-hQ0... \
-H "Authorization: Bearer sq_live_..."
Diese Aktion ist auch über das webspace_delete_ssh_key MCP-Tool verfügbar.
Verzeichnisinhalt unterhalb des Webspace-Homes (~/) auflisten. Alle Pfade werden gegen die Jail-Root validiert.
Erforderlicher Scope: webspace:files
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/ (z. B. /home/ws_xxx/public_html). |
{
"data": {
"path": "/home/ws_0862c/public_html",
"entries": [
{ "name": "index.html", "isDirectory": false, "size": 256, "modifiedAt": "2026-04-22T12:34:56+0000" },
{ "name": "assets", "isDirectory": true, "size": 4096, "modifiedAt": "2026-04-22T12:30:00+0000" }
]
}
}
| Status | Code | Beschreibung |
|---|---|---|
| 400 | PATH_OUTSIDE_JAIL |
Pfad verlässt das Webspace-Home. |
curl "https://site.quest/api/v1/webspaces/69e80ac1.../sftp/list?path=/home/ws_0862c/public_html" \
-H "Authorization: Bearer sq_live_..."
Diese Aktion ist auch über das webspace_list_files MCP-Tool verfügbar.
Datei aus dem Webspace-Home lesen. Max. 32 MB.
Erforderlicher Scope: webspace:files
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/. |
encoding |
Nein | utf8 (Standard) oder base64. |
{
"data": {
"path": "/home/ws_0862c/public_html/index.html",
"content": "<!doctype html><html>...</html>",
"encoding": "utf8",
"size": 256
}
}
| Status | Code | Beschreibung |
|---|---|---|
| 404 | FILE_NOT_FOUND |
Datei existiert nicht. |
| 413 | FILE_TOO_LARGE |
Datei überschreitet 32 MB. |
curl "https://site.quest/api/v1/webspaces/69e80ac1.../sftp/read?path=/home/ws_0862c/public_html/index.html" \
-H "Authorization: Bearer sq_live_..."
Diese Aktion ist auch über das webspace_read_file MCP-Tool verfügbar.
Inhalt in eine Datei im Webspace-Home schreiben. Übergeordnete Verzeichnisse werden erstellt. Max. 32 MB.
Erforderlicher Scope: webspace:exec
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/. |
content |
Ja | Dateiinhalt (String). |
encoding |
Nein | utf8 (Standard) oder base64. |
{ "data": { "path": "/home/ws_0862c/public_html/index.html", "size": 256 } }
| Status | Code | Beschreibung |
|---|---|---|
| 400 | MISSING_CONTENT |
content fehlt oder ist kein String. |
| 413 | CONTENT_TOO_LARGE |
Inhalt überschreitet 32 MB. |
curl -X PUT https://site.quest/api/v1/webspaces/69e80ac1.../sftp/write \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "path": "/home/ws_0862c/public_html/hello.txt", "content": "Hello World!" }'
Diese Aktion ist auch über das webspace_write_file MCP-Tool verfügbar.
Datei oder Verzeichnis im Webspace-Home löschen. Das Home selbst kann nicht gelöscht werden.
Erforderlicher Scope: webspace:manage
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/. |
recursive |
Nein | Bei true werden Verzeichnisse rekursiv gelöscht (rm -rf). |
{ "data": { "path": "/home/ws_0862c/old", "deleted": true, "recursive": true } }
| Status | Code | Beschreibung |
|---|---|---|
| 403 | HOME_DIR_PROTECTED |
Webspace-Home kann nicht gelöscht werden. |
curl -X DELETE https://site.quest/api/v1/webspaces/69e80ac1.../sftp/delete \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "path": "/home/ws_0862c/old", "recursive": true }'
Diese Aktion ist auch über das webspace_delete_path MCP-Tool verfügbar.
Datei/Verzeichnis im Webspace-Home umbenennen oder verschieben. Sowohl from als auch to müssen innerhalb ~/ liegen.
Erforderlicher Scope: webspace:exec
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
from |
Ja | Quellpfad. |
to |
Ja | Zielpfad. |
{ "data": { "from": "/home/ws_0862c/a.txt", "to": "/home/ws_0862c/b.txt", "renamed": true } }
curl -X POST https://site.quest/api/v1/webspaces/69e80ac1.../sftp/rename \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "from": "/home/ws_0862c/a.txt", "to": "/home/ws_0862c/b.txt" }'
Diese Aktion ist auch über das webspace_rename MCP-Tool verfügbar.
Verzeichnis im Webspace-Home erstellen.
Erforderlicher Scope: webspace:manage
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/. |
recursive |
Nein | Standard true (mkdir -p). false setzen, um bei fehlenden Eltern zu scheitern. |
{ "data": { "path": "/home/ws_0862c/uploads", "created": true, "recursive": true } }
curl -X POST https://site.quest/api/v1/webspaces/69e80ac1.../sftp/mkdir \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "path": "/home/ws_0862c/uploads" }'
Diese Aktion ist auch über das webspace_mkdir MCP-Tool verfügbar.
Rechte einer Datei oder eines Verzeichnisses im Webspace-Home ändern.
Erforderlicher Scope: webspace:exec
| Header | Erforderlich | Wert |
|---|---|---|
Authorization |
Ja | Bearer DEIN_API_SCHLÜSSEL |
Content-Type |
Ja | application/json |
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
path |
Ja | Absoluter Pfad innerhalb ~/. |
mode |
Ja | Oktal-String ("0755") oder Dezimalwert (0–4095). |
{ "data": { "path": "/home/ws_0862c/public_html/index.php", "mode": "0644" } }
| Status | Code | Beschreibung |
|---|---|---|
| 400 | INVALID_MODE |
mode ist kein gültiger Oktal-String oder Dezimalwert. |
curl -X POST https://site.quest/api/v1/webspaces/69e80ac1.../sftp/chmod \
-H "Authorization: Bearer sq_live_..." \
-H "Content-Type: application/json" \
-d '{ "path": "/home/ws_0862c/public_html/index.php", "mode": "0644" }'
Diese Aktion ist auch über das webspace_chmod MCP-Tool verfügbar.