Gather details before a chat and feedback after it.
A web widget can collect structured input from visitors at two points: a pre-conversation form that runs before the chat starts, and a post-conversation feedback form that runs after it ends. Both are defined in the widget’s config under config.v1 and edited from the widget’s Behavior settings. See Creating a widget to set up the widget itself.
Set pre_conversation_form to show a form before the conversation begins. The visitor must submit it before the chat can start. When they submit, the field values are merged into the new conversation’s custom_metadata, so they show up on the conversation detail alongside everything else the agent captured.The value is a FormDefinition:
Field
Type
Description
id
string
Form identifier.
name
string
Internal name.
title
string
Heading shown above the form.
submit_label
string
Text on the submit button (for example Start Conversation).
pre_conversation_show_once controls whether a returning visitor sees the form again. It defaults to true.When enabled, the submitted values are cached in the visitor’s browser localStorage under the key anyreach-widget-form-<widgetId>, along with a hash of the form’s fields:
On a later visit, if the cached hash still matches the current fields, the form is skipped and the cached values are reused automatically.
If you change the form’s fields, the hash no longer matches, so the form is shown again and pre-filled with the previous values.
The cache lives in the visitor’s browser, so it is per device and per browser, not per account. Clearing site data or switching browsers shows the form again.
The accepted values are written to the conversation’s custom_metadata.feedback_form, where you can read them from conversation detail. The data object is keyed by field id.Because this endpoint is public and unauthenticated, the server applies several guards:
Rule
Behavior
Single submission
Feedback is accepted only once per conversation. A second submission returns 409.
Allowed fields only
Keys not matching a configured feedback field id are dropped. If nothing valid remains, the request returns 400.
Size cap
Payloads larger than 16 KB (serialized JSON) return 413.
Feedback enabled
If the widget has no feedback form configured, the request returns 400.
Ownership
The conversation must belong to the widget, or the request returns 403; an unknown conversation returns 404.