Skip to content

Developers · Data

Exporting Data

Last updated 2 November 2026

You can export data using either the CLI or the raw export API. This method can be helpful when test data is needed for a service, e.g. in a staging environment.

Data export with the CLI

The Insites CLI tool features the command. Its options are listed below:

  • : The file path where the CLI saves the exported data. The default is data.zip.
  • : By default, export will use the autogenerated for the field. When this option is set, it will use the normal from the object.

Under the hood, the CLI uses the export API described in the next section. However, using the CLI provides some significant benefits:

  • Leveraging the CLI's authentication mechanism (i.e. you don't need to send your authentication token manually).
  • Writing downloaded data directly to the file system.

Example:

insites-cli data export --path=export.zip production

Data export using CSV files

The CLI exports a ZIP archive of CSV files by default. With no , it saves the file as data.zip. The option is already on, so this command gives the same result:

insites-cli data export --zip --path=data.zip production

Data export with raw export API

Our CLI uses the HTTP API to schedule an export task. Once it is finished, you can download the data.

curl -d @data.json 
  -H 'Content-Type: application/json' 
  -H 'Authorization: Token [YOUR API TOKEN]' 
  -X POST https://example.com/api/app_builder/exports
curl -H 'Content-Type: application/json' 
  -H 'Authorization: Token [YOUR API TOKEN]' 
  https://example.com/api/app_builder/exports/[export_id]?csv_export=true

Data export with GraphQL

It is possible to export data with GraphQL queries. Use for users and for the records of a table. Pass the table name in the variable. Each query returns one page of results; increase until you reach .

query export_data($table: String!, $page: Int = 1) {
  users(per_page: 100, page: $page) {
    total_pages
    results {
      id
      email
      first_name
      last_name
      created_at
      properties
    }
  }
  records(per_page: 100, page: $page, filter: { table: { value: $table } }) {
    total_pages
    results {
      id
      table
      user_id
      created_at
      properties
    }
  }
}