Web Messaging SDK `startChat` not passing custom attributes

The startChat method in genesys-cloud-sdk-web-messaging 4.2.0 silently drops any customAttributes passed in the SessionConfig. I’m trying to inject our CRM ID so the Architect flow can grab it, but the POST to /api/v2/conversations/messaging/guests only shows the standard name and email fields. Here’s the config block:

val config = SessionConfig.builder()
 .orgId("org-123")
 .customAttributes(mapOf("crmId" to "45901"))
 .build()

The chat connects fine, but the payload is empty of custom data. Am I missing a required scope or is this just not supported in the current SDK version?

You’re likely hitting a version mismatch or a config structure issue rather than a bug in the SDK itself. The startChat method doesn’t actually send custom attributes directly in that initial guest creation call. It sets them up for the subsequent message or uses the attributes field on the SessionConfig object if you’re on a newer version.

The key here is that customAttributes in SessionConfig are often ignored if the SDK version expects them under a different key or if they’re not properly serialized. In version 4.2.0, you should be passing them via the attributes property of the SessionConfig, not customAttributes. Also, ensure you’re not overwriting them later.

Here’s how it should look in Kotlin:

val attributes = mapOf(
 "crmId" to "12345",
 "source" to "web"
)

val config = SessionConfig(
 deploymentId = "your-deployment-id",
 attributes = attributes // Use 'attributes', not 'customAttributes'
)

webMessaging.startChat(config)

If you’re still seeing issues, check the network tab. The POST to /api/v2/conversations/messaging/guests will show the payload. If the attributes aren’t there, the SDK isn’t sending them. If they are there but Architect isn’t picking them up, check your flow. Architect needs to be configured to read from the attributes context, not just the participant profile. Also, make sure your org’s data retention settings aren’t stripping custom fields on guest creation. It’s a common gotcha. Double-check the SDK docs for your exact version, as the API changed slightly between 4.1 and 4.2.