Skip to main content
GET
https://app.usehardal.com
/
api
/
websites
/
{websiteId}
/
sessions
Sessions API
curl --request GET \
  --url https://app.usehardal.com/api/websites/{websiteId}/sessions \
  --header 'Authorization: Bearer <token>'
{
  "sessions": [
    {
      "id": "sess_abc123456",
      "visitorId": "visitor_789",
      "startedAt": "2024-01-15T10:30:00+03:00",
      "duration": "180s",
      "pageViews": 5,
      "events": 12,
      "pages": [
        "/",
        "/products",
        "/products/item-1",
        "/cart",
        "/checkout"
      ],
      "browser": "Chrome",
      "os": "Windows",
      "device": "Desktop",
      "country": "Turkey",
      "fields": {
        "utm_source": "google",
        "utm_medium": "cpc",
        "utm_campaign": "summer_sale",
        "user_id": "user_456"
      }
    },
    {
      "id": "sess_def789012",
      "visitorId": "visitor_123",
      "startedAt": "2024-01-15T10:25:00+03:00",
      "duration": "45s",
      "pageViews": 2,
      "events": 3,
      "pages": [
        "/",
        "/about"
      ],
      "browser": "Safari",
      "os": "macOS",
      "device": "Desktop",
      "country": "United States",
      "fields": {
        "utm_source": "twitter",
        "utm_medium": "social"
      }
    }
  ],
  "pagination": {
    "total": 1250,
    "limit": 10,
    "offset": 0,
    "currentPage": 1,
    "totalPages": 125,
    "hasMore": true
  }
}
Get comprehensive session analytics data including visitor journeys, session durations, page views, and detailed session metadata. Perfect for understanding user behavior patterns and analyzing conversion paths.
websiteId
string
required
Your website signal ID
limit
integer
default:"1000"
Number of sessions to return (pagination)
offset
integer
default:"0"
Number of sessions to skip (pagination)
timeframe
string
default:"custom"
Time period: today, yesterday, last7days, last30days, custom
startDate
string
Start date for timeframe (ISO format)
endDate
string
End date for timeframe (ISO format)
targetSignalId
string
default:"websiteId"
Target signal ID for analytics data (use inherited signal ID if different from websiteId, otherwise same as websiteId)
timezone
string
default:"Europe/Istanbul"
Timezone for date calculations (e.g., Asia/Istanbul)
isHybrid
boolean
default:"false"
Whether this is a hybrid/self-hosted signal
{
  "sessions": [
    {
      "id": "sess_abc123456",
      "visitorId": "visitor_789",
      "startedAt": "2024-01-15T10:30:00+03:00",
      "duration": "180s",
      "pageViews": 5,
      "events": 12,
      "pages": [
        "/",
        "/products",
        "/products/item-1",
        "/cart",
        "/checkout"
      ],
      "browser": "Chrome",
      "os": "Windows",
      "device": "Desktop",
      "country": "Turkey",
      "fields": {
        "utm_source": "google",
        "utm_medium": "cpc",
        "utm_campaign": "summer_sale",
        "user_id": "user_456"
      }
    },
    {
      "id": "sess_def789012",
      "visitorId": "visitor_123",
      "startedAt": "2024-01-15T10:25:00+03:00",
      "duration": "45s",
      "pageViews": 2,
      "events": 3,
      "pages": [
        "/",
        "/about"
      ],
      "browser": "Safari",
      "os": "macOS",
      "device": "Desktop",
      "country": "United States",
      "fields": {
        "utm_source": "twitter",
        "utm_medium": "social"
      }
    }
  ],
  "pagination": {
    "total": 1250,
    "limit": 10,
    "offset": 0,
    "currentPage": 1,
    "totalPages": 125,
    "hasMore": true
  }
}