Skip to Content

Event Endpoints

Operational event logging and event type management. Events are served through the flaring-monitor service (port 8007) via the API gateway at http://localhost:8000.

Event CRUD

MethodPathDescription
POST/eventsLog a new operational event
GET/eventsList events with filters
GET/events/{id}Get event details
PATCH/events/{id}Update an event
POST/events/{id}/correlateCorrelate event with related events

POST /events

Log a new operational event.

curl -X POST http://localhost:8000/events \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "event_type_id": "evt-type-001", "entity_id": "well-001", "entity_type": "Well", "occurred_at": "2026-04-10T10:30:00Z", "fields": { "volume_mcf": 150, "duration_hours": 4, "cause": "equipment_malfunction" } }'

GET /events

List events with optional filters.

curl -H "Authorization: Bearer $TOKEN" \ "http://localhost:8000/events?entity_id=well-001&limit=50"
ParameterTypeDescription
entity_idstringFilter by entity
event_type_idstringFilter by event type
from_datedatetimeStart date filter
to_datedatetimeEnd date filter
limitintPage size
offsetintPagination offset

Event Type Management

MethodPathDescription
POST/event-typesCreate an event type
GET/event-typesList event types
GET/event-types/{id}Get event type details
PATCH/event-types/{id}Update an event type
DELETE/event-types/{id}Delete an event type
POST/event-types/{id}/transitionTransition event type lifecycle state
POST/event-types/{id}/fieldsAdd a field to an event type
GET/event-types/{id}/fieldsList event type fields
PATCH/event-types/{id}/fields/{fid}Update a field
DELETE/event-types/{id}/fields/{fid}Remove a field
PUT/event-types/{id}/fields/reorderReorder fields

POST /event-types

Create a custom event type definition.

curl -X POST http://localhost:8000/event-types \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Flaring Incident", "description": "Unplanned flaring event", "category": "flaring", "fields": [ {"name": "volume_mcf", "type": "number", "required": true}, {"name": "cause", "type": "select", "options": ["equipment", "weather", "other"]} ] }'

Conditional Rules & Guard Rules

MethodPathDescription
POST/event-types/{id}/conditional-rulesAdd conditional field visibility rule
GET/event-types/{id}/conditional-rulesList conditional rules
PATCH/event-types/{id}/conditional-rules/{rid}Update a rule
DELETE/event-types/{id}/conditional-rules/{rid}Delete a rule
POST/guard-rulesCreate a submission guard rule
GET/guard-rulesList guard rules
PATCH/guard-rules/{id}Update a guard rule
POST/guard-rules/{id}/publishPublish a guard rule version

Guard rules enforce validation before events can be submitted. Conditional rules control field visibility based on other field values.


Duplication Rules

MethodPathDescription
GET/duplication-rulesList deduplication rules
POST/duplication-rulesCreate a dedup rule
PATCH/duplication-rules/{id}Update a dedup rule
POST/duplication-rules/resetReset dedup state
Last updated on