Get analytics data
Retrieve comprehensive analytics data for the authenticated tenant including:
- Document view and download statistics with breakdowns
- Contact activity metrics and engagement data
- Access logs with recent user interactions
- Trend analysis with previous period comparisons
Data is automatically filtered by the authenticated tenant and supports configurable time periods for analysis.
In: header
Query Parameters
Time period for analytics data. Uses OpenPanel's native range values for optimal performance. When provided, this parameter is passed directly to OpenPanel as the 'range' parameter.
"7d""today" | "yesterday" | "7d" | "30d" | "monthToDate" | "lastMonth" | "yearToDate" | "lastYear"Whether to use range parameter (recommended) or fall back to startDate/endDate.
trueCustom start date (YYYY-MM-DD format). Only used when useRange=false or when period is not a valid range. Overrides period parameter when used with endDate.
^\d{4}-\d{2}-\d{2}$dateCustom end date (YYYY-MM-DD format). Only used when useRange=false or when period is not a valid range. Overrides period parameter when used with startDate.
^\d{4}-\d{2}-\d{2}$dateResponse Body
fetch("https://app.orbiqhq.com/api/v1/analytics?period=7d&useRange=true&startDate=2024-01-01&endDate=2024-01-31", { method: "GET"}){
"documentStats": [
{
"id": "doc-123",
"name": "Privacy Policy",
"views": 245,
"downloads": 78
},
{
"id": "doc-456",
"name": "Terms of Service",
"views": 189,
"downloads": 42
}
],
"contactStats": [
{
"id": "cust-abc",
"name": "Acme Inc",
"documentsAccessed": 8,
"lastAccess": "2024-03-15T14:32:00Z"
},
{
"id": "cust-def",
"name": "TechCorp",
"documentsAccessed": 12,
"lastAccess": "2024-03-17T09:45:00Z"
}
],
"accessLogs": [
{
"id": "log-001",
"document": "SOC 2 Type II Report",
"contact": "TechCorp",
"user": "john.doe@techcorp.io",
"action": "View",
"timestamp": "2024-03-17T09:45:00Z"
},
{
"id": "log-002",
"document": "Penetration Test Results",
"contact": "Acme Inc",
"user": "security@acme.com",
"action": "Download",
"timestamp": "2024-03-15T14:32:00Z"
}
],
"trends": {
"totalViews": {
"current": 896,
"previous": 800,
"changePercent": 12,
"trend": "up"
},
"totalDownloads": {
"current": 361,
"previous": 334,
"changePercent": 8.1,
"trend": "up"
},
"activeContacts": {
"current": 3,
"previous": 3,
"changePercent": 0,
"trend": "flat"
}
}
}{
"error": "Invalid period. Must be one of: 7d, 30d, 90d, 1y"
}{
"error": "Analytics service temporarily unavailable"
}How is this guide?