← Documentation home
POST
/hyax-api/v1/track/eventTrack page / session event
CORS-enabled. Use `Authorization: Bearer hx_…` or pass `teamId` in the JSON body (for embedded scripts). When using an API key, `teamId` is derived automatically and domain validation is skipped. Without an API key, Origin/Referer host must be in the team's `allowedTrackingDomains`. Returns 200 with `{ success: false }` on validation errors instead of 4xx.
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
| teamId | No | Not required when using Bearer API key auth |
| visitorId | Yes | Client / cookie ID |
| path | No | Page path (max 500 chars) |
| referrer | No | Max 1000 chars |
| utm_source | No | Max 200 chars |
| utm_medium | No | Max 200 chars |
| utm_campaign | No | Max 200 chars |
| utm_content | No | Max 200 chars |
| utm_term | No | Max 200 chars |
| No | Links visitor to person if found |
Request examples
Same request in cURL, Node.js (fetch), and PHP (ext-curl).
curl -X POST 'https://platform.hyax.com/hyax-api/v1/track/event' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"visitorId": "visitor_cookie_id",
"path": "/pricing",
"referrer": "https://google.com",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "spring-sale",
"utm_content": "hero-banner",
"utm_term": "saas tools",
"email": "[email protected]"
}'Example response
Shape varies by data; values are illustrative.
{
"success": true
}