Skip to Content
Developer APIFeedback and Leads APIs

Feedback and Leads APIs

Message Feedback

Endpoint:

POST /api/feedback

Payload:

{ "messageId": "msg_123", "feedback": "positive", "conversationId": "cs_456" }

feedback supports: positive, negative.

Implementation notes:

  • Each assistant response from POST /api/chat includes X-Assistant-Message-Id.
  • Use that ID with the current X-Conversation-Id when posting feedback.
  • The latest value is stored per assistant message, so users can change a prior thumbs vote.

Conversation Feedback

Endpoint:

POST /api/conversation-feedback

Payload:

{ "conversationId": "cs_456", "userRating": "positive", "userFeedbackComment": "Very helpful", "easeOfUseRating": "easy" }

Ratings:

  • userRating: positive or negative
  • easeOfUseRating: very-easy, easy, neutral, difficult, very-difficult

Lead Capture

Endpoint:

POST /api/leads

Headers:

  • X-Widget-Publishable-Key
  • X-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_captured webhooks when configured
Last updated on
Dukon | Docs