Execute Command
Run a one-shot shell command as the webspace's unprivileged system user (ws_<slug>). Working directory is ~/. Cgroup limits apply.
Run a one-shot shell command as the webspace's unprivileged system user (ws_<slug>). Working directory is ~/. Cgroup limits apply.
Required scope: webspace:manage
| Header | Required | Value |
|---|---|---|
Authorization |
Yes | Bearer YOUR_API_KEY |
Content-Type |
Yes | application/json |
| Parameter | Required | Description |
|---|---|---|
command |
Yes | Shell command (max 8192 chars). |
timeout |
No | Timeout in seconds (1–300, default 30). |
{
"data": {
"exitCode": 0,
"stdout": "Linux node-bf015 6.6.20-cloud-amd64 ...\n",
"stderr": "",
"durationMs": 142,
"truncated": false
}
}
| Field | Type | Description |
|---|---|---|
truncated |
boolean | true if stdout/stderr was capped at 2 MB. |
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_COMMAND |
command is missing or not a string. |
| 400 | COMMAND_TOO_LONG |
Command exceeds 8192 characters. |
| 408 | COMMAND_TIMEOUT |
Command exceeded the requested timeout. |
| 502 | SSH_CONN_ERROR |
Could not connect to the webspace node. |
curl -X POST https://hosting.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 }'
This action is also available via the webspace_exec MCP tool.