Skip to main content

Import Data

Import JSON

POST /api/v1/records/import/json

Pass nested JSON — RushDB walks the structure and creates linked records automatically.

curl -X POST https://api.rushdb.com/api/v1/records/import/json \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "MOVIE",
"data": {
"title": "Inception",
"rating": 8.8,
"ACTOR": [
{"name": "Leonardo DiCaprio", "country": "USA"},
{"name": "Ken Watanabe", "country": "Japan"}
]
},
"options": {"suggestTypes": true}
}'

Options

OptionDefaultDescription
suggestTypestrueInfer property types automatically
convertNumericValuesToNumbersfalseConvert string numbers to number type
capitalizeLabelsfalseUppercase all inferred label names
relationshipType__RUSHDB__RELATION__DEFAULT__Relationship type for nested links
returnResultfalseReturn created records in the response. For imports exceeding 1000 records, this option is ignored and a summary object ({ message, count }) is returned instead.
mergeByFields to match on for upsert
mergeStrategyappendappend or rewrite

Import CSV

POST /api/v1/records/import/csv

curl -X POST https://api.rushdb.com/api/v1/records/import/csv \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "ACTOR",
"data": "name,country\nLeonardo DiCaprio,USA\nKen Watanabe,Japan",
"options": {"suggestTypes": true},
"parseConfig": {"header": true, "dynamicTyping": true}
}'

parseConfig options

OptionDefaultDescription
delimiter,Column separator
headertrueFirst row is header
skipEmptyLinestrueIgnore blank rows
dynamicTypingtrueAuto-convert numbers and booleans
quoteChar"Quote character
escapeChar"Escape character
newlineautoExplicit newline sequence

Upsert during import

curl -X POST https://api.rushdb.com/api/v1/records/import/json \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "ACTOR",
"data": [
{"name": "Leonardo DiCaprio", "country": "USA"},
{"name": "Ken Watanabe", "country": "Japan"}
],
"options": {"mergeBy": ["name"], "mergeStrategy": "append"}
}'

See also