Recommended: One-step bulk upsert
The easiest way to bulk upsert is to use the SDK’s one-step method. The client uploads your documents to the presigned URL and completes the bulk upsert for you (up to 200MB). Document field names are preserved as supplied in every SDK. The examples usedense_vector and sparse_vector; configure indexes with those same names to search these values.
"Upsert request is accepted". Documents are processed asynchronously and become searchable after indexing completes.
Two-step: Get presigned URL, then upload and complete
If you need to control the upload yourself (e.g. from a different process or storage), use this flow: (1) get bulk upsert info, (2) upload the payload with every returned signed header, then (3) call the bulk-upsert API with theobjectKey.
Both REST control calls accept a branch. Use the same branch for the upload-URL request and the completion request; omitting it in both places writes to main.
The uploaded object is bound to that branch’s write stream. Do not reuse its key for another branch or after deleting and recreating the original branch. The REST completion request’s type field is optional; the examples use "application/json". The server validates the uploaded object’s Content-Type, not this request field. Setting type does not replace sending the required Content-Type header during upload.
Step 1: Get bulk upsert information
Step 2: Upload to presigned URL and call bulk-upsert
Upload the document list as JSON to theurl. Set Content-Type to the returned type and include every entry in the returned headers map, then call the bulk-upsert API with the objectKey from step 1. Do not drop, rename, or recompute signed headers.
The Python tab below is a complete alternative to its Step 1 snippet: it obtains a fresh upload URL, uploads, and completes the import inside one client context. Run it on its own so the client remains open through completion. The TypeScript, Go, and cURL tabs continue from Step 1.
For the manual Python upload, also install requests with pip install requests.
type and headers response values. Always set Content-Type from type and use the exact signed header names and values returned for that upload URL.
Upload retries
The signed upload is create-only (If-None-Match: *). Uploading again to an object that already exists can return 412 from object storage. This is not a LambdaDB JSON error. Acquire a new URL for a new upload attempt rather than blindly repeating the same PUT. If the upload or completion outcome is uncertain, verify the prior outcome before automatically submitting another import.
For browser uploads, the target deployment’s CORS configuration must allow the returned signed headers. Use the returned httpMethod and enforce sizeLimitBytes.
Response
After successful bulk upsert initiation you’ll receive:Bulk upsert operations are processed asynchronously in the background.
Consequently, newly uploaded documents may not be immediately available for search or fetch requests,
even if
consistentRead (Python: consistent_read) is set to true.
The documents will become available only after the indexing process is fully complete.