Complete REST API reference for EdgeAI Telemetry v0.2.0
http://localhost:8080/api/v1
Most endpoints require authentication via Bearer token in the Authorization header:
Authorization: Bearer <jwt-token>
POST /auth/loginRequest body:
{
"email": "admin@example.com",
"password": "admin123",
"mfa_code": "123456" // Optional, required if MFA enabled
}Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "uuid",
"email": "admin@example.com",
"roles": ["admin"],
"permissions": ["users:read", "users:create", ...],
"mfa_enabled": false,
"auth_method": "local"
},
"requires_mfa": false
}
}POST /auth/logout
Authorization: Bearer <token>POST /auth/refresh
Authorization: Bearer <token>GET /auth/me
Authorization: Bearer <token>GET /auth/sso/providersResponse:
{
"success": true,
"data": [
{
"id": "uuid",
"name": "Azure AD",
"provider_type": "oidc",
"issuer_url": "https://login.microsoftonline.com/{tenant}/v2.0",
"scopes": ["openid", "email", "profile"],
"is_active": true,
"is_default": true
}
]
}POST /auth/sso/login/:provider_idResponse:
{
"success": true,
"data": {
"authorization_url": "https://login.microsoftonline.com/...",
"state": "random-state-string"
}
}POST /auth/sso/callback/:provider_id
Content-Type: application/json
{
"code": "authorization-code-from-idp"
}POST /auth/mfa/setup
Authorization: Bearer <token>Response:
{
"success": true,
"data": {
"secret": "JBSWY3DPEHPK3PXP",
"qr_code_uri": "otpauth://totp/EdgeAI:user@example.com?secret=...",
"backup_codes": ["A1B2C3D4", "E5F6G7H8", ...]
}
}POST /auth/mfa/enable
Authorization: Bearer <token>
Content-Type: application/json
{
"code": "123456"
}POST /auth/mfa/disable
Authorization: Bearer <token>GET /users
Authorization: Bearer <token>Response:
{
"success": true,
"data": [
{
"id": "uuid",
"email": "user@example.com",
"roles": ["analyst"],
"permissions": ["incidents:read", "summaries:read"],
"mfa_enabled": true,
"auth_method": "local",
"created_at": "2026-02-23T00:00:00Z",
"last_login": "2026-02-23T12:00:00Z"
}
]
}POST /users
Authorization: Bearer <token>
Content-Type: application/json
{
"email": "newuser@example.com",
"password": "securepassword",
"role": "analyst"
}GET /users/:id
Authorization: Bearer <token>DELETE /users/:id
Authorization: Bearer <token>POST /users/:id/roles
Authorization: Bearer <token>
Content-Type: application/json
{
"role_id": "uuid"
}DELETE /users/:id/roles/:role_id
Authorization: Bearer <token>GET /roles
Authorization: Bearer <token>Response:
{
"success": true,
"data": [
{
"id": "uuid",
"name": "admin",
"description": "Full system access",
"is_system": true
},
{
"id": "uuid",
"name": "analyst",
"description": "View and analyze data",
"is_system": true
}
]
}POST /roles
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "security_engineer",
"description": "Manage alerts and correlation rules"
}GET /roles/:id
Authorization: Bearer <token>Response:
{
"success": true,
"data": {
"id": "uuid",
"name": "admin",
"description": "Full system access",
"is_system": true,
"permissions": [
{
"id": "uuid",
"resource": "users",
"action": "read",
"description": "View user information"
}
]
}
}DELETE /roles/:id
Authorization: Bearer <token>GET /roles/:id/permissions
Authorization: Bearer <token>POST /roles/:id/permissions
Authorization: Bearer <token>
Content-Type: application/json
{
"permission_id": "uuid"
}GET /alerting/rules
Authorization: Bearer <token>Response:
{
"success": true,
"data": [
{
"rule": {
"id": "uuid",
"name": "High Risk Alert",
"description": "Alert when risk score exceeds threshold",
"is_active": true,
"condition_type": "risk_score_threshold",
"risk_score_min": 70,
"cooldown_minutes": 60,
"max_alerts_per_hour": 10
},
"channels": [
{
"id": "uuid",
"name": "Security Team Slack",
"channel_type": "slack"
}
]
}
]
}POST /alerting/rules
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Critical Risk Alert",
"description": "Alert on critical risk scores",
"condition_type": "risk_score_threshold",
"condition_config": {},
"risk_score_min": 80,
"severity_threshold": "critical",
"cooldown_minutes": 30,
"max_alerts_per_hour": 5,
"schedule_enabled": false,
"schedule_config": {},
"channel_ids": ["uuid-1", "uuid-2"]
}GET /alerting/rules/:id
Authorization: Bearer <token>DELETE /alerting/rules/:id
Authorization: Bearer <token>POST /alerting/rules/:id/toggle
Authorization: Bearer <token>GET /alerting/channels
Authorization: Bearer <token>Response:
{
"success": true,
"data": [
{
"id": "uuid",
"name": "Security Email",
"channel_type": "email",
"config": {
"recipients": ["security@example.com"],
"smtp_server": "smtp.gmail.com"
},
"is_active": true
}
]
}POST /alerting/channels
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Slack Webhook",
"channel_type": "slack",
"config": {
"webhook_url": "https://hooks.slack.com/services/..."
}
}POST /alerting/channels/:id/test
Authorization: Bearer <token>GET /alerting/alerts?status=fired&limit=50
Authorization: Bearer <token>Query parameters:
status(optional):fired,acknowledged,resolvedlimit(optional): Number of results (default: 100)
Response:
{
"success": true,
"data": [
{
"id": "uuid",
"alert_rule_id": "uuid",
"incident_id": "uuid",
"status": "fired",
"severity": "high",
"title": "High Risk Score Detected",
"description": "Identity user123 has risk score of 85",
"context_data": {},
"created_at": "2026-02-23T12:00:00Z"
}
]
}POST /alerting/alerts/:id/acknowledge
Authorization: Bearer <token>POST /alerting/alerts/:id/resolve
Authorization: Bearer <token>GET /audit/logs?action=login&limit=100
Authorization: Bearer <token>Query parameters:
user_id(optional): Filter by user UUIDaction(optional): Filter by action typeresource_type(optional): Filter by resourcestart_time(optional): ISO 8601 timestampend_time(optional): ISO 8601 timestamplimit(optional): Number of results (default: 100)offset(optional): Pagination offset
Response:
{
"success": true,
"data": [
{
"id": "uuid",
"timestamp": "2026-02-23T12:00:00Z",
"user_email": "admin@example.com",
"action": "login",
"resource_type": "auth",
"resource_id": null,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0...",
"request_method": "POST",
"request_path": "/api/v1/auth/login",
"response_status": 200,
"integrity_hash": "abc123..."
}
]
}GET /audit/stats?start_time=2026-02-01T00:00:00Z&end_time=2026-02-23T23:59:59Z
Authorization: Bearer <token>Response:
{
"success": true,
"data": {
"total_count": 15000,
"action_counts": [
["login", 5000],
["view_incident", 3000],
["update_incident", 1500]
],
"resource_counts": [
["auth", 5000],
["incidents", 4500],
["summaries", 3000]
],
"start_time": "2026-02-01T00:00:00Z",
"end_time": "2026-02-23T23:59:59Z"
}
}GET /audit/export?format=json
Authorization: Bearer <token>Query parameters:
format(required):jsonorcsvstart_time(optional): ISO 8601 timestampend_time(optional): ISO 8601 timestamp
Response:
{
"success": true,
"data": "[JSON or CSV content as string]"
}GET /dashboard/metrics
Authorization: Bearer <token>Response:
{
"success": true,
"data": {
"summaries_received": 1000,
"anomalies_received": 50,
"incidents_created": 10,
"data_reduction_percent": 99.0,
"active_agents": 5
}
}GET /dashboard/summaries
Authorization: Bearer <token>GET /dashboard/incidents
Authorization: Bearer <token>GET /incidents?status=open&limit=50
Authorization: Bearer <token>GET /incidents/:id
Authorization: Bearer <token>GET /graph/nodes
Authorization: Bearer <token>GET /graph/edges
Authorization: Bearer <token>GET /graph/blast-radius/:node_id
Authorization: Bearer <token>GET /healthResponse:
{
"status": "healthy",
"version": "0.2.0"
}GET /readyResponse:
{
"status": "ready",
"checks": {
"database": "connected",
"grpc": "listening"
}
}All errors follow this format:
{
"success": false,
"data": null,
"error": "Error message description"
}| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized - Invalid or missing token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found |
| 422 | Validation Error |
| 500 | Internal Server Error |
| 502 | Bad Gateway - SSO provider error |
Resources and actions for RBAC:
| Resource | Actions |
|---|---|
users |
read, create, update, delete |
roles |
read, create, update, delete |
incidents |
read, create, update, delete |
summaries |
read |
alerts |
read, create, update, delete |
alert_rules |
read, create, update, delete |
alert_channels |
read, create, update, delete |
settings |
read, update |
audit_logs |
read |
Example permission: users:read, alerts:create
API endpoints are subject to rate limiting:
- Authentication endpoints: 10 requests per minute
- Other endpoints: 1000 requests per minute per user
Rate limit headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
API Version: 0.2.0
Last Updated: 2026-02-23