Sync status

When you pull data using the Codat API, you can check the last time each data type was synchronised.

Sync status

The GET /companies/{companyId}/dataStatus endpoint returns:

  • A full list of data types for your company with their current sync status: currentStatus .
  • The last time each data type was synced successfully: lastSuccessfulSync .

Examples

Data type that has never been synced

{
  "suppliers": {
    "dataType": "suppliers”
  },
  ...
}

First sync for the data type failed

{
  "suppliers": {
    "dataType": "suppliers",
    "currentStatus": "FetchError",
    "latestSyncId": "31632c48-23dc-4cb1-b3ff-0829343c8e85",
  },
  ...
}

Last sync failed although a previous sync was successful

{
  "suppliers": {
    "dataType": "suppliers",
    "lastSuccessfulSync": "2019-10-10T00:31:04.497225Z",
    "currentStatus": "FetchError",
    "latestSyncId": "31632c48-23dc-4cb1-b3ff-0829343c8e85",
    "latestSuccessfulSyncId": "9d6d3754-deeb-42b7-ad37-e10942f9e258"
  },
  ...
}

Sync was successful

{
  "suppliers": {
    "dataType": "suppliers",
    "lastSuccessfulSync": "2019-10-10T00:31:04.497225Z",
    "currentStatus": "Complete",
    "latestSyncId": "31632c48-23dc-4cb1-b3ff-0829343c8e85",
    "latestSuccessfulSyncId": "31632c48-23dc-4cb1-b3ff-0829343c8e85"
  },
  ...
}

Did this page help you?