Mapping Zendesk Macros to GC Agent Scripting: Unexpected JSON Schema Validation Error

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.

Have you tried validating the blocks array structure against the Genesys Cloud Agent Script API schema? The 400 error typically stems from missing required fields within the block objects, such as type or id, which are strictly enforced in GC unlike the more forgiving Zendesk macro structure. Each block must be a complete object with a unique identifier and a defined type, such as text or action. If you are mapping Zendesk actions directly, ensure that every step in your JSON payload includes these mandatory attributes. The API does not infer defaults for missing schema elements, so a partial block definition will immediately trigger a validation failure.

Check the specific error message in the response body, as it usually points to the exact index and field causing the issue. A common oversight is failing to wrap the blocks in the correct container object or omitting the content field for text blocks. Reviewing the official Genesys Cloud documentation for the Agent Script creation endpoint will clarify the exact JSON structure required. Ensure that your ServiceNow Data Action or script generating the payload is correctly formatting each block before sending the POST request to the GC API.

I normally fix this by ensuring every block in the payload includes a unique id field, which is mandatory in Genesys Cloud schemas. The Zendesk migration often strips these identifiers. Verify your JSON matches this strict structure before sending:

{
 "type": "text",
 "id": "unique-block-id-123",
 "content": "Enter text here"
}