Updating participant attributes mid-call returns 400 Bad Request

I’m trying to update a participant’s attributes during an active voice conversation using the Conversations API. We need to push updated CRM data to the agent’s screen while they are on the line. I’m using the PATCH endpoint for this.

Here is the code I’m using in Node.js:

const response = await fetch(
 `https://${orgUrl}/api/v2/conversations/voice/${conversationId}/participants/${participantId}/attributes`,
 {
 method: 'PATCH',
 headers: {
 'Authorization': `Bearer ${token}`,
 'Content-Type': 'application/json'
 },
 body: JSON.stringify({
 "customerName": "John Doe",
 "accountType": "Premium"
 })
 }
);

The request comes back with a 400 Bad Request. The error message says Invalid attribute key. I’ve checked the docs and it says we can set custom attributes. Is there a specific naming convention I’m missing? I thought any string key was fine.

Also, the conversation is definitely active. I can see it in the real-time dashboard. It seems like the API expects a different structure for the body. I tried wrapping it in an attributes object but that didn’t help either. What am I doing wrong here?