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/eventsRequest
Headers:
Authorization: Bearer val_xxxContent-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
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Agent identifier |
endpoint | string | Yes | Full URL called |
method | string | Yes | HTTP method |
amount | string | No | Human-readable USDC (default "0") |
policy_evaluation | string | No | "allowed" | "flagged" | "blocked" |
team | string | null | No | Team 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.