Skip to main content

Organization Analytics Overview

Get a high-level overview of your organization's usage and statistics.

Endpoint

GET /api/analytics/overview

Authentication

Key TypeAllowed
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

HeaderTypeRequiredDescription
X-API-Keystring✅ YesYour 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

FieldTypeDescription
bucketsnumberTotal number of buckets
dataSourcesnumberTotal data sources across all buckets
dataPointsnumberTotal data points stored
alertRulesnumberTotal alert rules configured
apiKeysnumberTotal API keys created

Usage

FieldTypeDescription
apiCallsThisMonthnumberAPI calls made this billing month
apiCallsLimitnumberAPI call limit for your plan
apiCallsPercentagenumberPercentage of limit used
storageUsedBytesnumberStorage used in bytes
storageUsedFormattedstringHuman-readable storage size

Plan

FieldTypeDescription
namestringCurrent plan name
maxBucketsnumberMaximum buckets allowed
maxRetentionDaysnumberMaximum data retention
maxApiCallsnumberMonthly API call limit

Recent Activity

FieldTypeDescription
lastDataIngestionstringLast data point timestamp
lastAlertTriggeredstringLast alert trigger timestamp
dataPointsLast24hnumberData points in last 24 hours
alertsTriggeredLast24hnumberAlerts triggered in last 24 hours