POST /api/agents/:id/events
Submits one or more threat events detected by an agent. This is the primary ingestion endpoint for Guard-detected threats.The agent ID reporting the threats.
Array of threat event objects.
Threat type (e.g.,
brute_force, port_scan, malware_detected, suspicious_process, file_integrity, privilege_escalation).Severity level:
low, medium, high, or critical.Threat-specific details (source IP, file path, process name, etc.).
ISO 8601 timestamp. Defaults to server receipt time if omitted.
The Sigma rule ID that triggered this detection.
AI confidence score (0.0—1.0).
GET /api/threats
Queries recent threat events across the fleet.ISO 8601 timestamp. Returns only events after this time.
Filter by organization ID.
Filter by severity:
low, medium, high, critical.Filter by threat type.
Maximum number of results (max 200).
GET /api/threats/summary
Returns an aggregated summary of threats across the fleet.Time period:
1h, 6h, 24h, 7d, 30d.Filter by organization ID.
GET /api/events/stream
Opens a Server-Sent Events (SSE) stream for real-time event notifications. The connection remains open and pushes events as they occur.Event Types
| Event Type | Description | Payload |
|---|---|---|
connected | Initial connection confirmation | { message: "Connected to event stream" } |
agent_online | An agent sent its first heartbeat | { agentId, hostname, ip } |
agent_offline | An agent missed its heartbeat timeout | { agentId, hostname, lastSeen } |
threats_reported | New threat events were submitted | { agentId, hostname, count, maxSeverity } |
policy_created | A new policy was created and broadcast | { policyId, version, ruleCount } |
Example SSE Output
The SSE stream sends a heartbeat comment (
: keepalive) every 30 seconds to maintain the connection. If the connection drops, clients should implement automatic reconnection with exponential backoff.