Feedback and Leads APIs
Message Feedback
Endpoint:
POST /api/feedbackPayload:
{
"messageId": "msg_123",
"feedback": "positive",
"conversationId": "cs_456"
}feedback supports: positive, negative.
Implementation notes:
- Each assistant response from
POST /api/chatincludesX-Assistant-Message-Id. - Use that ID with the current
X-Conversation-Idwhen posting feedback. - The latest value is stored per assistant message, so users can change a prior thumbs vote.
Conversation Feedback
Endpoint:
POST /api/conversation-feedbackPayload:
{
"conversationId": "cs_456",
"userRating": "positive",
"userFeedbackComment": "Very helpful",
"easeOfUseRating": "easy"
}Ratings:
userRating:positiveornegativeeaseOfUseRating:very-easy,easy,neutral,difficult,very-difficult
Lead Capture
Endpoint:
POST /api/leadsHeaders:
X-Widget-Publishable-KeyX-Visitor-Id
Payload:
{
"email": "jane@example.com",
"name": "Jane Doe",
"phone": "+1-555-111-2222",
"message": "Please contact me",
"conversationId": "cs_456"
}Behavior:
- Creates or updates contact by email within organization scope
- Marks matching conversation as
escalated - Dispatches
lead_capturedwebhooks when configured
Last updated on