My current config is completely failing…
I am attempting to update participant attributes mid-conversation using the Genesys Cloud Python SDK (genesys-cloud-sdk-configuration v2.0). Specifically, I need to push dynamic metadata from our Flask microservice into the Genesys Cloud participant record without ending the call.
The documentation for UpdateConversationCallParticipant states:
“Update a participant in a conversation. … You can update the participant’s attributes, state, and other properties.”
Here is the relevant snippet from my FastAPI endpoint:
from genesyscloud.conversations import ConversationApi
from genesyscloud.conversations.models import ConversationParticipantUpdate
async def update_participant_attr(conversation_id: str, participant_id: str):
api = ConversationApi(configuration=gen_config)
body = ConversationParticipantUpdate(
attributes={
"internal_ref": "order-12345",
"priority": "high"
}
)
try:
await api.post_conversations_participants_update(
conversation_id=conversation_id,
conversation_participant_update=body
)
except Exception as e:
logger.error(f"Update failed: {e}")
However, I consistently receive a 400 Bad Request response. The error payload is:
{
"message": "Invalid request body. Attribute 'internal_ref' is not a valid attribute for this participant type.",
"errors": [
{
"message": "Invalid attribute key."
}
]
}
I have verified that the conversation_id and participant_id are correct by logging them immediately after retrieving the active conversation. I am using the generic POST /api/v2/conversations/participants/update endpoint as suggested by the SDK model, but I suspect this might be the wrong endpoint for call-specific attributes.
Is there a specific endpoint like PATCH /api/v2/conversations/calls/{id}/participants/{id} that I should be using instead? The Python SDK documentation is sparse on the difference between generic conversation updates and call-specific participant updates. My environment is Python 3.11 running FastAPI 0.100 in Europe/Paris timezone.