LOGIKASign in
On this page

API

Base https://api.logika.host. JSON in, JSON out, unversioned paths. logika api reaches every route below that the CLI's other commands don't. Authenticate with your token for the project (Authorization: Bearer lt_…, from logika login); it acts with your role there. The console uses the same API same-origin at https://app.logika.host/api/….

  • Errors are {"error": "message"}; the HTTP status carries the meaning. The one structured exception is 409, whose body carries the new ingest_url.
  • Limits: about 600 requests per minute per token (per user for a console session).
  • Identifiers are typed and prefixed (an_…, qi_…, pr_…, usr_…, tok_… for tokens, sdk_… for SDK keys); a wrong-kind identifier is rejected by name.

Ingest

MethodPathNotes
POST/v1/tracesOTLP/HTTP protobuf, with the SDK key and the enhancer's headers (x-logika-instance, x-logika-time, x-logika-dropped, x-logika-enhancer, x-logika-ledger-digest); a batch without them is refused with 400, pointing at logika init. At most 4 MiB decompressed. A batch sent twice is stored once. 200 with an empty response on success; 429/503 with Retry-After are retryable; 413 is permanent; 401/403 for a bad or revoked key; 409 moved, with ingest_url.
POST/v1/logsOTLP log records with the same key, headers and limits as /v1/traces; stored unmanaged. A record with an exception or an ERROR or FATAL severity raises an error issue; the rest are never judged.
POST/v1/metricsOTLP metrics with the same key, headers and limits as /v1/traces; every data point stored raw and unmanaged, read by /query as the metrics view, never judged or aggregated, counted toward quota.
POST/v1/profilesRejected with a permanent 404, counted, and reported as an account item.
GET/handshakeSDK key → {"ingest_url": …}. /v1/traces, /v1/logs and /v1/metrics are served at the returned endpoint.
GET/statusNo credentials. {"status": "ok", "database": "ok"} while the API reaches its database; 503 with why when it does not.

Queue

