Getting a 400 Bad Request when trying to initiate an outbound call on behalf of an agent. The payload looks standard, but the error message is vague: Validation failed for object 'conversation'. List of failures: 'agentId' must be a valid agent ID.
Here’s the JSON body I’m sending:
{
"to": [{"phoneNumber": "+61298765432"}],
"from": {"phoneNumber": "+61212345678"},
"agentId": "5f9c8b7a-1234-5678-9abc-def012345678",
"type": "voice"
}
I’ve double-checked the agentId against /api/v2/users/me and it matches exactly. The agent is currently online and set to ‘Available’. I’m using a service account token with conversation:read and conversation:write scopes.
Tried swapping the token for a user token with the same result. The endpoint is definitely POST /api/v2/conversations/calls. Is there a specific permission on the user profile or routing profile that blocks API-initiated calls? Or is the agentId format different for this endpoint than the user ID?
Checked the debug logs on the Genesys side. Nothing jumps out. Just the validation failure.