We are building a custom agent desktop wrapper using the .NET SDK. The requirement is to allow agents to transfer an active voice conversation to a specific support queue programmatically. We are trying to use the PATCH endpoint on the conversations API.
The call looks like this:
var patchBody = new PatchConversationRequest()
{
To = new ToResource()
{
Id = "queue-id-123",
Type = "queue"
}
};
await _client.ConversationsApi.PatchConversationAsync(conversationId, patchBody);
When we execute this, we get a 409 Conflict error. The response body says CONVERSATION_TRANSFER_IN_PROGRESS. We checked the conversation state and it is definitely active. The agent is not in the middle of another transfer. We have tried adding a TransferType of warm to the body but the result is the same.
Is the PATCH syntax correct for transferring to a queue? The documentation shows examples for transferring to users but the JSON structure seems consistent. We are using the latest version of the Genesys Cloud .NET SDK. The timezone is US/Pacific but that shouldn’t affect the API call itself. We need to get this working for the release next week.
The 409 Conflict usually means the conversation state isn’t compatible with the transfer action or the resource ID is invalid. Since you’re using the .NET SDK, make sure you’re using Transfer not To. The To property is for setting the target of an existing transfer, not initiating one.
Here’s the correct structure for initiating a transfer via the .NET SDK:
var patchBody = new PatchConversationRequest()
{
Actions = new List<PatchConversationAction>()
{
new PatchConversationAction()
{
Type = "transfer",
To = new ToResource()
{
Id = "queue-id-123", // Ensure this is a valid queue ID
Type = "queue"
}
}
}
};
try
{
var result = await _client.ConversationsApi.PostConversationsConversationIdPatch(
conversationId,
patchBody
);
}
catch (ApiException ex)
{
// Log the response body for debugging
Console.WriteLine($"Error: {ex.Message}");
Console.WriteLine($"Body: {ex.ResponseText}");
}
Key points to check:
- Use
Actions array with type transfer.
- Verify the
conversationId is active and not already in a transfer state.
- Ensure the queue ID exists and is routable.
- Check that the user making the call has
conversation:transfer permissions.
If you’re still getting 409, check the response body for the specific error message. It often contains a reason field like CONVERSATION_NOT_ACTIVE or TARGET_NOT_FOUND. You can also monitor the API calls via New Relic to trace the exact failure point.