Quick question about updating conversation participant attributes in real-time. I have a Deno Deploy worker listening to Genesys Cloud webhooks for conversation:updated events. When a specific condition is met during an active voice call, I need to push a new attribute into the participant’s data object. I’m using the standard fetch API to hit the PATCH endpoint for the participant resource. The request seems to form correctly, but I keep hitting a 400 Bad Request error with a validation failure on the body. Here is the minimal reproducible code I’m running:
const response = await fetch(
`https://api.mypurecloud.com/api/v2/conversations/${convId}/participants/${partId}`,
{
method: 'PATCH',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
attributes: {
...participant.attributes,
externalRef: 'new-value-123'
}
})
}
);
The error response indicates that the attributes object is malformed or missing required fields, but I’m just spreading the existing ones and adding a string. Is there a specific schema requirement for patching attributes on voice participants that differs from web chat? Or am I missing a required field like selfUri or routingData in the patch payload?