Updating participant attributes mid-call with /api/v2/interactions: 409 conflict on version?

Trying to push custom attributes to a participant while a voice conversation is active. I’m using the Genesys Cloud JS SDK (genesys-cloud-node-sdk) and hitting a wall with version conflicts.

The goal is to update the participant_attributes field without disrupting the call. I’m fetching the current interaction via interactionsApi.getInteractionsInteraction(interactionId), updating the payload, and sending it back with interactionsApi.updateInteractionsInteraction.

Here’s the flow:

const interaction = await client.platformClient.interactions.getInteractionsInteraction(interactionId);
const participant = interaction.participants.find(p => p.id === participantId);

participant.attributes = {
 ...participant.attributes,
 customFlag: 'updated'
};

// Attempt to update
try {
 await client.platformClient.interactions.updateInteractionsInteraction(interactionId, interaction);
} catch (err) {
 console.error('Update failed:', err.response.status, err.response.data);
}

I get a 409 Conflict every time. The error body says:

{"errors":[{"message":"The entity version provided does not match the current version"}]}

I thought passing the whole object back would handle the versioning, but clearly not. Is there a specific header I need to set? Or is there a partial update endpoint for participant attributes that doesn’t require the full interaction payload? I’ve checked the docs and only see the full interaction update.

Also, this is happening in a webhook handler, so latency is tight. Fetching then updating feels heavy. Is there a lighter way?

The docs state: “The version field must match the current resource version to prevent concurrent modification conflicts.” You’re likely sending a stale version number. Fetch the interaction again right before updating to get the fresh version, or just use the PATCH endpoint with If-Match: * to bypass the check entirely.