Create a personal chat link for one recipient
POST /Platform/chat/link
Create a personal chat link for one recipient.
For a message you send before the recipient opens a chat, such as a
follow-up text. Opening the link starts a new chat with the flow's
agent, which reads variables in its templates as {link.<name>}
(initial tools, greeting, first page) and gets brief as the
conversation's brief. The values are signed and kept on the server:
the link carries only an opaque token in its fragment (or, as a short
link, only a code), so the values never appear in the link,
referrer headers or access logs. Anyone
holding the link can open it until it expires or is revoked, and each
open starts a new chat.
Body parameters
chat_flow: str. The chat flow's slug (sh_...), which is also its id.variables: optional dict. Values for this recipient, by name. A name is a letter or underscore followed by letters, digits or underscores.brief: optional str. A note for the agent, stored as the new conversation's brief.expires_in_days: optional int. Days until the link stops working, from 1 to 30.short_link: optional bool. Return a short link (about 23 characters) asurl, for a text message where the full chat page URL is too long. Leave it off for email, buttons and anything else that hides the URL.
Returns
ChatPersonalLink
url: str. The link to send: a short link (lnk.hilus.ai/…) when one was asked for, otherwise the chat page.page_url: str. The chat page URL, which a short link opens, with the link's token in its fragment (#link=).token: str. The link's token alone (ht_...); pass it to revoke the link.expires_at: datetime. When the link stops opening a chat (UTC).
Example request
curl -X POST "https://api.hilus.ai/Platform/chat/link" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'