Get analytics data
Retrieve comprehensive analytics data for the authenticated tenant including:
- Document view and download statistics with breakdowns
- Customer 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.
AuthorizationBearer <token>
In: header
Query Parameters
period?string
Time period for analytics data
Default
"30d"
Value in
"7d" | "30d" | "90d" | "1y"
startDate?string
Custom start date (YYYY-MM-DD format). Overrides period parameter when used with endDate.
Match
^\d{4}-\d{2}-\d{2}$
Format
date
endDate?string
Custom end date (YYYY-MM-DD format). Overrides period parameter when used with startDate.
Match
^\d{4}-\d{2}-\d{2}$
Format
date
Response Body
fetch("https://app.orbiqhq.com/api/v1/analytics?period=7d&startDate=2024-01-01&endDate=2024-01-31")
{
"documentStats": [
{
"id": "doc-123",
"name": "Privacy Policy",
"views": 245,
"downloads": 78
},
{
"id": "doc-456",
"name": "Terms of Service",
"views": 189,
"downloads": 42
}
],
"customerStats": [
{
"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",
"customer": "TechCorp",
"user": "john.doe@techcorp.io",
"action": "View",
"timestamp": "2024-03-17T09:45:00Z"
},
{
"id": "log-002",
"document": "Penetration Test Results",
"customer": "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"
},
"activeCustomers": {
"current": 3,
"previous": 3,
"changePercent": 0,
"trend": "flat"
}
}
}
{
"error": "Invalid period. Must be one of: 7d, 30d, 90d, 1y"
}
Empty
Empty
{
"error": "Analytics service temporarily unavailable"
}
How is this guide?