Skip to main content
POST
/
logging
/
page-views
Log page view
curl --request POST \
  --url https://api.thehaystack.ai/v2/haystack/logging/page-views \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "origin": "<string>",
  "path": "<string>",
  "surface": "embed",
  "search": "<string>",
  "embedToken": "<string>",
  "referrerUrl": "<string>"
}
'
{
  "pageViewId": "<string>"
}

Authorizations

Authorization
string
header
required

Enter your API token from the Haystack dashboard

Body

application/json
origin
string
required

The page origin (e.g. https://pinelake.org)

path
string
required
surface
enum<string>
required
Available options:
embed,
connect,
console
search
string | null

Query string portion of the URL

embedToken
string | null
referrerUrl
string | null

Response

200 - application/json

Event logged

pageViewId
string