Retrieve conversational agent replies
Hold one turn of a conversation with the full shopping agent. The agent interprets the shopper's message, decides what it needs, and answers from whichever sources the domain has configured: product discovery across search, browse and recommendations, and a knowledge base of articles for questions the catalog cannot answer. A single turn can produce several kinds of content, so a reply may combine prose with product sets, cited articles, images or recipes, and it usually ends with refinements the shopper can pick from to continue. parameters.domain chooses which configured domain answers, and with it the agent's instructions, tools and models. Pass thread_id from a previous turn to continue that conversation with its history intact; omit it to start a new one. Results stream back as server-sent events (text/event-stream) so the agent's reply can be rendered as it is produced. To receive the finished reply as a single JSON document instead, send Accept: application/json.
Request
- Base URLhttps://agent.cnstrc.com
- URLhttps://agent.cnstrc.com/v1/agent_insights/chat
- Authnone required
Query parameters
The key of the index to use.
A unique identifier for the conversation thread. This ID links multiple requests to the same conversation. When omitted, a new thread is created.
Turn the content moderation check on or off. When on, shopper input is screened before the agent processes it.
The maximum number of result events to return.
The maximum number of results to return per item_results event.
An object containing options to format different aspects of the response.
Additional query parameters to forward to the underlying Constructor search, browse and recommendations API calls, as a JSON-encoded string: for example qs={"sort_by":"price","sort_order":"ascending"}. Each mode forwards only the keys that apply to the calls it makes, and any key managed by page_context.filters must not be overridden here.
The ID of the client and version that the request is coming from, such as cio-js-2.90.
A customer defined context (such as vip-club-member) used to evaluate redirect or refined tag rules. Pass multiple segments by passing multiple us arguments.
A customer generated anonymized identifier for a user on a customer website. It should only be sent for logged in customers and helps constructor to tie multiple client and session ID's together to form a behavioral data profile across devices.
Feature variants keyed by feature name. Accepts flattened feature_variants[<feature_name>] query parameters.
Feature toggles keyed by feature name. Accepts flattened features[<feature_name>] query parameters.
An integer representing the user's session number (starting with 1), incremented after a 30 minute period of inactivity.
A globally unique identifier for the user browser (or mobile application instance) making the request.
Request body
Response
AI-powered agent insights, streamed as server-sent events or aggregated into a single JSON document.
Example response
{
"follow_up_refinement": {
"options": [
"Yes, sub-zero",
"No, mild weather"
],
"question": "Do you need it for winter conditions?"
},
"item_results": [
{
"request": {
"ids": [
"item_id_1"
],
"params": {
"num_results_per_page": 20
},
"type": "browse"
},
"response": {
"results": [
{
"value": "Waterproof Hiking Boot",
"matched_terms": [
"waterproof",
"hiking"
],
"is_slotted": false,
"labels": {},
"data": {
"id": "item_id_1",
"url": "https://example.com/product/item_id_1",
"image_url": "https://cdn.example.com/item_id_1.jpg"
}
}
]
},
"result_id": "973e152a-ee03-47d2-a01b-1214da90a02b"
}
],
"message": "Based on your interest in hiking gear, here are some waterproof options...",
"result_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "complete",
"thread_id": "662e8400-e29b-41d4-a716-446655440001"
}Changes
No recorded changes to this operation across all 1 revision of this API.