Import & Export
Bulk import documents from JSON, CSV, or NDJSON files, and export entire collections.
info
Plan Limits
Free: 5 MB import / 1,000 docs. Pro: 50 MB import / 10,000 docs. Export: Free 1,000 docs, Pro 100,000 docs.
POST
/v1/db/{ns}/{collection}/_importBulk import documents from JSON, CSV, or NDJSON.
Content Types
| Content-Type | Format |
|---|---|
application/json | JSON array of objects |
text/csv | CSV with header row |
application/x-ndjson | Newline-delimited JSON (one object per line) |
Query Parameters
| Param | Default | Description |
|---|---|---|
onConflict | fail | Conflict strategy: fail, skip, or overwrite |
idField | _id | Which field to use as the document ID |
curl -X POST "https://api.jsondb.cloud/v1/db/default/users/_import?onConflict=skip" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{ "name": "Alice", "email": "[email protected]" },
{ "name": "Bob", "email": "[email protected]" }
]'Import Response
{
"imported": 2,
"skipped": 0,
"errors": [],
"total": 2
}GET
/v1/db/{ns}/{collection}/_exportExport all documents in a collection.
Accept Header
The export format is determined by the Accept header:
| Accept | Output |
|---|---|
application/json | JSON array (default) |
text/csv | CSV with header row |
application/x-ndjson | Newline-delimited JSON |
curl https://api.jsondb.cloud/v1/db/default/users/_export \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-o users.jsoninfo
Filtering Exports
You can use the same filter query parameters as the list endpoint to export a subset of documents. For example:
?filter[status]=active.CSV Notes
- String values that look like numbers or booleans are auto-coerced during import (e.g.,
"42"becomes42,"true"becomestrue). - Quoted fields with commas, newlines, and escaped quotes are supported.
- Nested objects are flattened to dot-notation columns during export (e.g.,
address.city).