Skip to navigation

Web chat · Publish the agent to a website

View as Markdown

Publishes the agent as a website bot and returns it, including the widget_key and the embed_snippet to paste. The bot is created answering, and a draft agent is taken live along with it.

Safe to repeat: publishing an agent that already has a bot returns that same bot, with the same widget_key, and changes nothing. The key goes into the customer’s page source, so it is never rotated here.

This publishes; it does not configure. A body is optional and applies only on the first call — on a bot that already exists, settings are left alone. Send configuration as a PATCH to this same path rather than relying on this body.

Until an origin is allowed the widget answers any site that embeds the key, so set allowed_origins as part of publishing rather than afterwards.

Authentication

AuthorizationApi-Key

Header authentication of the form Api-Key <token>

OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

agent_idstringRequired

Agent UUID or slug — both are accepted. From agents_listAgents.

Request

This endpoint expects an object.
allowed_originslist of stringsOptional

Sites permitted to embed the widget, as origins (https://shop.example). Empty allows any site that has the key.

appearanceobjectOptional
How the widget looks and what it says first. Replaced wholesale on a write, so send every field being kept.

Response

Already published; the existing bot, unchanged.

Errors

404
Not Found Error