
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe easiest and quickest way to import data into your Sanity project depends on what you're importing, but here are your main options:
If you have data in NDJSON format (newline-delimited JSON), the CLI import command is your fastest route:
sanity dataset import <file> <targetDataset>For example:
sanity dataset import my-data.ndjson productionKey things to know:
_type field (and optionally an _id)_sanityAsset property: "image@file:///path/to/image.jpg" or "image@https://example.com/image.jpg".ndjson files or .tar.gz archives (which include assets)Useful flags:
--replace - Overwrites existing documents with the same _id--missing - Only creates documents that don't exist yet--allow-failing-assets - Continues import even if some assets failRun sanity dataset import --help to see all options.
If you need more control or are importing from a custom source, you can use the Sanity JavaScript client with methods like client.create() or client.createOrReplace().
Important considerations when using the client:
deferred for large importsFor a single link/document, you could also just create it directly in Sanity Studio if it's a one-off!
What type of data are you looking to import? That'll help determine the best approach.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store