Get script execution

Poll the status and output of a one-off script execution.


GET/api/servers/{server}/scripts/run/{execution}

Get a script execution

Returns the state of a one-off script execution started with the run one-off script endpoint. The status moves from pending to running and ends in finished (with the script's exit code) or failed (when the script could not be run at all, for example because the server was unreachable).

The execution state expires an hour after the run completes, after that this endpoint returns a 404. The output remains available in the server logs.

Request

GET
/api/servers/{server}/scripts/run/{execution}
curl "https://ploi.io/api/servers/{server}/scripts/run/{execution}" \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"

Response

{
  "data": {
    "id": "3f4c9e9a-8b4e-4f0e-9d3b-2f6f2c1a7d42",
    "server_id": 1,
    "user": "deployer",
    "content": "npm install -g pm2",
    "status": "finished",
    "exit_code": 0,
    "output": "added 1 package in 4s",
    "created_at": "2026-08-14T15:03:12+00:00",
    "started_at": "2026-08-14T15:03:14+00:00",
    "finished_at": "2026-08-14T15:03:19+00:00"
  }
}