Toggle action

Pause or resume an action.


POST/api/scripts/{script}/actions/{action}/toggle

Toggle an action

Flips the action's pause state. The systemd units stay installed on each server — Ploi just no-ops the webhook when the trigger fires, so the script won't actually run. Use this when you want to silence an action temporarily without losing its install state.

Request

POST
/api/scripts/{script}/actions/{action}/toggle
curl -X POST "https://ploi.io/api/scripts/{script}/actions/{action}/toggle" \
  -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": true,
    "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 09:10:00"
  }
}