From 6f6f63171cd0e80503e93565b087c10d5e7319d3 Mon Sep 17 00:00:00 2001 From: bk-ty Date: Thu, 9 Apr 2026 10:55:55 -0500 Subject: [PATCH] Fix: Add 'suspend' to API action type validation The suspend action type is handled correctly at runtime by runJobAction_suspend() in lib/action.js, but the API input validation in validateActionData() rejects it as an unknown type. This prevents creating or updating events with suspend actions via the API (create_event/v1, update_event/v1), even though they work perfectly when configured through the UI. Adds 'suspend' to the recognized action types in the validation switch statement alongside the other types (email, web_hook, run_event, channel, plugin, etc.). Signed-off-by: bk-ty --- lib/api.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/api.js b/lib/api.js index 7be964b5..90eaf13e 100644 --- a/lib/api.js +++ b/lib/api.js @@ -465,13 +465,17 @@ class API { // no options break; - case 'plugin': - if (!action.plugin_id || !action.plugin_id.toString().match(/^\w+$/)) { - return this.doError('api', err_prefix + ": Invalid Plugin ID.", callback); - } - break; - - default: + case 'plugin': + if (!action.plugin_id || !action.plugin_id.toString().match(/^\w+$/)) { + return this.doError('api', err_prefix + ": Invalid Plugin ID.", callback); + } + break; + + case 'suspend': + // suspend action - pauses job for manual approval + break; + + default: return this.doError('api', err_prefix + ": Unknown type", callback); break; } // switch item.type