Chat widget

Start a conversation from the widget (public)

Called by the chat widget in the visitor's browser, with the public chat token in ?token= and the Origin header of the page. No API key. Starts a conversation (channel widget) with the assistant and returns the greeting and conversation_token: the secret of this conversation for this visitor, valid for 6 hours. Every later request for it needs that secret as X-Conversation-Token. With turnstile on (the default) send turnstile_token from the bot check; the widget shows that check in a frame on our host and does all of this for you. Limits: 3 new conversations per minute and 20 per hour per IP address, 30 per minute and 300 per hour per token, the token's daily limit (public_chat_limit_reached) and, in live mode, the project's daily spending limit. Your backend can read the conversation with GET /conversations/{id} and receives conversation.summary.ready like any other chat.

post/public/conversations

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/public/conversations
  • Auth: API key in query parameter token

Request body

turnstile_tokenstring

The bot-check token from the challenge frame. Required when the public token has turnstile on (the default); the widget does this for you.

Response

The conversation with the greeting and its secret.

conversation_tokenstring required

The secret of this conversation, for this visitor only. Send it as X-Conversation-Token on every next request about this conversation. Keep it in the page (or sessionStorage), never in a URL.

expires_atstring date-time required

When conversation_token stops working (6 hours after the start).

Changes

No recorded changes to this operation across all 1 revision of this API.