Skip to main content

Public API

Put TrolleyChat's assistant inside your own product. Your server calls the API, tells us which of your signed-in users is asking, and gets back the assistant's reply. You build the chat UI; TrolleyChat provides the brain: the inbox's knowledge base, its personality, escalation to a human, and the full conversation in your team's dashboard.

When to use the API instead of the widget​

The live chat widget is the right choice for a storefront or a marketing site: anonymous visitors, one script tag, no code. The API is for applications that already know who their users are and want the conversation to live inside their own interface.

Live chat widgetPublic API
Who the visitor isAnonymous until they verify an emailYour app tells us, on every conversation
Where it runsA script tag on your siteYour server, calling ours
The UITrolleyChat's chat windowYours
The assistantSameSame
Human handoff and dashboardYesYes

How it works​

  1. You create an API key on an inbox, under Settings → Integrations → API access.
  2. When a user opens your help panel, your server calls POST /api/v1/conversations with your user's id. You get a conversation and its recent history.
  3. When the user sends a message, your server calls POST /api/v1/conversations/{id}/messages. The assistant's reply comes back in the same response.
  4. If the assistant hands the conversation to a person, your team answers from the TrolleyChat dashboard. Your server picks up their replies with GET /api/v1/conversations/{id}/messages.

Everything the assistant says comes from the inbox's knowledge base and configuration. It never reads data from your application, and in v1 it takes no actions other than handing off to a person.

Base URL​

https://app.trolleychat.ai

All requests and responses are JSON.

In this section​