We’re building a custom React wrapper around the Genesys Cloud Web Messaging SDK. The requirement is to pass our internal CRM customerId into the conversation metadata so our agents can see it immediately in the CAD.
I’m using the startChat method with the guestAttributes object. Here’s the initialization code:
const startChat = async () => {
try {
const response = await genesysCloudMessaging.startChat({
deploymentId: 'our-deployment-id',
guestAttributes: {
customerId: 'CRM-12345',
source: 'portal'
}
});
console.log('Chat started:', response);
} catch (error) {
console.error('Failed to start chat', error);
}
};
The chat connects fine. I get a 200 OK from the SDK call. The agent receives the chat. But when I look at the conversation JSON via the /api/v2/conversations/messaging endpoint, the guestAttributes field is empty. It’s just {}.
I’ve checked the deployment settings in Genesys Cloud admin. The custom attribute customerId is defined there. It’s marked as available for guests. I’ve also tried using the setGuestAttributes method after the chat starts, but that throws a 403 Forbidden error saying the attribute is read-only or not allowed for updates mid-session.
Is there a specific config flag I’m missing? Or does startChat ignore guestAttributes unless the deployment is configured to allow them at creation time? I’ve looked at the SDK docs, but they’re pretty light on examples for this specific flow.
We’ve tried logging the raw request payload in the network tab, and the customerId is definitely being sent in the initial POST request to the messaging gateway. So the issue seems to be on the Genesys side filtering it out, or the SDK isn’t mapping it correctly to the conversation resource.
Any ideas on what’s blocking this? I’ve spent the morning digging through the API reference and haven’t found a clear answer on whether custom attributes are allowed in the startChat payload by default. It feels like a deployment setting, but I can’t find it in the UI.