Trying to push a CRM ID into the conversation context via the Web Messaging SDK. The payload looks right in the console, but the customAttributes are missing from the resulting conversation object in Genesys Cloud.
const chatOptions = {
customAttributes: {
crmId: 'CUST-99283'
}
};
await guest.startChat(chatOptions);
Checked the network tab and the POST to /v2/conversations/messaging includes the attribute, but it’s gone by the time the agent sees it. Am I missing a specific config flag to allow custom attributes on start?
Check your Web Messaging channel configuration in the Genesys Cloud admin portal. The most common reason customAttributes vanish is that the channel isn’t explicitly configured to accept them, or the SDK version you’re using has a quirk with how it serializes nested objects before sending.
The startChat method expects the payload to be flattened in specific versions of the guest SDK. If you’re on an older build, try passing the attributes directly in the guest details instead of the options object.
const guestProfile = {
name: 'Test User',
email: 'test@example.com',
customAttributes: {
crmId: 'CUST-99283'
}
};
await guest.startChat({
guest: guestProfile
});
Also verify the scope on your OAuth token. You need messaging:write and messaging:read at minimum. If the token is scoped too tightly, the API might silently strip unknown fields. Check the response headers for any 403 or 401 hints that might get buried in the success callback.