MethodPathNotes
GET/queueFilters: kind (anomaly, insight, feedback, account), state (or open / closed), since, until, ledger, event, env, app_version, check, regression=true, q (text search), order (created or activity), limit (50, at most 500), cursor. Every item carries a title and the actions that apply to it now; an insight carries said, its change in one sentence, and answer once a Why? was answered.
GET/queue/{id}The full item; for an issue, its stored evidence, recent occurrences (each with its app version; the latest 20, or every one kept with ?occurrences=all), when it was last fixed and when it last regressed; for every item, its history: who asked the agent to work it, and the agent's runs with their resolutions.
POST/queue/{id}Act on it: {"action": …} (below).
GET/queue/runsThe agent's latest runs, newest first (limit, 50, at most 500; q searches root causes and the titles of the items worked), each as below.
GET/queue/runs/{run}One run's resolution: who started it (whose monitor, or claimed by hand) and when, how it ended (report, or launch_failed, auth_failed, timed_out, no_report, lease_lost), its root cause and deliveries, a late resolution and whether it was accepted, and every item it worked with its outcome, delivery, reason or answer. A run in progress answers what it has claimed so far.
POST/queue/wake{}: start your agent on the project's open issues, never a selection, on your behalf: only your own monitor takes it, never another member's. Pressed while none of yours is connected (requester_connected false), it still waits for one; a Start your monitor does not take within 5m is given up and you are emailed. Pressed while a run works the issues, it is accepted: that run takes in what it claims next, and the Start waits for it to end. Wake my agent in the email, the console and Logika Monitor's menu post it.
GET/queue/wakeWhat an email's wake link would do now, without spending it: {project, state}, state one of ready, waiting (no monitor of yours is connected), limit (your spending limit is reached), used, expired, not_allowed.
POST/queue/claim{"items": ["qi_…"] | null, "run": "run_…" | null} (logika claim, which names the run Logika Monitor launched the agent for): take the open issues of the environment the run works, plus the items its member asked it to fix (or the items named; a Why?'s run takes only that insight), creating a run if the monitor did not, and answer {run, items, taken} with every item the run holds and its evidence. Claiming again takes in what was raised since. 409 when there is nothing to claim, or, claimed by hand, when another run already works the issues. A run claimed by hand keeps the monitor off the issues until it is resolved or has held them 30m.
POST/queue/resolve{"root_cause", "run"?, "items": [{"id", "outcome": "fixed", "delivery": {"kind": "commit" | "pr" | "deploy", "ref"}}, {"id", "outcome": "dismissed" | "open", "reason"}, {"id", "outcome": "explained", "answer"}]} (logika resolve): every claimed item exactly once, or the whole resolution is refused, naming the problem. explained is for an insight a member asked about. Fixed items close at once; dismissing a change finding widens that series' threshold. The resolution ends the run, is shown in each item's history and is emailed in the thread that announced the items (never a Why?'s answer, which shows on the insight). One filed after its run ended is accepted (late: true) while no run has claimed its items since, else refused with 409.
POST/monitor/heartbeatLogika Monitor, about every 30s: {monitor_id, version, agent_command?, agents?: [{run, alive, exit?, cost_usd?}], launch?}. While an agent it launched is alive its run holds, with no time limit; one that exits without resolving ends its run (exit.kind: launch_failed, auth_failed, timed_out or no_report) and its items return to the queue. Answers {launch, round_up}: a run to launch the agent for when there is work, which works one environment with that environment's agent settings, and the runs past their environment's time limit, whose agents are asked to round up. A member past their spending limit is given nothing.
ActionBodyValid forEffect
nopreason (required from a token)issue, insight, feedbackdismissed: not a real problem, the reason kept in the item's history; for a change finding it widens that series' threshold. There is no mute: a condition that should not fire is a ledger edit.
requestnoneopen insight, open feedback, agent-fixable account item (console session only)asks your own agent to work it: Why? on an insight, a session of its own that only explains it; Fix it on the others, which starts your agent as POST /queue/wake does. Runs take only open issues on their own.

Fixing is the agent's: it claims items and resolves them. An issue is open, claimed, fixed or dismissed, and keeps counting occurrences whatever its state. A fixed or dismissed issue that recurs on an app version first seen after it was closed returns to open as a regression (a change regression by the app version it blames). An issue's check is what raised it: event (anything judged on single sightings of one event), rule, invariant, error (any span that closed with an error status, or a log record with an exception or an ERROR or FATAL severity, whatever the ledger declares), liveness or change (a regression: worse on one app version, or since a deploy). Every other change finding (volume, conversion, typical values, environments compared, rates that moved with no version to blame) is an item of kind insight, with the same evidence; runs never take one unless someone asks (request), and one that comes back after a quiet day is raised anew, its sweep the pass that began it. Feedback closes as resolved when the nightly check finds it gone; an account item resolves itself when its condition clears, or goes stale.

Status

MethodPathNotes
GET/project/statusWhat is pending, per environment (open issues, insights, feedback and account items, each counted with the newest titles), the deployed ledgers, where the agent stands, the enhancer versions sending that are behind or unsupported, and, while a project's history is being restored, since when it is available (logika query).

Data

MethodPathNotes
GET/journey/{span_id}The span tree around an id: ancestors, siblings, children, each span with the log records emitted in it, and the trace's OTel span links into other traces, both ways, as weak edges.
POST/query{sql, limit} over the views events, logs, metrics, series, entities, entity_days, funnels, milestones, and one view per event the newest version of each ledger declares, named by its full path ("checkout.captured"), with its params as columns. Sandboxed, read-only, one result set; a few run at once per project and the rest wait briefly. Every view carries its environment, so filter by it. With x-logika-pii-key, values encrypted under your PII key read as plaintext for that one query.

Analytics

All take from, to, env and optional app_version, and are current to the last evaluator pass. env is required when the project has more than one environment (analytics never mix them) and implied when it has one. Windows are clipped to what is stored, and a bucket finer than what is kept that far back is answered at the next coarser one. Identity data (actives, retention, funnels, milestones) is kept 13 months: a window reaching further back is answered from the first day kept, which the answer names (kept_from). A breakdown by a param not marked dimension (or actives and retention of one not marked identity) is an error saying to mark it.

MethodPathAnswersParameters
GET/analytics/serieshow much, how often it fails, how slow, totals and sizes, over timeevent, show (repeatable), bucket (5m, hour, day), compare (app_version, env, or currency for sums and averages)
GET/analytics/breakdownwhich values of a dimension dominateevent, by
GET/analytics/activesdistinct identities per periodidentity, window (day, week, month); with app_version, the identities active on that version
GET/analytics/retentiondo they come backidentity, cohort (week, month); with app_version, the cohorts of that version's users
GET/analytics/funnelof those who did A, how many reached Bname; per entry day, who entered and reached each step, conversion, and entries whose window is still open
GET/analytics/milestonehow long until they do X after Yname, cohort (day, week, month); started, reached, the median time and its distribution

show takes volume, error_rate, anomaly_rate, p50, p90, p95, p99, sum:<param>, avg:<param> and hist:<param>. anomaly_rate is the share of the event's sightings with any evaluator finding: a failed check, a missing param, a path, an error, a timeout or a flagged event. The evaluator counts them after the data is stored, so the last few buckets can still change as timeouts are judged, or as a late close withdraws one. "Is anything unusual?" has no endpoint: its findings are in the queue, regressions as issues of check change and everything else as insights (GET /queue?kind=insight).

Ledgers and project

MethodPathNotes
POST/ledger/sync{ledger, components?, config?, branch?, head?, fork?, snapshot?} (logika sync): validates the ledger against the deployed history and freezes it as a new version when its fingerprint is new, with the backfill of new declarations; keeps the components, exclude, config and snapshot, and the file as sent. Answers the version, whether it was created, warnings, backfills and synced_at.
GET/ledger/syncWhat the latest sync of a ledger (?ledger=shop; each repository of a project syncs its own) sent of logika.json, with its branch, commit and fork point, for the next logika sync to merge against.
GET/ledgersNames and current versions.
GET/ledgers/{name}The current ledger and its version history.
GET/ledgers/{name}/{version}One immutable version.
POST/ledgers/{name}/validateDry run, no freeze.
POST/project/judgelogika test and logika replay: a local capture judged alone, a replay's changes applied first, by the ledger sent with it, synced or not: the issues a pass would raise with their evidence, open spans, pending rules, events never seen, undeclared names. Nothing is stored. At most 10 MiB as sent (zstd or gzip) and 64 MiB decompressed; about 10 a minute per user.
POST/replaylogika replay of stored data: the spans a SQL condition over events selects, with their whole traces, changed as asked and judged by the ledger sent, as a capture is. The condition runs in /query's sandbox. At most 1,000 traces and 50,000 spans. Nothing is stored
GET PATCH DELETE/projectEverything about the project, with the latest sync; owners change its name, the agent's repository and each environment's settings; delete it. Deleting cancels: the subscription ends with its paid period (within 14 days of its first payment, at once, withdrawing from the contract) and the project goes on a 30-day notice, fully operational, after which its data, backups and rows are deleted.
POST/project/renewAn owner keeps a project on notice, with no checkout: a free project at once; a cancelling subscription is resumed; an unpaid invoice is paid, or an ended subscription started again, on the saved payment method. When the card is declined or the bank asks for confirmation it answers {renewed: false, portal_url}, the billing portal where that is settled. A project withdrawn from renews only as a new order: with the buyer's acknowledgment, from the console, it answers checkout_url.
GET POST/project/membersList, each member with the environments they are emailed about; invite {email, role, environments} (editor or viewer; Team and Business).
GET PATCH/project/membershipYour own: the environments you are emailed about, and your soft monthly spending limit in the project, across all its environments, with this month's spending ({environments, limit: {spend_limit_usd, spent_usd, limit_reached}}); change {environments?, spend_limit_usd?, clear_spend_limit?} from the console or with your token (logika api membership set); your agent changes them only when you ask it to. Past the limit your monitor starts nothing in the project until the month turns or you raise it.
PATCH DELETE/project/members/{id}Owners: change a role (owner, editor or viewer; a project keeps one owner); remove a member or withdraw an invite. Members are listed with their names.
POST/project/members/{id}/resendOwners: email a pending invite again, with a fresh link valid for 7 days.
POST/project/members/{id}/resubscribeOwners: {environments}: email a member whose address bounced or was blocked again, about those environments, once the address is fixed. A spam report or an unsubscribe is the member's own to undo, by choosing their environments again.
GET/project/emailsOwners: the emails sent about the project in the last 90 days, newest first, each with the email provider's delivery reports, and the members' and invitees' addresses Logika no longer emails.
GET POST/project/environmentsList, each with its SDK keys, the agent's settings, retention, what the last nightly pass kept and its subscribers; add {name, copy_from?} (editors and owners), copy_from naming an environment whose agent settings and your emails it takes.
PATCH DELETE/project/environments/{name}Owners: rename it; set retention_days (at most the tier's, at least 2; null for the tier's); set the agent's settings for it: wake (auto, on_request or never), agent ({kind: claude | codex | custom, config_dir?, command?}), delivery (pr, deploy or custom with your instructions) and run_limit_minutes (1 to 1440; the agent is asked to round up, never stopped). Delete one with no live SDK keys, with its data.
GET POST/project/sdk-keysList; create {ledger, env, label}: env is created if the project has none of that name, and is default when omitted.
DELETE/project/sdk-keys/{id}Revoke.
GET/project/tokensYour own tokens in the project, with last use.
DELETE/project/tokens/{id}Revoke one of your tokens; it stops working at once.
DELETE/project/tokenRevoke the token making the request, as logika logout does.
GET/project/healthThe latest health snapshot, with a short history and the last 24h of declared events hour by hour.
GET POST/usageGET: stored bytes, effective window, retention, quota, ingest rate, throttling. POST: Logika Monitor's daily counts of how the CLI was used in the project, only once someone on the machine said yes to sharing usage statistics (never task text, file paths or code).
POST/reportslogika report: a message to Logika's makers, {text, cli_version, os}, the text at most 10 KiB. With a user's token it names the sender and project; without one, or with an SDK key or wake link, it is anonymous. Ten in a burst, then one every six minutes. Answers its reference, rp_….
GET/project/plansEvery plan, with whether the project can move there and, when it can't, why in plain words (too many people, too much stored, the free demo from a paid plan).
GET/project/plans/{tier}/previewOwners: what moving there costs: due now (a move up, prorated for the rest of the period), then each month, and when it takes effect (a move down: at the period's end).
GET/project/billingTier, a pending move down and when it takes effect, whether a subscription pays and whether it is cancelling, the payer, the notice if the project is on one (why, since when, the deletion date), its first payment, until when it can be withdrawn from, and its withdrawal.
POST/project/tierChange to a paid tier: in place with a subscription (a move up at once, its prorated difference charged to the saved card; a move down at the end of the paid period, nothing charged now), else through checkout, which opens only with the buyer's acknowledgment to start at once, keeping the 14-day right of withdrawal. A downgrade is refused, with the numbers, unless the project fits: its members and pending invites within the seats, and what it stored over the last 30 days within the quota.
POST/project/billing/portalThe project's own billing portal (payment method, invoices, cancellation), for any owner.
POST/project/withdrawWithdraw from the project's contract within the 14 days after the day of its first payment, from the console (any cancellation within those days does the same): the subscription is cancelled, every payment of those days refunded (the first and any move up since, in full once per account; after that the unused days to a consumer, nothing to a business), the withdrawal acknowledged by email, and the project put on the 30-day notice.

Account

Console only, with a browser session: /account (GET, DELETE, and PATCH {name, news}: news, occasional news about Logika by email), /account/projects (GET lists by last activity, a project on notice with its deletion date; POST creates {name, tier} through checkout, each paid project its own payment customer; prices exclude VAT, and checkout collects a VAT number), /account/sessions (GET; DELETE signs out every other session, /account/sessions/{id} one), /account/tokens (POST: the console's half of logika login, a single-use code valid 10m, which the CLI exchanges at /auth/token; refused to a viewer) and /account/invites (POST {token}: accept an invite, only with the invited address verified).

Deleting an account is never refused, and is a shorthand: it cancels every project the person is the only owner of, each going on the 30-day notice, and deletes the account after 30 days; projects with another owner carry on untouched. /account/deletion (GET) names the projects it would cancel. Signing back in within the 30 days shows when the account will be deleted (deletion_at on /account), and /account/keep (POST) keeps it, with the free project; each paid project is kept by renewing it. Deleting the account revokes its tokens; after keeping it, run logika login again.

A missed payment or a cancellation never refuses ingest or stops evaluation: the project stays fully operational on its 30-day notice, every owner is reminded on days 3, 7, 14 and 29 (not for a cancellation made on purpose), and on day 30 it is deleted and every owner told.

Sign-in runs on app.logika.host, so the session cookie stays on the console's origin: /auth/{provider}/start, /auth/callback/{provider} and /auth/logout, for the providers github and google.

Stripe delivers its signed billing events to /stripe/webhook on api.logika.host, and the email provider its delivery reports to /email/webhook. Every email ends with an unsubscribe link, /unsubscribe?token=… in the console, and carries one-click unsubscribe headers that post to /email/unsubscribe: it needs no sign-in, and stops every email Logika sends to that address.