Skip to main content

API Reference Overview

Complete reference for the dakkio REST API.

Base URL

https://api.dakkio.io

Authentication

dakkio supports two authentication methods:

JWT Authentication

For dashboard and administrative operations:

curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
https://api.dakkio.io/api/buckets

API Key Authentication

For data operations from IoT devices:

curl -H "X-API-Key: YOUR_API_KEY" \
https://api.dakkio.io/api/data

Response Format

All responses are in JSON format:

Success Response

{
"data": { ... },
"metadata": { ... }
}

Error Response

{
"error": "Error Type",
"message": "Human-readable error message",
"details": [ ... ]
}

HTTP Status Codes

CodeMeaning
200OK - Request succeeded
201Created - Resource created successfully
400Bad Request - Validation error
401Unauthorized - Invalid/missing authentication
403Forbidden - Insufficient permissions
404Not Found - Resource not found
409Conflict - Resource already exists
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error

Rate Limiting

API calls are limited by your plan:

  • Free: 10,000 calls/month
  • Pro: 1,000,000 calls/month
  • Enterprise: Unlimited

Rate limit headers are included in responses:

X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9523
X-RateLimit-Reset: 1705318200

When exceeded, you'll receive a 429 response:

{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Resets at 2024-01-15T10:30:00Z"
}

Pagination

List endpoints support pagination:

Query Parameters

  • limit: Items per page (default: 100, max: 1000)
  • offset: Number of items to skip (default: 0)

Response

{
"data": [ ... ],
"pagination": {
"limit": 100,
"offset": 0,
"total": 1523,
"hasMore": true
}
}

Timestamps

All timestamps are in ISO 8601 format with UTC timezone:

2024-01-15T10:30:00Z

JavaScript example:

const timestamp = new Date().toISOString();

Python example:

from datetime import datetime
timestamp = datetime.utcnow().isoformat() + 'Z'

Object IDs

MongoDB ObjectIds are used for all resource identifiers:

Format: 24-character hexadecimal string Example: 507f1f77bcf86cd799439011

Endpoints by Category

Authentication (JWT)

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user

Buckets (JWT)

  • GET /api/buckets - List all buckets
  • POST /api/buckets - Create bucket
  • GET /api/buckets/:id - Get bucket
  • PATCH /api/buckets/:id - Update bucket
  • DELETE /api/buckets/:id - Delete bucket

API Keys (JWT)

  • GET /api/apikeys - Get organization API key
  • POST /api/apikeys - Create/regenerate API key
  • POST /api/apikeys/revoke - Revoke API key

Data Sources (JWT)

  • GET /api/buckets/:bucketId/datasources - List data sources
  • POST /api/datasources - Create data source
  • PATCH /api/datasources/:id - Update data source
  • DELETE /api/datasources/:id - Delete data source

Alerts (JWT)

  • GET /api/buckets/:bucketId/alerts - List alert rules
  • POST /api/alerts - Create alert rule
  • PATCH /api/alerts/:id - Update alert rule
  • DELETE /api/alerts/:id - Delete alert rule

Webhooks (JWT)

  • GET /api/buckets/:bucketId/webhooks - List webhooks
  • POST /api/webhooks - Create webhook
  • PATCH /api/webhooks/:id - Update webhook
  • DELETE /api/webhooks/:id - Delete webhook

Analytics (JWT)

  • GET /api/analytics/overview - Dashboard overview
  • GET /api/analytics/buckets/:bucketId - Bucket analytics

Data Ingestion (API Key)

  • POST /api/data - Ingest single data point
  • POST /api/data/batch - Batch ingest data points

Data Queries (API Key)

  • POST /api/data/query - Query time-series data

Interactive Testing

Try the API Playground to test endpoints interactively.

SDKs & Libraries

Official SDKs are available for:

Need Help?