Injecting canned responses into active webchat via Conversations API v2

Could someone explain the exact payload structure required to push a canned response into an active webchat session using the Genesys Cloud Conversations API? I have a Next.js backend service that manages agent assist workflows, and I need to programmatically inject predefined messages into a live webchat conversation without breaking the message sequence. I am currently routing requests through a server component that authenticates via a cached Bearer token in middleware, then forwards the call to /api/v2/conversations/messages. The request targets the correct conversationId and sets the to field to the customer participant ID. However, the platform consistently returns a 400 Bad Request with a validation error stating that the type field does not match expected schema constraints for canned content.

Here is the current implementation using the genesys-cloud-platform-client SDK alongside a raw fetch fallback:

const payload = {
 to: [{ id: customerParticipantId, type: 'user' }],
 from: { id: agentParticipantId, type: 'user' },
 type: 'canned',
 text: { contentType: 'text/plain', content: 'Thank you for contacting support.' },
 conversationId: activeConversationId,
 mediaType: 'text/plain'
};
await fetch(`${gcHost}/api/v2/conversations/messages`, {
 method: 'POST',
 headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
 body: JSON.stringify(payload)
});

The documentation mentions type: text for standard messages, but I cannot locate a reference for injecting canned responses directly through the REST endpoint versus the internal UI components. Does the Conversations API support a specific content object structure for canned replies, or must I route this through the Analytics Interaction APIs instead? I need a reliable programmatic approach that preserves timestamp ordering.