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
| Method | Path | Description |
|---|---|---|
POST | /events | Log a new operational event |
GET | /events | List events with filters |
GET | /events/{id} | Get event details |
PATCH | /events/{id} | Update an event |
POST | /events/{id}/correlate | Correlate 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"| Parameter | Type | Description |
|---|---|---|
entity_id | string | Filter by entity |
event_type_id | string | Filter by event type |
from_date | datetime | Start date filter |
to_date | datetime | End date filter |
limit | int | Page size |
offset | int | Pagination offset |
Event Type Management
| Method | Path | Description |
|---|---|---|
POST | /event-types | Create an event type |
GET | /event-types | List 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}/transition | Transition event type lifecycle state |
POST | /event-types/{id}/fields | Add a field to an event type |
GET | /event-types/{id}/fields | List 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/reorder | Reorder 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
| Method | Path | Description |
|---|---|---|
POST | /event-types/{id}/conditional-rules | Add conditional field visibility rule |
GET | /event-types/{id}/conditional-rules | List conditional rules |
PATCH | /event-types/{id}/conditional-rules/{rid} | Update a rule |
DELETE | /event-types/{id}/conditional-rules/{rid} | Delete a rule |
POST | /guard-rules | Create a submission guard rule |
GET | /guard-rules | List guard rules |
PATCH | /guard-rules/{id} | Update a guard rule |
POST | /guard-rules/{id}/publish | Publish 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
| Method | Path | Description |
|---|---|---|
GET | /duplication-rules | List deduplication rules |
POST | /duplication-rules | Create a dedup rule |
PATCH | /duplication-rules/{id} | Update a dedup rule |
POST | /duplication-rules/reset | Reset dedup state |
Last updated on