Custom Zapier trigger failing on POST /api/v2/processautomation/triggers

Hi all,

Trying to build a custom trigger in Zapier CLI to automate some process automation tasks. The OAuth2 flow is working fine, but creating the trigger keeps failing. It took like 2 hrs to debug the payload and it still won’t go through.

“Create a Trigger”
POST /api/v2/processautomation/triggers

The request looks correct but the API returns a 400 Bad Request.

{
 "name": "Zapier_Event_Trigger",
 "event": "conversation.closed",
 "condition": "conversation.duration > 60"
}

Here is the setup:

  • Environment: Genesys Cloud (London region)
  • Tooling: Zapier CLI v1.4.2
  • Method: Custom polling trigger
  • Auth: Client Credentials grant

I tried to verify the trigger ID using GET /api/v2/processautomation/triggers/{triggerId} after a manual creation in the UI, but that works. The problem is only when the Zapier app tries to push the config.

edit: checked the logs and there is no specific error message in the body, just the 400 code. Tried changing the condition to a simple string, still nothing.

{
 "name": "ZapierTrigger",
 "topicName": "Conversation.ConversationUpdate",
 "enabled": true,
 "condition": "{\"expression\": \"$.state == 'DISCONNECTED'\"}"
}

The 400 error is usually because condition field must be stringified JSON, not a nested object. In the SDK genesyscloud/models/process_automation_trigger.py, the schema expects a string for the condition logic. If you send a JSON object directly, the API gateway rejects it.

Steps to repro:

  1. Use POST /api/v2/processautomation/triggers
  2. Pass condition as object { "expression": "..." }
  3. Get 400 Bad Request.

Workaround is to use json.dumps() for the condition value before sending request. It is small thing but causes much trouble. I have a screenshot of the correct payload in my local notes showing the escaped quotes. Try this change and it should work.

1 Like

The condition field must be stringified JSON

That worked. I stringified the object and the 400 error is gone.