Embed the chat widget

Drop a script tag on your site and customer conversations land in your shared inbox.

Install

Copy the snippet from Chat Widget › Install in the app (it carries your widget key) and paste it before </body>:

html
<script>
  window.MessyConfig = { widgetId: "YOUR_WIDGET_KEY" };
</script>
<script src="https://api.messy.sh/widget/messy-widget.js" async></script>

Set colours, logo, greeting and the allowed domains under Chat Widget › Widget. Messages stream both ways in real time, and when no operator is online the widget captures an offline message instead.

Identify the visitor

Once you know who a visitor is, identify them so the conversation attaches to a contact and follows them across sessions. The widget exposes its own identify for this; for server-side contact data use Identify customers.

Build a custom UI

Prefer your own chat interface? The same REST API under /widget/v1 that powers the default widget is available to you (visitor auth is handled by the embed script):

  • GET /widget/v1/config: appearance and settings
  • POST /widget/v1/conversations: start a conversation
  • GET /widget/v1/conversations: list the visitor’s conversations
  • GET|POST /widget/v1/conversations/:id/messages: read and send messages
  • POST /widget/v1/conversations/:id/read: mark read
  • POST /widget/v1/conversations/:id/rate: submit a CSAT rating
  • POST /widget/v1/identify: identify the visitor
  • POST /widget/v1/offline: leave a message when no one’s online
  • GET /widget/v1/unread_count: unread badge count
The rate endpoint captures a customer-satisfaction score per conversation, so you can measure how your support is landing.