Skip to main content
POST
/
logging
/
search-result-clicks
Log search click
curl --request POST \
  --url https://api.thehaystack.ai/v2/haystack/logging/search-result-clicks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "searchId": "<string>",
  "itemId": 123,
  "position": 123,
  "surface": "embed",
  "clickedHighlight": true,
  "embedToken": "<string>"
}
'
{
  "clickId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Documentation Index

Fetch the complete documentation index at: https://developer.thehaystack.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Enter your API token from the Haystack dashboard

Body

application/json
searchId
string
required

The encoded search id returned on GET /search as queryAnalyticsId

itemId
integer
required
position
integer
required

Zero-indexed position of the clicked result

surface
enum<string>
required
Available options:
embed,
connect,
console
clickedHighlight
boolean

True if the user clicked a highlighted transcript snippet rather than the item card

embedToken
string

Required when surface=embed

Response

200 - application/json

Click logged

clickId
string<uuid>