CXone Studio Session Handover 400 Error with Cognigy

Trying to hand over a session from Cognigy to Studio. The bot sends the handover payload, but the Studio flow returns a 400 Bad Request. The JSON looks valid, but Studio rejects the sessionId field. Here’s the payload the bot sends:

{
 "sessionId": "abc-123",
 "metadata": { "intent": "billing" }
}

The Studio script uses a REST proxy to fetch the session data, but the lookup fails. Is there a specific format for the sessionId in the handover webhook? The docs are vague on this.

The 400 usually hits because Studio expects the sessionId to match the internal Conversation ID format, not an arbitrary string like “abc-123”. Cognigy needs to send the actual CXone conversation ID if you’re using the native integration, or you need to map that external ID into a Studio variable before the lookup.

If you’re doing a custom REST Proxy handover, the payload structure matters. Studio’s REST action doesn’t just take raw JSON from the bot. It needs the headers and body defined explicitly in the script configuration.

Check your REST Proxy action in Studio. The body shouldn’t be a raw string. It needs to be a template referencing the incoming data.

{
 "sessionId": "{{context.sessionId}}",
 "metadata": {
 "intent": "{{context.metadata.intent}}"
 }
}

Also, make sure the Content-Type header is set to application/json. If Cognigy sends it without the header, Studio might try to parse it as form data and fail on the JSON structure.

If the sessionId is truly external, you can’t use it for a direct conversation lookup. You’d need to store that ID in a custom attribute on the contact or user object first, then query that attribute. Studio doesn’t index arbitrary session IDs passed in the body for quick retrieval unless you’ve built that logic into your flow.

Double-check the endpoint you’re hitting. If it’s /api/v2/conversations/webchat, the sessionId must be the CXone generated one. If you’re hitting a custom webhook, ensure the receiving script handles the 400 by logging the exact error message in the Studio trace. The “Bad Request” is generic, but the trace log will tell you if it’s a schema mismatch or a missing required field.