Skip to main content

Data Synchronization

Synchronizing a data type means to update the Qard database with the latest up-to-date data from the connected providers. When the synchronization is finished you can access the data without waiting.

To start synchronizing data from a user use the endpoint POST /api/v6/users/:userId/sync. If you dont specify a list of data types you want to synchronize, all data types will be synchronized for that user. If a data type has a dependency on another data type that is not asked for synchronization it will still be synchronized. When a data type is synchronized, a DataSync will be created for each connected providers that support this data type.

note

The first time you synchronize data for a user it may take hours to days depending on the volume of data and speed of the provider.

If you try to synchronize a data type that is already in progress (QUEUED or FETCHING) you will receive an error with status code 409

You can get the history of all data syncs with the endpoint GET /api/v6/users/:userId/sync

Or, better (more practical in most cases), you can get the latest data sync of each datatype per data connection with the endpoint GET /api/v6/users/:userId/sync/latest

Data Sync status

  • QUEUED: When the data sync is asked but not yet started
  • FETCHING: Synchronization is in progress
  • AUTH_ERROR: Synchronization failed because the user as revoked the authorization. The corresponding data connection will also be in AUTH_ERROR.
  • FETCH_ERROR: Synchronization failed because the provider returned an error. You should retry the synchronization later on.
  • INTERNAL_ERROR: Synchronization failed because of an error on the Qard system.
  • SUCCESS: Synchronization success. You can retrieve the data with the corresponding endpoints.