NICE Cognigy webhook payload structure for CXone dynamic intent routing

I am building a custom agent desktop extension using the Embeddable Client App SDK. The goal is to route conversations based on intent data coming from NICE Cognigy. I have the Cognigy instance set up to send a webhook to our internal API, which then pushes the intent to CXone via the Conversations API. The issue is the payload structure from Cognigy is not matching what I expect for the routing object in the CXone API call.

Here is the JSON payload I am receiving from Cognigy:

{
 "sessionId": "12345",
 "intent": {
 "name": "billing_inquiry",
 "score": 0.95
 },
 "entities": [
 {
 "type": "amount",
 "value": "500"
 }
 ]
}

I am trying to map this to the CXone putConversationRouting endpoint. The documentation says I need a routing object with a queue and priority. I am not sure how to map the Cognigy intent.name to the specific CXone queue ID dynamically. I have a mapping table in my code, but I am getting a 400 Bad Request error when I try to update the routing.

Here is the relevant part of my code:

const cognigyPayload = req.body;
const intentName = cognigyPayload.intent.name;

// Mapping logic
const queueMap = {
 'billing_inquiry': 'queue-123',
 'technical_support': 'queue-456'
};

const targetQueue = queueMap[intentName];

if (!targetQueue) {
 return res.status(400).send('Unknown intent');
}

// CXone API call
await fetch(`https://{{org_id}}.my.genesys.cloud/api/v2/conversations/${conversationId}/routing`, {
 method: 'PUT',
 headers: {
 'Authorization': 'Bearer {{access_token}}',
 'Content-Type': 'application/json'
 },
 body: JSON.stringify({
 routing: {
 queue: targetQueue,
 priority: 1
 }
 })
});

The error message from CXone is Invalid routing configuration. I am not sure if the queue field expects a full URI or just the ID. Also, I am not sure if I need to include the conversationId in the body or just the path. Any help would be appreciated.