Execute command
- POST
- /workspaces
- /:workspace
- /targets
- /:target_id
- /execs
Execute a command against the target. The command kind is determined by the target type; currently supports MySQL targets only (command carries the SQL).
Examples
Example: MySQL execution request
curl -X POST "https://api.buddy.works/workspaces/:workspace/targets/:target_id/execs" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"command": "SELECT 1 AS ok, NOW() AS ts"
}'Example: SSH execution request
curl -X POST "https://api.buddy.works/workspaces/:workspace/targets/:target_id/execs" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"command": "uptime"
}'EXAMPLE RESPONSE{ "url": "https://api.buddy.works/workspaces/my-workspace/targets/execs/9214386e-7633-4d2b-ac66-fcfbaf5ea99b", "log_url": "https://api.buddy.works/workspaces/my-workspace/targets/execs/9214386e-7633-4d2b-ac66-fcfbaf5ea99b/log", "execution_id": "9214386e-7633-4d2b-ac66-fcfbaf5ea99b", "target_id": "tg-b185vd3ct4chv", "target_type": "MYSQL", "invoker": { "url": "https://api.buddy.works/workspaces/my-workspace/members/1", "id": 1, "name": "John Doe" }, "command": "mysql sql=SELECT 1 AS ok, NOW() AS ts", "started_at": "2026-05-28T08:00:09.820Z", "status": "INPROGRESS" }
STATUS200 Execution accepted and started; row carries `status: RUNNING` until poll endpoints flip to terminal