Skip to content

Fix: Add 'suspend' to API action type validation#1

Open
bk-ty wants to merge 1 commit intomainfrom
fix/api-suspend-action-validation
Open

Fix: Add 'suspend' to API action type validation#1
bk-ty wants to merge 1 commit intomainfrom
fix/api-suspend-action-validation

Conversation

@bk-ty
Copy link
Copy Markdown
Owner

@bk-ty bk-ty commented Apr 9, 2026

Summary

The suspend action type is fully supported at runtime (runJobAction_suspend() in lib/action.js), but the API input validation in validateActionData() (lib/api.js) 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 correctly when configured through the UI.

Changes

  • Added case 'suspend': to the action type validation switch in lib/api.js, alongside the other recognized types (email, web_hook, run_event, channel, plugin, disable, delete, etc.)

Reproduction

  1. Create an event with a suspend action via the API:
curl -X POST http://localhost:3012/api/app/create_event/v1 \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"title":"Test","enabled":true,"category":"general","targets":["main"],"plugin":"shellplug","params":{"script":"echo hi"},"actions":[{"type":"suspend","condition":"start","enabled":true}]}'
  1. Before fix: Returns "Unknown type" error
  2. After fix: Event creates successfully; suspend action works as expected at runtime

Intended for upstream PR to pixlcore/xyops

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 <brandon.kiefer@tylertech.com>
@bk-ty bk-ty force-pushed the fix/api-suspend-action-validation branch from e9f4709 to 6f6f631 Compare April 9, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant