Organization Analytics Overview
Get a high-level overview of your organization's usage and statistics.
Endpoint
GET /api/analytics/overview
Authentication
| Key Type | Allowed |
|---|---|
Admin (dakkio_a_) | ✅ Yes |
Write (dakkio_w_) | ❌ No |
Read (dakkio_r_) | ❌ No |
Required: Admin key (dakkio_a_). Organization-level analytics require Admin access.
Organization-level Analytics
This endpoint provides a summary across all buckets in your organization. For bucket-specific analytics, use the Bucket Analytics endpoint.
Request
Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | ✅ Yes | Your Admin API key |
Example Request
curl -X GET "https://api.dakkio.io/api/analytics/overview" \
-H "X-API-Key: dakkio_a_your_admin_key..."
Response
Success Response (200 OK)
{
"overview": {
"organization": {
"_id": "507f1f77bcf86cd799439000",
"name": "My Organization"
},
"totals": {
"buckets": 5,
"dataSources": 12,
"dataPoints": 1523456,
"alertRules": 8,
"apiKeys": 15
},
"usage": {
"apiCallsThisMonth": 45230,
"apiCallsLimit": 1000000,
"apiCallsPercentage": 4.5,
"storageUsedBytes": 52428800,
"storageUsedFormatted": "50 MB"
},
"plan": {
"name": "Pro",
"maxBuckets": 25,
"maxRetentionDays": 365,
"maxApiCalls": 1000000
},
"recentActivity": {
"lastDataIngestion": "2024-01-15T14:30:00Z",
"lastAlertTriggered": "2024-01-15T10:15:00Z",
"dataPointsLast24h": 12543,
"alertsTriggeredLast24h": 3
}
}
}
Error Responses
401 Unauthorized
{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}
403 Forbidden
{
"error": "Forbidden",
"message": "Only Admin keys can access organization analytics"
}
Code Examples
JavaScript/Node.js
const axios = require('axios');
async function getOrganizationOverview() {
const response = await axios.get(
'https://api.dakkio.io/api/analytics/overview',
{
headers: {
'X-API-Key': process.env.DAKKIO_ADMIN_KEY
}
}
);
return response.data.overview;
}
// Get organization overview
const overview = await getOrganizationOverview();
console.log('Organization Overview:');
console.log(`- Buckets: ${overview.totals.buckets}`);
console.log(`- Data Sources: ${overview.totals.dataSources}`);
console.log(`- Total Data Points: ${overview.totals.dataPoints.toLocaleString()}`);
console.log(`- API Calls This Month: ${overview.usage.apiCallsThisMonth.toLocaleString()}`);
console.log(`- Usage: ${overview.usage.apiCallsPercentage}%`);
Python
import requests
import os
def get_organization_overview():
response = requests.get(
'https://api.dakkio.io/api/analytics/overview',
headers={
'X-API-Key': os.environ['DAKKIO_ADMIN_KEY']
}
)
if response.status_code == 200:
return response.json()['overview']
else:
print('Error:', response.json())
return None
# Get organization overview
overview = get_organization_overview()
if overview:
print('Organization Overview:')
print(f"- Buckets: {overview['totals']['buckets']}")
print(f"- Data Sources: {overview['totals']['dataSources']}")
print(f"- Total Data Points: {overview['totals']['dataPoints']:,}")
print(f"- API Calls This Month: {overview['usage']['apiCallsThisMonth']:,}")
print(f"- Usage: {overview['usage']['apiCallsPercentage']}%")
Response Fields
Totals
| Field | Type | Description |
|---|---|---|
buckets | number | Total number of buckets |
dataSources | number | Total data sources across all buckets |
dataPoints | number | Total data points stored |
alertRules | number | Total alert rules configured |
apiKeys | number | Total API keys created |
Usage
| Field | Type | Description |
|---|---|---|
apiCallsThisMonth | number | API calls made this billing month |
apiCallsLimit | number | API call limit for your plan |
apiCallsPercentage | number | Percentage of limit used |
storageUsedBytes | number | Storage used in bytes |
storageUsedFormatted | string | Human-readable storage size |
Plan
| Field | Type | Description |
|---|---|---|
name | string | Current plan name |
maxBuckets | number | Maximum buckets allowed |
maxRetentionDays | number | Maximum data retention |
maxApiCalls | number | Monthly API call limit |
Recent Activity
| Field | Type | Description |
|---|---|---|
lastDataIngestion | string | Last data point timestamp |
lastAlertTriggered | string | Last alert trigger timestamp |
dataPointsLast24h | number | Data points in last 24 hours |
alertsTriggeredLast24h | number | Alerts triggered in last 24 hours |
Related Endpoints
- Bucket Analytics - Get analytics for a specific bucket
- List Buckets - List all buckets