Event Streaming
ZeroDB includes event streaming for real-time agent communication and application state tracking.
Create an Event
curl -X POST https://api.ainative.studio/api/v1/public/zerodb/events \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "agent.task_completed",
"data": {
"agent_id": "agent_123",
"task": "research",
"result": "Found 5 relevant papers"
}
}'
List Events
curl "https://api.ainative.studio/api/v1/public/zerodb/events?type=agent.task_completed&limit=20" \
-H "Authorization: Bearer $TOKEN"
Use Cases
- Agent coordination — Agents publish events when tasks complete; other agents subscribe
- Audit logging — Track all agent actions for compliance and debugging
- State sync — Keep frontend and backend state synchronized
- Workflow triggers — Use events to trigger downstream processes
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /zerodb/events | Create an event |
| GET | /zerodb/events | List events with filters |
| GET | /zerodb/events/{id} | Get a specific event |