Skip to main content
POST
/
v1
/
logs
/
batch
import olira
from olira import OliraLogType

olira.init(api_key="YOUR_API_KEY")
olira.log(
    log_type=OliraLogType.SYMPTOM_REPORT,
    patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    payload={"symptoms": []},
)
# Returns None once the event is accepted into the SDK queue
olira.log(
    log_type: OliraLogType,
    patient_id: str,
    payload: dict[str, Any] | None = None,
    trace: OliraTrace | None = None,
    timestamp: str | None = None,
    metadata: dict[str, Any] | None = None,
) -> None
Requires scope: sdk:event-log The worker batches and POSTs to /v1/logs/batch. Returns immediately after enqueue unless the queue rejects the event.

Parameters

log_type
OliraLogType
required
Catalog log type enum value.
patient_id
str
required
Olira patient id. Must not be empty; SDK rejects obvious PII patterns.
payload
dict[str, Any] | None
Event-specific JSON payload (≤512 KB wire limit per event).
trace
OliraTrace | None
Optional linkage to your object_type / object_id.
timestamp
str | None
ISO 8601 timestamp; omit for server default.
metadata
dict[str, Any] | None
Arbitrary key/value context stored alongside the event, separate from the typed payload. Surfaced in the Olira Console event detail panel.

Returns

None

Raises

ExceptionWhen
OliraErrorolira.init() was not called, or the background queue could not accept the event.
ValidationErrorClient-side validation failed (e.g. patient_id rules, payload too large).
AuthErrorHTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint.
ServerErrorHTTP 409 (e.g. conflicting external identifier) or repeated 5xx after retries; includes status_code when applicable.
RateLimitErrorHTTP 429 — rate limited; check retry_after (seconds).
NetworkErrorConnection timeout, DNS failure, or read error after retries.
import olira
from olira import OliraLogType

olira.init(api_key="YOUR_API_KEY")
olira.log(
    log_type=OliraLogType.SYMPTOM_REPORT,
    patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    payload={"symptoms": []},
)
# Returns None once the event is accepted into the SDK queue