POST
/
v1
/
tables
/
{name}
/
data
/
merge
Merge-Insert (Upsert) Data
curl --request POST \
  --url https://{db}.{region}.api.lancedb.com/v1/tables/{name}/data/merge \
  --header 'Content-Type: application/vnd.apache.arrow.stream' \
  --header 'x-api-key: <api-key>'
This response does not have an example.

Authorizations

x-api-key
string
header
required

Path Parameters

name
string
required

name of the table

Query Parameters

on
string
required

The column(s) to match on for determining insert/update/delete operations. Should be a unique identifier or primary key for reliable upsert behavior.

Example:

"id"

when_matched_update_all
boolean
required

Whether to update all columns when a matching record is found in the target table. Set to true for full record updates, false to skip updates.

when_matched_update_all_filt
string | null

Additional filter to apply when updating matched records. Only records matching both the on condition and this filter will be updated.

Example:

"category = 'shoes'"

when_not_matched_insert_all
boolean
required

Whether to insert all columns when no matching record is found in the target table. Set to true for inserting new records, false to skip inserts.

when_not_matched_by_source_delete
boolean
required

Whether to delete records in the target table that don't exist in the source data. Useful for keeping tables synchronized with external data sources.

when_not_matched_by_source_delete_filt
string | null

Additional filter to apply when deleting unmatched records. Only records matching this filter will be deleted if not present in source.

Example:

"category = 'shoes'"

Body

application/vnd.apache.arrow.stream · file

Arrow IPC stream buffer

The body is of type file.

Response

200

Merge-insert successful