Skip to content

Horizon REST & WebSocket API

Authentication

All API requests require an API key passed via the X-API-Key header (configurable via API_KEY_HEADER).

Scopes

ScopeAccess
signal:writeSubmit signals via WebSocket
dashboard:readSubscribe to real-time dashboard feeds
fleet:adminFull fleet management and cross-tenant intelligence

Health Endpoints

MethodPathDescription
GET/healthBasic health check
GET/health/readyReadiness probe — verifies database connections
GET/health/liveLiveness probe

No authentication required.

Fleet Management

Sensors

MethodPathDescription
GET/api/v1/fleet/sensorsList all sensors
POST/api/v1/fleet/sensorsRegister a new sensor
GET/api/v1/fleet/sensors/:idGet sensor details
DELETE/api/v1/fleet/sensors/:idDeregister a sensor
GET/api/v1/fleet/metricsFleet-wide metrics

Register a sensor:

sh
curl -X POST https://horizon.example.com/api/v1/fleet/sensors \
  -H "X-API-Key: $ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "US East Primary", "region": "us-east-1"}'
json
{
  "id": "sensor-abc123",
  "token": "sensor-token-xyz789",
  "wsEndpoint": "wss://horizon.example.com/ws/sensors"
}

Commands

MethodPathDescription
POST/api/v1/fleet/commandsSend a command to a sensor
GET/api/v1/fleet/commandsList pending commands
GET/api/v1/fleet/commands/:idGet command status

Commands are delivered via WebSocket. If the sensor is offline, the command is queued.

Configuration Templates

MethodPathDescription
GET/api/v1/fleet/config-templatesList config templates
POST/api/v1/fleet/config-templatesCreate a config template
GET/api/v1/fleet/config-templates/:idGet template details
PUT/api/v1/fleet/config-templates/:idUpdate a template
DELETE/api/v1/fleet/config-templates/:idDelete a template

Rules

MethodPathDescription
GET/api/v1/fleet/rulesList fleet rules
POST/api/v1/fleet/rulesCreate a rule
PUT/api/v1/fleet/rules/:idUpdate a rule
DELETE/api/v1/fleet/rules/:idDelete a rule

Rules support deployment strategies: immediate, canary, scheduled.

Hunt API

MethodPathDescription
POST/api/v1/hunt/queryExecute a hunt query
GET/api/v1/hunt/savedList saved queries
POST/api/v1/hunt/savedSave a query

Hunt queries are routed by time range: < 24h → PostgreSQL, > 24h → ClickHouse, mixed → hybrid.

Rate limiting

Hunt endpoints are rate-limited to protect against expensive queries. The default is 10 requests per minute per API key.

WebSocket Protocols

Sensor Connection (/ws/sensors)

Authentication: API key with signal:write scope sent in the initial auth message.

Message types (sensor → hub):

TypeDescription
authAuthentication with API key and sensor ID
signalSingle signal submission
signal-batchBatch of signals (preferred)
pongHeartbeat response
blocklist-syncRequest blocklist synchronization
command-ackAcknowledge a received command

Message types (hub → sensor):

TypeDescription
auth-okAuthentication succeeded
pingHeartbeat request
commandCommand delivery (config update, rule push, etc.)
blocklist-updateBlocklist changes

Dashboard Connection (/ws/dashboard)

Authentication: API key with dashboard:read scope.

Default subscriptions: campaigns, threats, blocklist.

Message types (hub → dashboard):

TypeDescription
campaignNew or updated campaign alert
threatNew threat detection
blocklistBlocklist entry created or removed
snapshotFull state snapshot (on connect or request)

Message types (dashboard → hub):

TypeDescription
subscribeSubscribe to a topic
unsubscribeUnsubscribe from a topic
snapshot-requestRequest a full state snapshot

Intelligence API

MethodPathDescription
GET/api/v1/intel/campaignsList active campaigns
GET/api/v1/intel/campaigns/:idCampaign details with IOCs
GET/api/v1/intel/threatsRecent threats with filtering
GET/api/v1/intel/actors/:idActor profile and history

Graph Correlation API

Navigate attack infrastructure relationships — IPs, fingerprints, session tokens, and ASNs.

MethodPathDescription
POST/api/v1/graph/traverseTraverse from a starting node (IP, JA4, token, ASN)
GET/api/v1/graph/campaign/:idGet full campaign graph
GET/api/v1/graph/node/:type/:idNode details + connected edges
POST/api/v1/graph/clusterDetect clusters of related nodes
POST/api/v1/graph/block-clusterBlock all IPs in a cluster/campaign

Traverse example:

sh
curl -X POST https://horizon.example.com/api/v1/graph/traverse \
  -H "X-API-Key: $ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"start": {"type": "ip", "value": "192.168.1.100"}, "depth": 2}'

SOC Toolkit API

MethodPathDescription
POST/api/v1/toolkit/cyberchef/recipeExecute a CyberChef recipe on input data
GET/api/v1/toolkit/cyberchef/operationsList available CyberChef operations
POST/api/v1/toolkit/decodeAuto-detect and decode (base64, URL, HTML)
POST/api/v1/toolkit/hashCompute hashes (MD5, SHA-1, SHA-256)
POST/api/v1/toolkit/regexTest and extract matches with regex

Rate Limits

Endpoint CategoryLimitWindow
Fleet management100 requestsper minute
Intelligence queries200 requestsper minute
Hunt queries20 requestsper minute
Graph traversal50 requestsper minute
Toolkit operations200 requestsper minute

Rate limit headers are included in all responses:

  • X-RateLimit-Limit — maximum requests allowed
  • X-RateLimit-Remaining — requests remaining in window
  • X-RateLimit-Reset — window reset timestamp (Unix epoch)

Error Responses

All error responses follow this format:

json
{
  "error": "error_code",
  "message": "Human-readable description",
  "statusCode": 400
}

API Error Codes

CodeStatusDescription
AUTH_REQUIRED401Missing or invalid API key
FORBIDDEN403Insufficient permissions for operation
SENSOR_NOT_FOUND404Sensor ID does not exist
SENSOR_OFFLINE503Sensor is not connected
COMMAND_TIMEOUT504Sensor did not ACK command in time
RATE_LIMITED429Too many requests
QUERY_TOO_BROAD400Hunt query would return too many results
INVALID_SIGMA400Sigma rule syntax error

Sensor Protocol Error Codes

CodeDescriptionRecovery
1001Invalid message formatFix message structure
1002Authentication failedCheck credentials, re-register
1003Config hash mismatchPull fresh config
1004Command rejectedCheck command parameters
1005Rate limitedBack off, reduce event rate

Licensed under AGPL-3.0 · atlascrew.dev