400 Bad Request
{
"errors": [
"Text must be specified."
]
}
Trying to inject a canned response into an active chat session using the Conversations API. The goal is to trigger this from an external service while maintaining our OpenTelemetry span context across the call.
Using the endpoint POST /api/v2/conversations/message/{conversationId}/messages.
The payload looks like this:
{
"text": "{{cannedResponse.text}}",
"type": "text",
"to": {
"id": "{{agentId}}",
"type": "user"
}
}
The canned response object is fetched separately via /api/v2/users/{userId}/cannedresponses. The {{cannedResponse.text}} resolves to a valid string like “Thanks for reaching out!”.
The 400 error persists even when hardcoding the text directly in the JSON body instead of using the template variable. Tried swapping type to canned but that field doesn’t seem to exist in the schema.
Checked the documentation for ConversationMessageRequest but it’s vague on canned response specifics. Is there a specific flag or different endpoint needed to send a canned response programmatically?
Using Python SDK version 2.0.1.