Trying to understand why my attempt to programmatically create an Agent Script via the Genesys Cloud API is failing with a 400 Bad Request, specifically citing a JSON schema violation in the blocks array.
Context: We are migrating from Zendesk, where macros were essentially flat JSON objects containing a series of actions (add tag, set status, send email). In Zendesk, the structure was forgiving; if a field was missing, it often defaulted or ignored the step. In Genesys Cloud, the Agent Scripting API (POST /api/v2/interaction-scripts) seems to enforce a strict hierarchical block structure.
I am trying to replicate a simple Zendesk macro that adds a specific tag and changes the interaction status. I have mapped this to a set-tags block and a set-status block within the script definition. However, when I send the payload, I get the following error:
Error: 400 Bad Request. Message: Invalid request body. Path: $.blocks[0].id. Error: must be a string of type 'uuid'
Here is the relevant snippet of my payload:
{
"name": "Migration Test Script",
"description": "Replaces Zendesk Macro #102",
"blocks": [
{
"id": "step-1",
"type": "set-tags",
"data": {
"tags": ["migration-test"]
}
}
]
}
In Zendesk, we didn’t need to manually generate UUIDs for each macro step; the platform handled the internal IDs. It seems Genesys Cloud requires explicit UUIDs for every block in the script definition, which is a significant structural change from what we are used to.
Is there a specific format or generator I should be using for these block IDs? Also, are there any known limitations when converting complex conditional macros from Zendesk into GC’s block-based scripting model? The documentation mentions blocks but doesn’t explicitly state that every single step needs a pre-generated UUID before submission. This feels like a hidden requirement that is slowing down our bulk migration scripts.