Skip to content

Developers · GraphQL

GraphQL Importing/Exporting Queries

Last updated 1 November 2026

The data_exports query: arguments, the fields of an export, and how to check when one is done.

One query reads data exports: data_exports. Use it to check whether an export you started has finished, and to get the link to its file. Exports are created with the data_export mutation or with insites-cli data export.

data_exports

data_exports(
  page: Int = 1
  per_page: Int = 20
  filter: DataExportsFilterInput
  sort: [DataExportsSortInput!]
): DataExportCollection!
ArgumentTypeMeaning
pageIntPage number, starting at 1. Default 1
per_pageIntResults per page, greater than 0. Default 20
filterDataExportsFilterInputConditions on id, created_at and updated_at, combined with AND
sort[DataExportsSortInput!]Sort by id, created_at or updated_at, after the default newest-updated first

What each export holds

FieldMeaning
idThe id of the export task
statuspending, done or failed
urlThe zip of CSV files. Empty until the status is done
created_atWhen the export was created
updated_atWhen it last changed

The collection also has total_entries, total_pages, current_page, per_page, has_next_page and has_previous_page.

Example: check one export

After data_export returns an id, read that export until it is done:

app/graphql/exports/status.graphql

query export_status($id: ID!) {
  data_exports(per_page: 1, filter: { id: { value: $id } }) {
    results { id status url }
  }
}

To list recent exports, filter on the date. A date without a time covers the whole day in UTC:

Query

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

Response on the docs instance

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

The second query ran read-only on the docs.insites.io instance on 1 November 2026. Add filter: { created_at: { gte: "2026-11-01" } } to limit it to one day onward.

Common mistakes

  • Expecting a file the moment the export starts. Poll until status is done.
  • Treating failed as pending forever. Stop polling and start a new export.
  • Forgetting that data_export_delete removes the file for good.