List actions

List all event-driven actions attached to a script.


GET/api/scripts/{script}/actions

List all actions

Each action holds a trigger (e.g. server.booted), an optional delay, and the per-server install status. The servers array shows each pivot's install state:

  • pending — Ploi is installing the systemd unit on the server
  • installed — unit is in place and enabled
  • failed — install attempt failed; check last_error
  • uninstalling — Ploi is tearing the unit down

Request

GET
/api/scripts/{script}/actions
curl -X GET "https://ploi.io/api/scripts/{script}/actions" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Response

{
  "data": [
    {
      "id": 1,
      "script_id": 42,
      "trigger": "server.booted",
      "trigger_label": "Server has booted",
      "delay_seconds": 30,
      "is_paused": false,
      "last_triggered_at": "2026-05-13T08:42:11+00:00",
      "servers": [
        {
          "server_id": 12,
          "status": "installed",
          "installed_at": "2026-05-12T10:11:30+00:00",
          "last_error": null
        }
      ],
      "created_at": "2026-05-12 10:11:22",
      "updated_at": "2026-05-13 08:42:11"
    }
  ]
}