Guest API 400 Error: Custom Attributes in Web Messaging Widget Initialization

What is the reason the /api/v2/engage/guests endpoint returns a 400 Bad Request when I attempt to pass custom attributes during the initial widget configuration for authenticated users?

The Terraform configuration for the widget is valid, and the OAuth token used in the CI pipeline has the necessary permissions. However, the payload below fails validation immediately upon submission.

{
 "customAttributes": {
 "userId": "12345",
 "role": "admin"
 }
}

The error response indicates a schema mismatch, yet the documentation suggests this structure is acceptable for pre-identification. Is there a specific constraint on the attribute keys or values that I am missing?

Depends on your setup, but generally the Guest API strictly prohibits customAttributes in the initial POST request to prevent pre-validation injection. You must omit that field during creation and apply attributes via the PUT /api/v2/conversations/webchat/participants/{participantId} endpoint post-session. See the payload constraints here: https://developer.genesys.cloud/api/conversations/webchat/guests.