Skip to main content
Use the Widget Launch API when your server already knows who the visitor is — a candidate opening their interview invitation, a customer on their order page — and you want the conversation to start with that context. Your server creates a widget link for the person; you send them the link or put the returned embed code on your own page. Values sent through the API are stored on our side. The page only ever contains a random code, so visitors can’t read or change the values. Compare with values in the embed code, which visitors can see and edit.

Before you start

  1. An agent with a widget channel. A Chat & Voice Agent (conversation flow) with a Widget channel, and the Initial Parameters you want to pass.
  2. Its ids. In the widget channel, click Install Widget: the snippet’s data-flow-id is the agent’s id (flowId) and data-channel-id is the widget channel’s id (channelId).
  3. A widget key. In Settings → API access → Widget keys, click Create. Workspace Owners and Admins can create keys. Optionally limit the key to some agents and set an expiry. The key is shown once — store it in your server’s secrets.
A widget key belongs on your server only. Never put it in a web page, a mobile app or a public repository. The API refuses calls from browsers.
A key can create, look up and revoke widget links — nothing else. It can’t read your agents or conversations. If the person who created a key leaves the workspace, the key keeps working; revoke it in Widget keys when you no longer need it.

Base URL and authentication

Send the key in either header:
POST /v1/widget/launches
Response 201:
  • url — the hosted chat. Send it to the person (email, SMS, your app).
  • embedHtml — the embed code. Put it in the page your server renders for this person to show the conversation on your own site.
  • token — the link’s code, returned only in this response. Keep it only as long as you need it; anyone who has it can open the conversation.
Values are checked strictly: a parameter the agent doesn’t define, a value of the wrong type ("42" for a number), a value outside a parameter’s options, or a missing required parameter is refused with invalid_parameters. Nothing is converted for you. GET /v1/widget/launches/{id}
The values you sent and the token are never returned. DELETE /v1/widget/launches/{id} → 204 The link stops opening and stops resuming. Revoking again also returns 204.

Errors

Errors look like { "error": { "code": "…", "message": "…", "details": [] } }. The link behaves like any widget link: on an Initiator agent the agent speaks first; on a Responder agent the person writes first. One link is one conversation, reopening it continues the same conversation, and it stops opening at its expiry. See Widget links for the details.