Quickstart

Quickstart: Wire a support chat into your own UI

Building your own chat UI on the support endpoint is straightforward: post a message, keep the conversation_id, render the reply. This recipe shows the exact code, uses only the unauthenticated public ring, and links out to the endpoints and the application flow so the reader always has a next step.

2 min read

conversation_idThreads the context
optimisticEcho the user instantly
custom UIYour own styling

The message loop

let conversationId;
async function send(text) {
  appendBubble('user', text);            // optimistic
  const res = await fetch(`${BASE}/support/chat`, {
    method: 'POST', headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ conversation_id: conversationId, message: text }),
  });
  const { reply, conversation_id } = await res.json();
  conversationId = conversation_id;
  appendBubble('assistant', reply);
}

Handle failures gracefully

If a send fails, mark the user bubble as unsent and offer a retry rather than losing the message. Wrap the call in the standard error handler.

Frequently asked questions

How do I keep context between turns?

Store the conversation_id from the first reply and send it on every subsequent message so the assistant sees the whole thread.

Can I style the chat myself?

Yes — the endpoint is just JSON in, JSON out. The optional widget config gives you branding, but the UI is entirely yours.

Funding for UK limited companies

Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.