Skip to content
Kokumi

Umami and Plausible importer

Live

Bring your historical daily aggregates from Umami or Plausible when you switch to Kokumi. Validate exports locally with --dry-run, then upsert them into D1 in idempotent batches.

Umami and Plausible CSV and JSON importer via kokumi import and POST /api/v1/import.

Preview Umami and Plausible exports before writing a row

The importer accepts Umami and Plausible CSV or JSON exports via kokumi import. Run with --dry-run first to catch malformed rows before sending anything to your Worker.

  • Supports umami and plausible CSV and JSON exports.
  • Upserts daily aggregates directly into the D1 visits table.
  • Returns exit code 2 (bad_usage) on invalid flags or arguments before making network calls.
sh
kokumi import plausible --file export.csv --dry-run

Chunked, retry-safe API ingestion

Under the hood, POST /api/v1/import accepts up to 500 rows per batch under write scope. Attach a unique Idempotency-Key per chunk so retrying a failed upload never double-counts your history.

  • Payload contract: { source: "umami" | "plausible", rows[<=500] }.
  • Identical chunk retries return 200 with x-idempotent-replay: true.
  • Cross-route key reuse fails loudly with HTTP 409.
sh
curl -sS -X POST -H "Authorization: Bearer $WRITE_TOKEN" -H "Idempotency-Key: import-batch-01" -d '{"source":"plausible","rows":[]}' https://example.com/api/v1/import