LipiLog API v1
All endpoints are under /api. Runtime authentication uses Authorization: Bearer sl_.... Human sessions use an HttpOnly cookie and an X-CSRF-Token header from /me for unsafe methods. Script tokens cannot authenticate console/read APIs. Runtime endpoints derive workspace/script ownership from the token; no numeric script ID is accepted in their payloads.
Start an execution
POST /telemetry/runs
{"id":"7ab041f7-3159-420a-9ad3-4652de839208","hostname":"worker-01","environment":"production","version":"sha256-or-release-reference","started_at":"2026-11-14T04:00:00Z","metadata":{"trigger":"existing-scheduler"}}
id is optional, but a stable client-generated UUID makes start retries idempotent. All remaining fields are optional. A new ID represents a new execution; the script token remains constant. The response is the persisted run. A repeated authorized ID returns the same run. Archived registrations reject new executions. Source versions are declared client labels and capture the registration's README/source snapshot when first seen.
Submit an event batch
POST /telemetry/runs/{run_id}/events
{"events":[
{"id":"c594ba4b-85b3-4a48-9412-c5866c01bbe0","sequence":0,"kind":"span_start","at":"2026-11-14T04:00:01Z","span_id":"fa911f60-9b7b-4774-9a11-a090f612eeaa","name":"Validate records","step_key":"validate","fields":{}},
{"id":"9c3dd734-d31b-4449-9424-a40edba29121","sequence":1,"kind":"log","at":"2026-11-14T04:00:02Z","span_id":"fa911f60-9b7b-4774-9a11-a090f612eeaa","level":"INFO","message":"Validated 100 records","fields":{"records":100}},
{"id":"ec9e54d6-c271-4ed1-abda-9e80201c4131","sequence":2,"kind":"span_end","at":"2026-11-14T04:00:03Z","span_id":"fa911f60-9b7b-4774-9a11-a090f612eeaa","status":"completed","elapsed_ms":2000,"fields":{}},
{"id":"07bb330d-2cd5-4696-9c10-be87698d807e","sequence":3,"kind":"run_end","at":"2026-11-14T04:00:04Z","status":"completed","elapsed_ms":4000,"message":"100 records delivered","fields":{"delivered":100}}
]}
Use current event timestamps rather than the illustrative historical timestamps above. Each event requires a UUID id, nonnegative sequence, kind and UTC timestamp. Fields must be a JSON object. heartbeat events need only the common fields; the PowerShell integration sends them automatically. A successful heartbeat/log batch updates contact health independently of the reported execution outcome.
- At most 500 events and 2 MiB per request; the SDK uses smaller byte-bounded batches.
- Parent checkpoints must already exist or precede their child in the batch. IDs belong to one execution. Nested and concurrent checkpoints are supported.
span_end requires elapsed_ms and completed, warning, failed, or skipped.
run_end requires elapsed_ms and completed, partial, failed, or cancelled, and must be the final event in its batch.
- Runtime events must be no older than seven days and no more than five minutes in the future. Runs with a completion older than the retry window reject further events.
- Each batch commits before acknowledgement. Validation errors roll back the whole batch. Event IDs and run-local sequences are unique. Resending the same IDs/content is safe; changing their content is a conflict.
- The response reports
accepted, duplicates, and durable: true. Missing/unknown/revoked tokens receive 401 with no telemetry insertion. Under contention, 429 means retry with jitter/backoff. 402 indicates an entitlement/event/data allowance issue. Invalid payloads are not accepted silently.
- Logs sent after a run's finish may arrive late, but new checkpoint lifecycle/run-finish events are rejected. All unfinished checkpoints are explicitly marked unknown when a run finishes.
- Levels: DEBUG, INFO, WARN, ERROR, FATAL. Message limit: 32,000 UTF-8 bytes; structured fields: 16,000 bytes. Do not log credentials.
Console resources
| Resource |
Purpose |
/auth/login, /auth/logout, /me, /me/password |
Session and account actions. |
/auth/oidc/start, /auth/oidc/callback |
Configured SSO flow. |
/workspaces, /me/workspace |
Legacy routes enabled only with ENABLE_LEGACY_CATALOG_API=true. |
/scripts, /scripts/{id} |
Catalogue and complete registration update. PATCH submits the editable registration fields, including required name/author. |
/scripts/{id}/token |
POST rotates/creates; DELETE revokes. Raw token returned only on creation. |
/scripts/{id}/grants, /scripts/{id}/source, /scripts/{id}/versions |
Scoped access and restricted version/source views. |
/overview, /runs, /runs/{id}, /runs/{id}/logs |
Compact fleet context and execution details. |
/analytics, /calendar, /search |
Scoped windowed statistics, historical date counts and plain-text log search. |
/stream |
SSE change notifications. Reconnect uses event IDs; clients refresh a snapshot on connection and retrieve actual records through authenticated APIs. |
/settings, /users, /audit, /export |
Authorized administrative functions. |
/cleanup/preview, /cleanup |
Preview and explicitly confirm expired-data cleanup. |
/webhooks, /webhooks/{id}/test, /deliveries/{id}/retry |
Endpoint and delivery administration. |
/imports/legacy |
Audited, repeatable import from the documented legacy export format. |
/billing/checkout, /billing/portal, /billing/stripe |
Configured billing flows. Stripe events use provider signatures rather than human-session CSRF. |
Run/search responses use {items,next_cursor}. Run cursors combine timestamp and ID; log cursors use event sequence. Pass the returned cursor unchanged (cursor for runs; after for logs/search). Date filters are inclusive from and exclusive to RFC3339 UTC instants. The UI converts custom local dates to these boundaries. Search defaults to a recent window but permits all retained history within the policy horizon.
Successful run median/P95 use compact run duration records, never a mixture of unrelated checkpoint durations. Checkpoint measurements group by stable key. Raw-error groups can shorten with log retention. Exact longer-range percentiles are recalculated from retained durations, not averaged from daily percentiles.
Permanent script deletion requires an administrator and ?confirm={script_id}; active records must first be finished or explicitly closed. POST /runs/{id}/close requires a reason and records an unknown outcome, not a remote process cancellation.
Transport selection in 1.1
TCP uses the existing HTTP(S) session and a reusable connection. A sender keeps its batch until the server acknowledges the PostgreSQL commit. Retries reuse event IDs and sequence numbers. Connection setup, acknowledgements, local buffering and the final flush add overhead. Use TCP when you need to account for every event. Check client warnings, pending spool data and the server retry window if capture is interrupted.
UDP is an optional best-effort channel for ordinary log records. The module sends run registration, checkpoint boundaries, completion and oversized records over acknowledged HTTP(S). Each UDP log carries its original sequence, script authentication and encryption. Receivers deduplicate repeated IDs and can accept late logs within the normal retry window. Sending a datagram provides no proof of database persistence. A run may show a completed checkpoint with missing UDP logs.
The PowerShell module accepts the following options on both Start-ScriptRun and Invoke-LoggedScript.
| Option |
Default |
Behavior |
-Transport |
Tcp |
Tcp or Udp. Encrypted UDP needs PowerShell 7 and platform AES-GCM support. |
-DeliveryMode |
Live |
Live posts during execution. AtEnd defers registration and sends after completion, preserving original event times. |
-BufferBytes |
5120 |
UTF-8 payload budget for a retry batch. A single larger valid event travels by itself. This setting excludes object, JSON and network overhead. |
-MaxSpoolMB |
50 |
Per-run disk backlog budget in MiB. Size this for a long deferred run. The sender reserves an additional 64 KiB for control events and reports overflow locally and in completion metadata. |
-SpoolDirectory |
User-local LipiLog spool |
Segmented disk journal, manifest and acknowledged cursor. Each run has an exclusive lock. |
-UdpPort |
8091 |
UDP port on the hostname in -ServerUrl. |
Complete-ScriptRun -FlushTimeoutSeconds 20 waits for delivery. After an interrupted flush use Resume-ScriptLogs -ServerUrl ... -ScriptToken ... -SpoolDirectory .... Replay uses acknowledged TCP and the same IDs. A permanent rejection leaves evidence in the spool for review. The server accepts runtime events up to seven days old. Local disk failure, overflow and UDP packet loss can lose telemetry.
For a custom UDP sender, encode an object containing run_id and one event of kind log as UTF-8 JSON. Use AES-256-GCM with the binary SHA-256 digest of the full UTF-8 script token, a fresh random 12-byte nonce, no associated data and a 16-byte tag. The wire order is the 3 ASCII bytes SL1, the first 11 ASCII characters of the token, the nonce, ciphertext and tag. Cap the whole datagram at 1,232 bytes. Deliver larger events over HTTP(S). Use HTTP(S) for every lifecycle event and acknowledge a checkpoint start before sending its UDP logs. Revoked or unknown token prefixes and unauthenticated packets are discarded.
Read endpoints used by the visibility console
GET /registry returns the signed-in person's visible scripts across existing memberships. A scoped REST request may pass the script's returned legacy partition in X-Catalog-Scope. The server validates membership and script grants. Direct run links use /runs/{id}/scope to resolve the permitted partition.
| Request |
Data |
GET /scripts/{id}/counts |
Retained executions, historical log counts for those runs, physically retained logs |
GET /runs?scope=history&script_id=…&limit=25 |
Keyset-paged archive summaries, all dates by default |
GET /runs/{id} |
Execution and checkpoint tree metadata |
GET /runs/{id}/logs?scope=direct&span_id=…&limit=80 |
Direct checkpoint log rows with sequence cursor |
GET /analytics?fast=true&script_id=… |
Exact summary and bucketed durations for the selected window, plus up to the latest 300 timed executions |
GET /calendar?script_id=…&from=…&to=…&tz=… |
Per-day execution counts in the requested timezone |
GET /runs/{id}/export streams retained execution logs as newline-delimited JSON up to the highest sequence present at download start. The server reads 200 records at a time and rechecks session and script visibility during the download. The All logs tab provides this download. Active ingestion or retention can change the underlying set during an export.
The console uses scope=words for indexed log text search. Quoted phrases are supported. The older API search behavior remains available without this parameter.
Projects, identity and licenses
| Method and route |
Contract |
| GET /projects |
Visible projects across authorized catalogs. The optional script_id filter returns that script’s memberships. |
| POST /projects, PATCH or DELETE /projects/{id} |
Catalog administrators create, rename or remove collections. The default collection is managed automatically. |
| PUT or DELETE /projects/{id}/scripts/{script} |
Idempotent membership change for a script the administrator can manage. |
| GET /registry?project_id={id} |
Visible scripts in the selected project. Registration accepts project_id in the script body. |
| POST /users, POST /users/{id}/reset |
Provision an account or queue a private password setup email. Valid authentication methods are password, ldap and oidc. LDAP accounts accept directory_identity. |
| POST /auth/password-setup |
Submit token and password. A successful response consumes the token. A separate sign-in creates a session. |
| GET /audit?paged=true |
Admin-only page with items and next_cursor. Supply before for pagination and action for an exact filter. |
| GET or POST /license (legacy /subscription) |
Authenticated status and platform-admin activation using a JSON key field. Expired catalog and ingestion requests return 402. |
Delete console records
Use an authenticated administrator session and its CSRF header. For a catalog other than the session default, send X-Catalog-Scope with the catalog ID.
| Request |
Effect |
| DELETE /api/projects/{id} |
Removes a custom project and its memberships. Scripts and archives survive. The built-in project returns 409. |
| DELETE /api/scripts/{id}?confirm={id} |
Permanently removes a manageable script, its tokens and execution history in all projects. Active runs return 409. |
| DELETE /api/users/{id} |
Deletes a sole-catalog account, or removes its membership from the selected catalog if shared. Returns a deleted boolean. Transfer script ownership first. |
Console activity records the actor, target and action. A viewer cannot perform these operations.
External read-only telemetry API (1.5.2)
For external analytics or your own RAG service. LipiLog does not generate embeddings or call an LLM. A script manager creates a named, expiring credential in Scripts → selected script → Read API. Copy the ll_read_... token at creation; the server keeps only its hash. Store it in your consumer's secret store. Read keys cannot ingest, change settings, access source code, or read other scripts. Each key is scoped to one script; use separate keys for multiple scripts. The key is invalid after expiry, revocation, script deletion, or loss of its issuer's management access. Use HTTPS outside localhost.
All paths below include /api. Send Authorization: Bearer ll_read_....
| GET endpoint |
Parameters / response |
/api/v1/telemetry/script |
Scoped script name, ID, description, archived flag, language. |
/api/v1/telemetry/runs |
from, to, limit, cursor; retained run IDs, status, timing, host/environment, counters and retention flags. |
/api/v1/telemetry/runs/{id}/checkpoints |
limit, cursor; retained checkpoint records with parent IDs, timing, status, attributes; details_expired flag. Wrong-script or absent run returns 404. |
/api/v1/telemetry/logs |
from, to, limit, cursor, optional run_id, level (DEBUG, INFO, WARN, ERROR, FATAL); log ID, event ID, sequence, run and checkpoint IDs, received/occurred timestamps, message and fields. |
List results are { "items": [...], "next_cursor": null | "opaque-string" }. Supply the cursor unchanged and URL-encoded for the next page. Limit defaults to 100, range 1–200. Use an explicit RFC3339 from inclusive and to exclusive (max 366 days) on all runs/logs pages; default is the preceding 7 days. Runs are ordered by start time then ID; logs by server received time then numeric ID, checkpoints by start time then ID. Do not interpret cursor as a durable change stream. Data can change during pagination; use overlapping windows and deduplicate by event ID, upsert runs/checkpoints by ID, and periodically reconcile retained data. For incremental consumers, re-fetch recent executions and use an overlap to account for concurrent commits, late arrivals and retention. There is no deletion event feed: the consumer must implement its own retention/reconciliation and delete derived copies when required. The API returns only retained records; absence does not prove no event occurred.
# Set LIPILOG_READ_KEY securely before use; do not commit or print it.
curl --fail-with-body --get 'http://localhost:8083/api/v1/telemetry/logs' \
-H "Authorization: Bearer $LIPILOG_READ_KEY" \
--data-urlencode 'limit=100'
Example Python consumer with a fixed window and URL-encoded cursor:
import datetime as dt, json, os, urllib.parse, urllib.request
base = os.environ['LIPILOG_URL'].rstrip('/')
token = os.environ['LIPILOG_READ_KEY']
end = dt.datetime.now(dt.timezone.utc)
query = {'from': (end-dt.timedelta(days=1)).isoformat(), 'to': end.isoformat(), 'limit': 100}
while True:
url = base + '/api/v1/telemetry/logs?' + urllib.parse.urlencode(query)
with urllib.request.urlopen(urllib.request.Request(url, headers={'Authorization': 'Bearer '+token}), timeout=30) as response:
page = json.load(response)
for item in page['items']:
# Upsert into your authorized consumer using item['event_id'].
# Do not print sensitive log messages by default.
pass
if not page['next_cursor']:
break
query['cursor'] = page['next_cursor']
Python instrumentation
Download lipilog.py from the script integration tab or copy it from integration/. Python 3.10+, no packages required. Use ingestion credentials for this SDK, not external read keys.
from lipilog import LipiLog
# Set LIPILOG_URL and LIPILOG_TOKEN in the process environment.
with LipiLog(environment='production', version='v1') as run:
with run.checkpoint('Validate input', key='validate'):
run.log('Validation finished', records=12)
run.fields['records_processed'] = 12
run.heartbeat() # call during long operations to maintain contact
SDK retries transient failures with stable event IDs within a process. Synchronous delivery raises on persistent failure; no on-disk spool, automatic heartbeat or concurrent checkpoint support in the Python helper. Preserve the production PowerShell module for buffered/background operation. Configure records_processed in the script's Business metrics tab to aggregate numeric run metadata. Never use real credentials or sensitive record contents in example logs.