Skip to main content

Ingestion

Sending Events

POST https://api.regle.dev/v2/stream

Request Format

stream endpiont ingests a batch of events into Regle. Each request take up 1000 events and 1MB uncompressed per request. Events are part of the request body.

Currently, supported Content-Type are application/json and application/x-ndjson

ingestion json request
{
// OPTIONAL: an optional unique event id for Regle to use. If omitted,
// a UUID will be generated
"id": "<OPTIONAL>",
// REQUIRED: event name identifying the event
"name":"logSize",
// REQUIRED: arbitrary JSON data required for your event
"data":{
"filename": "celery.log",
"byte_size": 215
}
}
ingestion ndjson request
{"name":"logSize","data":{ "filename": "celery.log", "byte_size": 215 }}
{"name":"logSize","data":{ "filename": "celery.log", "byte_size": 215 }}
...

Response

If a request is successfully processed, the HTTP response will be 202 and a list of event IDs is returned. For any 5XX responses, the request should be retried.

ingestion json response
[
"d2e8c1c8-f287-4933-9c6e-d043242e99c5"
]
ingestion ndjson response
[
"d2e8c1c8-f287-4933-9c6e-d043242e99c5",
"70ec1f09-c873-4529-9f91-f14f0bdc4aa8",
...
]

Example Curl Request

curl example

curl -s -XPOST \
-H 'Content-Type: application/json' \
-H "X-Regle-ApiKey: $REGLE_API_KEY" \
-d '{"name":"logSize","data":{"filename":"celery.log","byte_size":215}}" \
https://api.regle.dev/v2/stream