Skip to content

Developers · GraphQL

GraphQL Importing/Exporting Overview

Last updated 18 November 2026

Export records and users to CSV, import them in bulk, and the CLI commands that do the same for a whole site.

The import and export operations move data in bulk. Export records or users to CSV files in a zip, or load many records or users into a site in one call. Use them for backups, for moving data between sites, and for loading data from another system.

The operations

OperationKindWhat it does
data_exportMutationStarts a background export of records, users or both. Returns the export with its status
data_exportsQueryLists exports, most recently updated first. A finished export holds the URL of its zip
data_export_deleteMutationPermanently deletes an export and its file
import_modelsMutationImports records in bulk. Each is updated if it matches, or created
import_usersMutationImports users in bulk, the same way

How an export works

  1. Start itdata_export selects records and users the same way the records and users queries do.
  2. Wait for itThe export runs in a background job. Its status is pending, then done or failed.
  3. Download itdata_exports returns the url of the zip once status is done.
An export is a background job, not an instant answer.

One export holds at most 5,000,000 records and 5,000,000 users. With split_files: true, the default, each table is split into files of at most 10,000 rows. Pass at least an empty object, such as records: {}, for that kind of data to be included.

Example: list the exports

Query

{
  data_exports(per_page: 3) {
    total_entries
    results { id status created_at url }
  }
}

Response on the docs site

{
  "data": {
    "data_exports": {
      "total_entries": 0,
      "total_pages": 1,
      "results": []
    }
  }
}

This ran read-only on the docs.insites.io site on 1 November 2026, which has no exports.

The CLI does the same for a whole site

insites-cli data export staging -p data.zip

data export, data import and data clean work on all the data on a site. There is no per-table option. data import reads a JSON file, or a zip archive with --zip.

Common mistakes

  • Reading url straight after data_export. It is empty until the status is done.
  • Leaving out records or users and getting an empty export.
  • Running insites-cli data clean to clear one table. It removes all data on the site and cannot be undone.
  • Pairing the ids import_users returns with the people you sent by position. They can come back in a different order; match on external_ids or email.