SENTINEL Docs

Events Ingest

POST /api/v1/events — Send SDK audit events.

The Events API ingests audit records from the SDK. ApiStorage uses this endpoint when writing records.

Endpoint

POST /api/v1/events

Request

Headers:

  • Authorization: Bearer val_xxx
  • Content-Type: application/json

Body: Object with events array (1–100 records)

{
  "events": [
    {
      "agent_id": "agent-weather-001",
      "team": "data-ops",
      "amount": "0.50",
      "amount_raw": "500000",
      "asset": "USDC",
      "network": "eip155:8453",
      "endpoint": "https://api.example.com/weather",
      "method": "GET",
      "tx_hash": "0xabc...",
      "payer_address": "0x...",
      "payee_address": "0x...",
      "policy_evaluation": "allowed",
      "status_code": 200,
      "response_time_ms": 150,
      "tags": ["production"],
      "metadata": {}
    }
  ]
}

Event Fields

FieldTypeRequiredDescription
agent_idstringYesAgent identifier
endpointstringYesFull URL called
methodstringYesHTTP method
amountstringNoHuman-readable USDC (default "0")
policy_evaluationstringNo"allowed" | "flagged" | "blocked"
teamstring | nullNoTeam grouping

Response

200 OK

{
  "ingested": 1,
  "errors": [],
  "alerts_created": 0
}

400 Bad Request — Invalid payload or validation failed.

401 Unauthorized — Invalid or missing API key.

ApiStorage batches records and POSTs them according to batchSize and flushIntervalMs. You typically don't call this endpoint directly.