Quick Start
The fastest path depends on what you need:
Add the tracker
One script tag auto-tracks pageviews, clicks, scroll depth, and session replays.
Onboarding guideCall the API
Track custom events, read analytics data, and configure webhooks below.
Jump to endpointsOverview
https://wysleap.com/apiAPI Key — header or body
JSON + HTTP status codes
Authentication
Every API request requires your API key, found in Site Settings. Supply it as a request header (recommended) or inside the request body.
Header (recommended)
X-API-Key: your-api-key-hereRequest body
{
"siteId": "your-site-id",
"_apiKey": "your-api-key-here"
}Endpoints
/telemetry/pageviewTrack page views. Automatically builds visitor profiles from browser and device signals.
Request Parameters
siteIdstringYesYour site identifierpageUrlstringYesFull URL of the page being viewedpageTitlestringNoPage title from document.titlereferrerstringNoReferring URLvisitorIdstringNoVisitor ID — auto-generated if omittedsessionIdstringNoSession ID — auto-generated if omittedscreenWidthintegerNoViewport width in pixelsscreenHeightintegerNoViewport height in pixelslanguagestringNoBrowser language (e.g. en-US)timeZonestringNoIANA timezone identifier_apiKeystringYes*API key (or use X-API-Key header)Code Examples
curl -X POST https://wysleap.com/api/telemetry/pageview \
-H "Content-Type: application/json" \
-d '{
"siteId": "your-site-id",
"pageUrl": "https://example.com/products",
"pageTitle": "Products - Example Store",
"referrer": "https://google.com",
"visitorId": "vis_abc123",
"sessionId": "sess_xyz789",
"userAgent": "Mozilla/5.0...",
"screenWidth": 1920,
"screenHeight": 1080,
"language": "en-US",
"timeZone": "America/New_York",
"_apiKey": "your-api-key"
}'Response 200 OK
{
"success": true,
"message": "Pageview tracked successfully",
"visitorId": "vis_abc123",
"sessionId": "sess_xyz789",
"timestamp": "2025-01-15T10:30:00Z"
}/telemetry/eventTrack custom events — purchases, sign-ups, button clicks, or any meaningful interaction.
Sign Up Success, not sign_up_success.Request Parameters
siteIdstringYesYour site identifiereventNamestringYesEvent name in Title Case (e.g. "Purchase Completed")eventDataobjectNoAny JSON-serialisable metadata for the eventvisitorIdstringNoVisitor ID to associate the event withsessionIdstringNoSession ID to associate the event withpageUrlstringNoURL where the event occurred_apiKeystringYes*API key (or use X-API-Key header)Code Examples
curl -X POST https://wysleap.com/api/telemetry/event \
-H "Content-Type: application/json" \
-d '{
"siteId": "your-site-id",
"eventName": "Purchase Completed",
"eventData": {
"productId": "prod_123",
"productName": "Premium Plan",
"currency": "USD"
},
"visitorId": "vis_abc123",
"pageUrl": "https://example.com/checkout/success",
"_apiKey": "your-api-key"
}'Response 200 OK
{
"success": true,
"message": "Event tracked successfully",
"eventId": "evt_123456",
"timestamp": "2025-01-15T10:30:00Z"
}/visitors/{siteId}Retrieve analytics data — visitor stats, behaviour patterns, intent scores, and page metrics.
Query Parameters
limitinteger50Number of recent visitors to return (max 1000)daysinteger30Number of days to look backcountrystring—Filter by ISO 3166-1 alpha-2 country codeCode Examples
curl -G "https://wysleap.com/api/visitors/your-site-id" \
-H "X-API-Key: your-api-key" \
--data-urlencode "limit=50" \
--data-urlencode "days=30"Response 200 OK
{
"site": {
"totalPageviews": 15234,
"totalEvents": 3456,
"avgTimeOnPage": 127.5,
"bounceRate": 0.42,
"pageviewsByDay": [
{ "date": "2025-01-15", "views": 234 }
],
"topPages": [
{ "path": "/products", "views": 1234, "avgTimeOnPage": 145.2 }
]
},
"visitors": [
{
"visitorId": "vis_abc123",
"lastVisit": "2025-01-15T10:30:00Z",
"visitCount": 5,
"country": "United States",
"browser": "Chrome",
"intentScore": {
"level": "high",
"score": 85,
"factors": ["Returning visitor", "High engagement"]
},
"accuracyMetrics": {
"confidence": 0.92,
"fingerprintQuality": "excellent"
}
}
],
"uniqueVisitors": 1234,
"activeVisitors": 23,
"totalCountries": 45,
"patterns": { "returningVisitorRate": 0.38 }
}Error Handling
All error responses use standard HTTP status codes with a consistent JSON body.
400Bad Request{
"error": "Missing required field: siteId",
"code": "VALIDATION_ERROR"
}401Unauthorized{
"error": "Invalid API key",
"code": "UNAUTHORIZED"
}404Not Found{
"error": "Site not found",
"code": "NOT_FOUND"
}429Too Many Requests{
"error": "Rate limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"retryAfter": 60
}500Internal Server Error{
"error": "Internal server error",
"code": "SERVER_ERROR"
}Webhooks
Receive real-time HTTP POST notifications when events occur on your site. Configure endpoint URLs in Site Settings → Webhooks.
Supported Events
pageviewFired when a page view is trackedeventFired when a custom event is trackedvisitor_identifiedFired when a new visitor is fingerprintedhigh_intent_visitorFired when a visitor's intent score reaches highPayload Structure
{
"event": "pageview",
"siteId": "your-site-id",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"pageUrl": "https://example.com/products",
"visitorId": "vis_abc123",
"intentScore": { "level": "high", "score": 85 }
},
"signature": "sha256=abc123..."
}Signature Verification
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const hmac = crypto.createHmac('sha256', secret);
const digest = hmac.update(JSON.stringify(payload)).digest('hex');
const expected = `sha256=${digest}`;
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Rate Limits
Limits are applied per API key, measured in requests per minute. When exceeded the API returns 429 Too Many Requests.
Free Plan
100
requests / minute
Pro Plan
1,000
requests / minute
Business Plan
10,000
requests / minute
Response Headers
X-RateLimit-LimitYour total rate limitX-RateLimit-RemainingRequests remaining in the current windowX-RateLimit-ResetUnix timestamp when the current window resetsJavaScript SDK
The easiest integration — one script tag handles visitor identification, session management, and data collection automatically.
For full setup, configuration options (trackClicks, trackScroll, session replay), and all SDK methods (trackPageView, trackEvent, getVisitorId), see the Onboarding Guide.
WysLeap.trackEvent('Event Name', { }) in your app to send custom events without calling the REST endpoint directly.Ready to get started?
Get your API key and start integrating privacy-first visitor intelligence into your application.