PUT
/
api
/
v1
/
events_v2
{
  "error": "Missing or invalid agent token",
  "type": "UnauthorizedEvents"
}
Ingests an event to the server using ashkaal format (v2). The agent ID is automatically extracted from the token and associated with the event.
Requires Agent token authentication (not user token)

Request Body

The request body should contain a V2 event object using ashkaal format. The exact structure depends on the event kind.
kind
string
required
Event kind (e.g., “network_connection”, “process_execution”, “file_access”)
timestamp
string
required
ISO 8601 timestamp of when the event occurred
metadata
object
required
Event-specific metadata in ashkaal format
verdict
string
Event verdict: “allowed”, “blocked”, “detected”

Examples

curl -X PUT "https://api.garnet.ai/v1/events_v2" \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "network_connection",
    "timestamp": "2025-09-29T10:23:45Z",
    "metadata": {
      "destination": "malicious.example.com",
      "destination_ip": "203.0.113.89",
      "port": 443,
      "protocol": "tcp"
    },
    "verdict": "blocked"
  }'

Response

Returns 201 for newly created events or 202 for updated existing events.
id
string
Unique event identifier
status
string
Processing status

Error Examples

{
  "error": "Missing or invalid agent token",
  "type": "UnauthorizedEvents"
}