Trying to set a custom attribute mid-call via the Conversations API. Sending a PATCH request to /api/v2/conversations/conversations/{id} with this body:
{
"participants": [{
"id": "123",
"attributes": {"priority": "high"}
}]
}
Getting a 400 Bad Request. The docs say participant attributes are mutable, but the response just says ‘Validation failed’. Am I missing a specific header or is the payload structure wrong for mid-conversation updates?
The issue is the ID type. The participants array in the request body expects the participant id to be the participant ID generated by the system, not the conversation ID or some other identifier. Also, the payload structure for setting attributes is slightly different.
Here is the correct payload structure:
{
"participants": [
{
"id": "actual-participant-id-from-get-conversation",
"attributes": {
"priority": "high"
}
}
]
}
You need to first GET the conversation to retrieve the specific id of the participant you want to update. That ID is a long string, usually starting with something like conv-part-....
Also, ensure your OAuth token includes the conversations:write scope. If you’re doing this from Studio, use the REST Proxy action. Set the method to PATCH, the URL to /api/v2/conversations/conversations/{conversationId}, and pass the JSON above. Make sure the Content-Type header is application/json.
If you’re still getting a 400, check the response body for specific field validation errors. Sometimes the API complains about missing required fields if you’re not careful.