Dealing with a very strange bug here with the Workforce Engagement Management (WEM) API when attempting to push agent availability updates via a Genesys Cloud Architect Data Action. The integration is designed to sync break schedules from ServiceNow to Genesys, ensuring that agents marked as ‘On Break’ in the ticketing system are reflected as unavailable in the WEM scheduler.
Context:
The environment is a multi-tenant Genesys Cloud instance (EU-1 region) with WEM enabled. The integration uses a Data Action configured to send a POST request to /api/v2/wem/schedules/agents/{agentId}/availability. The payload is constructed dynamically using JSONata expressions within the Architect flow. The ServiceNow side is returning the expected JSON structure, and the Data Action logs confirm the payload is being passed correctly to the Genesys endpoint.
However, the Genesys API is consistently returning a 500 Internal Server Error with the following response body:
{
"errors": [
{
"code": "INVALID_REQUEST_BODY",
"message": "The request body is malformed or contains invalid data for the specified endpoint."
}
]
}
I have validated the payload against the Swagger documentation for the WEM API. The startTime and endTime fields are in ISO 8601 format with timezone offsets (e.g., 2023-10-27T14:00:00+00:00). The reason field is a valid string. The agent ID is correct and exists in the system. I have also attempted to simplify the payload to include only the mandatory fields, but the 500 error persists.
Question:
Is there a known issue with the WEM availability endpoint rejecting valid ISO 8601 timestamps when sent via Data Actions? Or is there a specific schema validation rule for the reason field that is not documented? I have checked the recent release notes and the community forums, but have not found any references to this specific error code in the context of WEM availability updates. Any insights or workarounds would be greatly appreciated.