This directory contains the aggregated API documentation for all microservices in the Energy Tracking IoT Platform.
| Service | Port | Base URL | Health Check | Documentation |
|---|---|---|---|---|
| Auth Service | 8005 | http://localhost:8005 | /health |
OpenAPI |
| API Gateway | 8000 | http://localhost:8000 | /health |
OpenAPI |
| Data Ingestion | 8001 | http://localhost:8001 | /health |
OpenAPI |
| Data Processing | 8002 | http://localhost:8002 | /health |
OpenAPI |
| Analytics | 8003 | http://localhost:8003 | /health |
OpenAPI |
| Notification | 8004 | http://localhost:8004 | /health |
OpenAPI |
All services (except auth service itself) require JWT authentication via the Authorization: Bearer <token> header.
All APIs follow a consistent response format:
{
"success": true,
"data": {},
"message": "Optional message",
"timestamp": "2024-01-01T00:00:00Z",
"request_id": "uuid-v4"
}Error responses follow this format:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human readable message",
"details": {}
},
"timestamp": "2024-01-01T00:00:00Z",
"request_id": "uuid-v4"
}200- Success201- Created400- Bad Request (validation errors)401- Unauthorized (authentication required)403- Forbidden (insufficient permissions)404- Not Found409- Conflict (resource already exists)422- Unprocessable Entity (business logic errors)429- Too Many Requests (rate limiting)500- Internal Server Error503- Service Unavailable
All services implement standardized health check endpoints:
/health- Overall health status/health/live- Liveness probe (for Kubernetes)/health/ready- Readiness probe (for Kubernetes)
{
"service": "service-name",
"status": "healthy|unhealthy|degraded",
"timestamp": "2024-01-01T00:00:00Z",
"uptime_seconds": 3600,
"version": "1.0.0",
"checks": {
"database": {
"status": "healthy",
"duration_ms": 45.2,
"details": {}
},
"redis": {
"status": "healthy",
"duration_ms": 12.1,
"details": {}
}
}
}All APIs implement rate limiting with the following headers:
X-RateLimit-Limit- Request limit per windowX-RateLimit-Remaining- Remaining requests in current windowX-RateLimit-Reset- Unix timestamp when limit resets
List endpoints support pagination with these parameters:
page- Page number (default: 1)limit- Items per page (default: 10, max: 100)sort- Sort fieldorder- Sort order (asc|desc)
Pagination response includes:
{
"data": [],
"pagination": {
"page": 1,
"limit": 10,
"total": 100,
"pages": 10,
"has_next": true,
"has_prev": false
}
}List endpoints support filtering:
filter[field]=value- Exact match filtersearch=term- Full-text searchcreated_after=2024-01-01- Date range filterscreated_before=2024-12-31- Date range filters
To generate/update API documentation:
# Generate OpenAPI specs for all services
make docs-generate
# Serve aggregated documentation
make docs-serve
# Export to Postman collection
make docs-export-postmanWhen services are running in development mode:
- Auth Service: http://localhost:8005/docs
- API Gateway: http://localhost:8000/docs
- Data Ingestion: http://localhost:8001/docs
- Data Processing: http://localhost:8002/docs
- Analytics: http://localhost:8003/docs
- Notification: http://localhost:8004/docs