API reference

Documents

Write, update, delete, read, import.

Kept in this tab only and sent only to api.skimmerdb.com. Requests run against your account and count as usage. Make a key.

Write documents

POST /v1/namespaces/{name}/docs metered: write

Put (insert or replace) and delete in one request. Answers once the write is stored in object storage (about 250 ms); searchable on this server at once, everywhere within a second; wait: true answers once it's searchable here. A namespace that doesn't exist is made by the write (created: true in the answer): with vectors of the first vector's length and cosine when the documents have vectors, else text only (create it first for euclidean); past the plan's namespace count, 402 namespace_limit. Metered as documents written and bytes written (see Usage). With Content-Type application/x-ndjson the body is one document a line (up to 16 MB; any length: POST .../docs/stream).

Parameters

namestring · pathrequiredThe namespace's name.
waitboolean · queryNDJSON bodies: answer once the last batch is searchable.
Idempotency-Keystring · headerMakes a retry safe: the same key and request within 24 hours is done once, and later tries get the first answer (a different request with the key: 422 idempotency_mismatch; while the first runs: 409).

Body application/json

docsDocument[]Documents to put (insert or replace).
docs[].idstringrequiredAny string up to 512 bytes, one line (slashes allowed). Writing an id again replaces the document, so use a stable natural key (ticket-1042, docs/install.md#3, agent-1/run-42/step-3): retries are then safe.
docs[].textstringWhat q searches (exact text and regex): up to 2 MB. May be left out when the document has a vector.
docs[].metaobjectMetadata: a JSON object of strings, numbers and booleans you filter, group and sort by (up to 16 KB); its top-level keys are SQL columns. Keep it flat (nested objects and arrays can't be filtered), one type per key, times as integer seconds (ranges and DATE_TRUNC need numbers). Not searched by q: put searchable words in text.
docs[].vectornumber[]An embedding: as many numbers as the namespace's dims.
docs[].vector_b64stringThe vector as base64 of little-endian float32s (smaller than JSON numbers).
docs[].if_versionstringWrite only if this document is still at this version (a read's version): otherwise nothing in the request is written (409 version_conflict).
docs[].if_absentbooleanWrite only if no document has this id yet. Default false.
deletesstring[]Ids to delete.
if_versionsmap of string | nullMore conditions, by id (deletes' too): the version it must still be at, or null: it must not exist. Any that doesn't hold: nothing is written (409 version_conflict).
waitbooleanAnswer only once the write is searchable on this server (it is durable either way). Default false.

Answer

took_msintegerNDJSON streams: milliseconds.
linesintegerNDJSON streams: lines read.
batchesintegerNDJSON streams: batches written.
createdbooleanThe namespace didn't exist: this write made it (with vectors of the first vector's length, cosine, when the documents have vectors; else text only). Check it to catch a mistyped name.
versionsmap of stringwait: true (up to 1,000 documents): each written document's new version, by id.
writteninteger
deletedinteger
versioninteger
stored_bytesinteger

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
409Exists already, or not possible in this state.
413Too big: a request's documents (64 MB), an import (2 GB), or what a SQL query would read.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
502Billing (Stripe) is unavailable right now.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
507The tenant's storage quota is full.
curl -s https://api.skimmerdb.com/v1/namespaces/support/docs \
  -H "Authorization: Bearer $KEY" \
  -d '{"wait":true,"docs":[{"id":"t-1","text":"Refund requested for order ACME-1042","meta":{"status":"open","priority":3}},{"id":"t-2","text":"Login fails with error E401 on mobile","meta":{"status":"closed","priority":1}}]}'
from skimmerdb import SkimmerDB
from skimmerdb._api.api.documents import write_documents
from skimmerdb._api.models import WriteRequest

db = SkimmerDB()  # SKIMMERDB_KEY
answer = write_documents.sync("support", client=db.api, body=WriteRequest.from_dict({"wait":True,"docs":[{"id":"t-1","text":"Refund requested for order ACME-1042","meta":{"status":"open","priority":3}},{"id":"t-2","text":"Login fails with error E401 on mobile","meta":{"status":"closed","priority":1}}]}))
import { SkimmerDB } from "skimmerdb";
import { writeDocuments } from "skimmerdb/api";

const db = new SkimmerDB(); // SKIMMERDB_KEY
const { data } = await writeDocuments({ client: db.client, path: { name: "support" }, body: {"wait":true,"docs":[{"id":"t-1","text":"Refund requested for order ACME-1042","meta":{"status":"open","priority":3}},{"id":"t-2","text":"Login fails with error E401 on mobile","meta":{"status":"closed","priority":1}}]} });
200 answer
{
  "written": 2,
  "deleted": 0,
  "version": 3,
  "stored_bytes": 2817,
  "created": false
}

Update documents

PATCH /v1/namespaces/{name}/docs metered: write

Text replaced if given, meta merged key by key (null removes a key), the vector kept unless a new one is given. The documents must exist. Metered as documents written and bytes written (see Usage).

Parameters

namestring · pathrequiredThe namespace's name.
Idempotency-Keystring · headerMakes a retry safe: the same key and request within 24 hours is done once, and later tries get the first answer (a different request with the key: 422 idempotency_mismatch; while the first runs: 409).

Body application/json

docsDocumentPatch[]required
docs[].idstringrequired
docs[].textstringReplaces the text (kept when left out).
docs[].metaobjectMerged key by key; a null value removes the key.
docs[].vectornumber[]An embedding: as many numbers as the namespace's dims.
waitbooleanDefault false.

Answer

took_msintegerNDJSON streams: milliseconds.
linesintegerNDJSON streams: lines read.
batchesintegerNDJSON streams: batches written.
createdbooleanThe namespace didn't exist: this write made it (with vectors of the first vector's length, cosine, when the documents have vectors; else text only). Check it to catch a mistyped name.
versionsmap of stringwait: true (up to 1,000 documents): each written document's new version, by id.
writteninteger
deletedinteger
versioninteger
stored_bytesinteger

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
409Exists already, or not possible in this state.
413Too big: a request's documents (64 MB), an import (2 GB), or what a SQL query would read.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
502Billing (Stripe) is unavailable right now.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
507The tenant's storage quota is full.
curl -s -X PATCH https://api.skimmerdb.com/v1/namespaces/support/docs \
  -H "Authorization: Bearer $KEY" \
  -d '{"docs":[{"id":"t-1","meta":{"status":"closed","priority":null}}],"wait":true}'
from skimmerdb import SkimmerDB
from skimmerdb._api.api.documents import update_documents
from skimmerdb._api.models import UpdateRequest

db = SkimmerDB()  # SKIMMERDB_KEY
answer = update_documents.sync("support", client=db.api, body=UpdateRequest.from_dict({"docs":[{"id":"t-1","meta":{"status":"closed","priority":None}}],"wait":True}))
import { SkimmerDB } from "skimmerdb";
import { updateDocuments } from "skimmerdb/api";

const db = new SkimmerDB(); // SKIMMERDB_KEY
const { data } = await updateDocuments({ client: db.client, path: { name: "support" }, body: {"docs":[{"id":"t-1","meta":{"status":"closed","priority":null}}],"wait":true} });

Stream documents in (NDJSON)

POST /v1/namespaces/{name}/docs/stream metered: write

Any number of documents in one request: one a line ({"id", "text", "meta", "vector"}, as in docs), read as it arrives and written in batches of 50,000 documents (or 16 MB) through the ordinary write path (limits, embedding, metering; the namespace made on the first batch). When the namespace's log can't keep up the stream is slowed (the body isn't read), not refused. Each batch is atomic, the stream isn't: an error stops it and the answer (or the error, with written) says how many were written before it; writes are by id, so sending it again is safe. Memory on the server: one batch. Metered as documents written and bytes written (see Usage).

Parameters

namestring · pathrequiredThe namespace's name.
waitboolean · queryAnswer once the last batch is searchable.

Body application/x-ndjson

Answer

took_msintegerNDJSON streams: milliseconds.
linesintegerNDJSON streams: lines read.
batchesintegerNDJSON streams: batches written.
createdbooleanThe namespace didn't exist: this write made it (with vectors of the first vector's length, cosine, when the documents have vectors; else text only). Check it to catch a mistyped name.
versionsmap of stringwait: true (up to 1,000 documents): each written document's new version, by id.
writteninteger
deletedinteger
versioninteger
stored_bytesinteger

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
413Too big: a request's documents (64 MB), an import (2 GB), or what a SQL query would read.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
507The tenant's storage quota is full.
curl
curl -s -X POST "https://api.skimmerdb.com/v1/namespaces/support/docs/stream" \
  -H "Authorization: Bearer $KEY" \
  --data-binary @tickets.csv
200 answer
{
  "written": 120000,
  "deleted": 0,
  "version": 9,
  "stored_bytes": 9817221,
  "batches": 3,
  "lines": 120000,
  "created": false,
  "took_ms": 2410
}

Delete documents

POST /v1/namespaces/{name}/delete metered: write

Parameters

namestring · pathrequiredThe namespace's name.
Idempotency-Keystring · headerMakes a retry safe: the same key and request within 24 hours is done once, and later tries get the first answer (a different request with the key: 422 idempotency_mismatch; while the first runs: 409).

Body application/json

idsstring[]required
if_versionsmap of string | nullMore conditions, by id (deletes' too): the version it must still be at, or null: it must not exist. Any that doesn't hold: nothing is written (409 version_conflict).
waitbooleanDefault false.

Answer

took_msintegerNDJSON streams: milliseconds.
linesintegerNDJSON streams: lines read.
batchesintegerNDJSON streams: batches written.
createdbooleanThe namespace didn't exist: this write made it (with vectors of the first vector's length, cosine, when the documents have vectors; else text only). Check it to catch a mistyped name.
versionsmap of stringwait: true (up to 1,000 documents): each written document's new version, by id.
writteninteger
deletedinteger
versioninteger
stored_bytesinteger

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
409Exists already, or not possible in this state.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
curl -s https://api.skimmerdb.com/v1/namespaces/support/delete \
  -H "Authorization: Bearer $KEY" \
  -d '{"ids":["t-2"],"wait":true}'
from skimmerdb import SkimmerDB
from skimmerdb._api.api.documents import delete_documents
from skimmerdb._api.models import DeleteRequest

db = SkimmerDB()  # SKIMMERDB_KEY
answer = delete_documents.sync("support", client=db.api, body=DeleteRequest.from_dict({"ids":["t-2"],"wait":True}))
import { SkimmerDB } from "skimmerdb";
import { deleteDocuments } from "skimmerdb/api";

const db = new SkimmerDB(); // SKIMMERDB_KEY
const { data } = await deleteDocuments({ client: db.client, path: { name: "support" }, body: {"ids":["t-2"],"wait":true} });
200 answer
{
  "written": 0,
  "deleted": 1,
  "version": 4,
  "stored_bytes": 2817,
  "created": false
}

Get a document

GET /v1/namespaces/{name}/docs/{id} metered: query

One whole, with its vector. Ids may hold slashes (the rest of the path is the id). Counts as one query (metered; see Usage).

Parameters

namestring · pathrequiredThe namespace's name.
idstring · pathrequiredThe rest of the path (may hold slashes).

Answer

idstring
textstring
metaobject
vectornumber[]
versionstringWhere its current text was written (:): give it as if_version to change it only if nobody else has.
written_atstring
temperaturestringHow warm the namespace was: warm (open), local (opened from the server's disk) or cold (opened from object storage).
store_getsintegerObject-storage reads this query made (0 when warm).
store_bytesintegerBytes those reads fetched.
cpu_msnumberCPU the query used (metered, not billed).
timed_outbooleanThe query ran past the plan's time limit (query_seconds): the answer is partial.

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
curl -s https://api.skimmerdb.com/v1/namespaces/support/docs/t-1 \
  -H "Authorization: Bearer $KEY"
from skimmerdb import SkimmerDB
from skimmerdb._api.api.documents import get_document

db = SkimmerDB()  # SKIMMERDB_KEY
answer = get_document.sync("support", "t-1", client=db.api)
import { SkimmerDB } from "skimmerdb";
import { getDocument } from "skimmerdb/api";

const db = new SkimmerDB(); // SKIMMERDB_KEY
const { data } = await getDocument({ client: db.client, path: { name: "support", id: "t-1" } });
200 answer
{
  "id": "t-1",
  "text": "Refund requested for order ACME-1042",
  "meta": {
    "priority": 3,
    "status": "open"
  },
  "written_at": "2026-10-05T01:30:12Z",
  "temperature": "warm",
  "store_gets": 0,
  "store_bytes": 0,
  "cpu_ms": 0.03,
  "timed_out": false
}

Bulk import a file

POST /v1/namespaces/{name}/import metered: write

CSV, NDJSON or Parquet as the request body, or fetched from ?url= (https only: a presigned S3 / GCS URL or any public server; private, loopback, link-local and metadata addresses are refused, after redirects too), up to 2 GB, parsed straight into columns, in segments of up to 1M rows: all rows become visible together, or none. A namespace that doesn't exist is made by the import (text only; created: true). Metered as a write of that many documents and the file's bytes.

Parameters

namestring · pathrequiredThe namespace's name.
formatstring · queryThe file's format.
idstring · queryThe column holding document ids (default: row numbers).
textstring · queryColumns to index as text, comma-separated.
schemastring · queryCSV: a CREATE TABLE giving the columns' types (default: from the header, kinds inferred).
urlstring · queryFetch the file from this https URL (presigned S3 / GCS, or any public server) instead of the body.

Body application/octet-stream

Answer

writteninteger
deletedinteger
versioninteger
stored_bytesinteger
rowsinteger
took_msnumber
createdbooleanThe namespace didn't exist: this import made it (text only).

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
413Too big: a request's documents (64 MB), an import (2 GB), or what a SQL query would read.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
507The tenant's storage quota is full.
curl
curl -s -X POST "https://api.skimmerdb.com/v1/namespaces/support/import?format=csv&id=ticket&text=subject,body" \
  -H "Authorization: Bearer $KEY" \
  --data-binary @tickets.csv
200 answer
{
  "written": 2,
  "deleted": 0,
  "version": 5,
  "stored_bytes": 4096,
  "rows": 2,
  "took_ms": 12,
  "created": false
}

Import files from your bucket

POST /v1/namespaces/{name}/import/bucket metered: write

CSV, NDJSON or Parquet files read straight from your own bucket: AWS S3, or an S3-compatible service (Cloudflare R2, Backblaze B2, MinIO, Wasabi, Google Cloud Storage) given as s3.endpoint. One key, every file under a prefix, or a pattern (*.parquet), in key order: up to 100 files and 4 GB a request, each file up to 2 GB; next says where to go on (pass it as after). Each file is an import of its own (all its rows visible together); a failure stops the request and answers what was imported, the failing key (failed) and next. The keys are used for this request only, never stored; the endpoint's host must resolve to a public address. A namespace that doesn't exist is made (text only; created: true). Metered as writes of the documents and the files' bytes.

Parameters

namestring · pathrequiredThe namespace's name.

Body application/json

pathstringrequireds3://bucket/key (one file), s3://bucket/prefix/ (every file under it) or s3://bucket/prefix/*.parquet (those ending as the pattern after the *).
format"" | "csv" | "ndjson" | "parquet"Empty: from each file's extension (.csv, .ndjson / .jsonl / .json, .parquet). Default "".
idstringThe column holding document ids (default: row numbers).
textstring[]Columns to index as text.
schemastringCSV: a CREATE TABLE giving the columns' types.
afterstringOnly keys after this one (a previous answer's next). Default "".
s3S3KeysrequiredKeys for the tenant's own bucket, on AWS S3 or an S3-compatible service. Used while the request (or export) runs, never stored. Without access_key_id and secret_access_key, requests go unsigned: a public bucket (such as AWS Open Data), for reading only.
s3.regionstringThe bucket's region (auto for Cloudflare R2). Default "us-east-1".
s3.access_key_idstring
s3.secret_access_keystring
s3.session_tokenstring
s3.endpointstringAn S3-compatible service instead of AWS: an https URL of scheme, host and optional port, no path (requests are path-style). Cloudflare R2: .r2.cloudflarestorage.com with region auto; also Backblaze B2, MinIO, Wasabi, Google Cloud Storage's XML API (HMAC keys). Its host must resolve to a public address. Empty: AWS S3 in region. Default "".

Answer

filesBucketImportFile[]The files imported, in order (each committed on its own).
files[].keystring
files[].bytesinteger
files[].rowsinteger
files[].writteninteger
writteninteger
rowsinteger
bytesinteger
nextstringMore files remain: pass this as after. Empty: done.
took_msnumber
createdbooleanThe namespace didn't exist: this import made it (text only).

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
413Too big: a request's documents (64 MB), an import (2 GB), or what a SQL query would read.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
507The tenant's storage quota is full.
curl -s https://api.skimmerdb.com/v1/namespaces/support/import/bucket \
  -H "Authorization: Bearer $KEY" \
  -d '{"path":"s3://events/2026/10/*.parquet","id":"event_id","text":["message"],"s3":{"endpoint":"https://ACCOUNT_ID.r2.cloudflarestorage.com","region":"auto","access_key_id":"...","secret_access_key":"..."}}'
from skimmerdb import SkimmerDB
from skimmerdb._api.api.documents import import_bucket
from skimmerdb._api.models import BucketImportRequest

db = SkimmerDB()  # SKIMMERDB_KEY
answer = import_bucket.sync("support", client=db.api, body=BucketImportRequest.from_dict({"path":"s3://events/2026/10/*.parquet","id":"event_id","text":["message"],"s3":{"endpoint":"https://ACCOUNT_ID.r2.cloudflarestorage.com","region":"auto","access_key_id":"...","secret_access_key":"..."}}))
import { SkimmerDB } from "skimmerdb";
import { importBucket } from "skimmerdb/api";

const db = new SkimmerDB(); // SKIMMERDB_KEY
const { data } = await importBucket({ client: db.client, path: { name: "support" }, body: {"path":"s3://events/2026/10/*.parquet","id":"event_id","text":["message"],"s3":{"endpoint":"https://ACCOUNT_ID.r2.cloudflarestorage.com","region":"auto","access_key_id":"...","secret_access_key":"..."}} });
200 answer
{
  "files": [
    {
      "key": "2026/10/01.parquet",
      "bytes": 48210331,
      "rows": 1000000,
      "written": 1000000
    }
  ],
  "written": 1000000,
  "rows": 1000000,
  "bytes": 48210331,
  "next": "",
  "took_ms": 2140,
  "created": true
}

Sync a DuckLake table

POST /v1/namespaces/{name}/lake/sync metered: write

Keeps a table of your DuckLake (catalog in Postgres, data in your S3 bucket on AWS or an S3-compatible service such as R2 or MinIO) in the namespace, nothing copied by you: every live row a document (its id the key column's value; its text the text columns; its metadata the other columns and _rowid, the DuckLake row id). Each sync reads the catalog at a snapshot and writes only what changed since the snapshot synced before (inserts, updates, deletes, inlined rows, compactions); a change to the table's columns resyncs it whole. Run it after the lake's commits. The catalog URL and S3 keys are used for the sync only and never stored; the catalog's host must resolve to a public address. A namespace that doesn't exist is made (text only; created: true). Metered as writes of the documents upserted and deleted.

Parameters

namestring · pathrequiredThe namespace's name.

Body application/json

catalogstringrequiredThe lake's catalog: a postgres:// URL (DuckLake's Postgres catalog), reachable at a public address. Used for this sync only, never stored.
tablestringrequiredThe table: name (schema main) or schema.name.
keystringThe column whose value is a document's id. Default: id when the table has one, else the DuckLake row id; rowid: the row id. Default "".
textstring[]Columns whose values are the searchable text (default: every text column).
snapshotintegerThe snapshot to sync to (-1: the latest). Never older than the one synced. Default -1.
s3objectrequiredKeys that can read the lake's data_path (s3://...), on AWS or the endpoint given. Used for this sync only, never stored.
s3.regionstringrequiredDefault "us-east-1".
s3.access_key_idstringrequired
s3.secret_access_keystringrequired
s3.session_tokenstring
s3.endpointstringAn S3-compatible service instead of AWS: an https URL of scheme, host and optional port, no path (requests are path-style). Cloudflare R2: .r2.cloudflarestorage.com with region auto; also MinIO, Backblaze B2, Wasabi, Google Cloud Storage's XML API. Its host must resolve to a public address. Empty: AWS S3 in region. Default "".

Answer

snapshotintegerThe snapshot the namespace now holds.
previousintegerThe snapshot it held before (-1: none).
fullbooleanEvery live row was written (the first sync, or the table's columns, key or text changed).
upsertedinteger
deletedinteger
keystringThe key column (empty: row ids).
skippedstring[]Columns not kept (nested types, blobs).
took_msnumber
createdbooleanThe namespace didn't exist: this sync made it.

Status codes

200OK
400Malformed: not the JSON expected.
401No key, or an unknown or revoked one.
402The free plan's included usage this period is used up (queries, query CPU, object-storage reads, bytes returned, writes or storage; the message says which), or its namespace count or daily namespace creations are reached (code namespace_limit): upgrade to pro.
403The key's scope or namespaces don't allow it, or the tenant is suspended.
404No such namespace, document, key or tenant (or one this key may not see: the same answer).
409Exists already, or not possible in this state.
422Invalid: the message says why (code invalid with fields: which input fields; query_timeout: past the plan's time limit; scan_refused: send scan: true).
429Over the tenant's or the key's rate, concurrency or cap, or writes arriving faster than the namespace commits them (code write_busy): retry after Retry-After seconds.
503Object storage failed: retry (nothing was written, unless the code is write_unknown: then it may have been; retrying a write is safe).
507The tenant's storage quota is full.
curl -s https://api.skimmerdb.com/v1/namespaces/support/lake/sync \
  -H "Authorization: Bearer $KEY" \
  -d '{"catalog":"postgres://lake:secret@lake-catalog.example.com:5432/lake?sslmode=require","table":"main.tickets","text":["subject","body"],"s3":{"region":"us-east-1","access_key_id":"AKIA...","secret_access_key":"..."}}'
from skimmerdb import SkimmerDB
from skimmerdb._api.api.documents import sync_lake
from skimmerdb._api.models import LakeSyncRequest

db = SkimmerDB()  # SKIMMERDB_KEY
answer = sync_lake.sync("support", client=db.api, body=LakeSyncRequest.from_dict({"catalog":"postgres://lake:secret@lake-catalog.example.com:5432/lake?sslmode=require","table":"main.tickets","text":["subject","body"],"s3":{"region":"us-east-1","access_key_id":"AKIA...","secret_access_key":"..."}}))
import { SkimmerDB } from "skimmerdb";
import { syncLake } from "skimmerdb/api";

const db = new SkimmerDB(); // SKIMMERDB_KEY
const { data } = await syncLake({ client: db.client, path: { name: "support" }, body: {"catalog":"postgres://lake:secret@lake-catalog.example.com:5432/lake?sslmode=require","table":"main.tickets","text":["subject","body"],"s3":{"region":"us-east-1","access_key_id":"AKIA...","secret_access_key":"..."}} });
200 answer
{
  "snapshot": 42,
  "previous": 40,
  "full": false,
  "upserted": 120,
  "deleted": 3,
  "key": "id",
  "skipped": [],
  "took_ms": 380,
  "created": false
}