Home/Documentation

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}/_import

Bulk import documents from JSON, CSV, or NDJSON.

Content Types

Content-TypeFormat
application/jsonJSON array of objects
text/csvCSV with header row
application/x-ndjsonNewline-delimited JSON (one object per line)

Query Parameters

ParamDefaultDescription
onConflictfailConflict strategy: fail, skip, or overwrite
idField_idWhich 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}/_export

Export all documents in a collection.

Accept Header

The export format is determined by the Accept header:

AcceptOutput
application/jsonJSON array (default)
text/csvCSV with header row
application/x-ndjsonNewline-delimited JSON
curl https://api.jsondb.cloud/v1/db/default/users/_export \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -o users.json
info

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" becomes 42, "true" becomes true).
  • Quoted fields with commas, newlines, and escaped quotes are supported.
  • Nested objects are flattened to dot-notation columns during export (e.g., address.city).