v2
Stream
Ingest JSON/NDJSON data into Ducklake
Ingest JSON/NDJSON data into Ducklake tables.
This endpoint accepts:
- JSON objects or arrays (Content-Type: application/json)
- NDJSON streams (Content-Type: application/x-ndjson)
- Optional compression with gzip or zstd (Content-Encoding: gzip|zstd)
Two modes are supported via config.mode:
- append (default): inserts rows into the target table.
- merge: atomic delete-then-insert keyed on config.primary_key (exactly one field for v2). Existing rows whose PK matches an incoming row are deleted; all incoming rows are then inserted. Within-batch duplicate PKs are rejected before any duckserver call.
Partitioning uses the table's existing partition spec.
Type-coercion notes:
- Values are inlined as SQL literals and CAST(... AS <target_type>) to the target column's type from DESCRIBE, so mixed-type input (e.g. an int and a string in the same VARCHAR column) inserts cleanly.
- Python bool values land via DuckDB's CAST semantics: TRUE/FALSE for BOOLEAN columns, lowercase 'true'/'false' for VARCHAR columns. Send a string if you need case preservation.
Authentication is required via API key or JWT token in Authorization header.
post/v2/stream
Request body
Response
Successful Response
Changes
No recorded changes to this endpoint across all 1 revision of this API.