Skip to main content
Use POST /openapi/v1/events/batch to record one to 100 events. The complete request body must be no larger than 1 MiB, and each payload must be no larger than 256 KiB after JSON encoding.

Event fields

timestamp can be at most 30 days old and up to five minutes in the future. If schemaVersion is omitted, the server stores the event as 1.0. Unknown versions are rejected at request validation so an incompatible payload is not silently misread. The optional workspaceId field is only a consistency hint. If it differs from the workspace selected by the API key, the event is rejected.

Example batch

Use the same runId for every event in one execution. Use the same sessionId across related executions.

Partial success response

The server evaluates each event independently:
  • Remove accepted events from the local queue.
  • Retry only IDs in retryableEventIds.
  • Permanently remove IDs in rejectedEventIds and record a local diagnostic.
  • Treat a repeated, already stored eventId as accepted.
Do not retry the entire original batch without filtering it. Doing so wastes capacity even though repeated IDs are idempotent.

Suggested event order

A language SDK can start with these practical event types:
SESSION_OUTCOME closes the Run. Put COMPLETED, FAILED, or CANCELLED in payload.status. Emit PROMPT_EXPOSURE once when a Run first uses a variant from an active prompt experiment. Also attach the same promptExposures array to SESSION_OUTCOME as a delivery fallback:
Do not send the raw assignment key. The server verifies the experiment, variant, environment, and Agent scope before storing the exposure. Lynx accepts other event type strings, but a stable shared vocabulary makes dashboards and debugging more useful.
In metadata-only mode, omit prompt text, model output, and tool arguments. In every mode, mask credentials and personal data before creating the event.