Data connections

A data connection represents a company's connection to a data source and allows you to exchange data (pull and push) with that source. A company may have multiple data connections.

Before you can use a data connection to pull or push, the company must grant access by linking the connection.

What does each status mean?

Each data connection has a status:

  • PendingAuth: A new connection which hasn't been linked yet.
  • Linked: A connection which has been linked and you are able to use to pull and push.
  • Deauthorized: A connection that was linked but is no longer able to access the underlying source; typically this is because the company revoked access or an expiry time has been reached. You are able to access any data that was already pulled or pushed using this connection, but you won't be able to perform any new pulls or pushes until the connection is re-linked.
  • Unlinked: A connection that was linked but you have asked for the access to be revoked; this includes connections to sources that you have selected a . Similar to Deauthorized, you are able to access any data that was already pulled or pushed using this connection, but you won't be able to perform any new pulls or pushes until the connection is re-linked
{
      "id": "299459a7-4695-4614-be5c-b31622791b66",
      "name": "d2",
      "platform": "WooCommerce",
      "redirect": "https://link-uat.codat.io/link/start/299459a7-4695-4614-be5c-b31622791b66/1c1e6228-f235-4100-92ec-93b6db04b772",
      "status": "Linked",
      "lastSync": "2021-03-23T10:06:31.3359062Z",
      "dataConnections": [
        {
          "id": "1c1e6228-f235-4100-92ec-93b6db04b772",
          "integrationId": "8cbe957a-8337-463b-9353-2186c372e083",
          "sourceId": "1feb821a-cb05-4375-9b53-cd6367e9fb60",
          "platformName": "WooCommerce",
          "linkUrl": "https://link-uat.codat.io/link/start/299459a7-4695-4614-be5c-b31622791b66/1c1e6228-f235-4100-92ec-93b6db04b772",
          "status": "Linked",
          "lastSync": "2021-03-23T10:06:31.3359056Z",
          "created": "2021-03-22T16:50:54Z",
          "sourceType": "Commerce"
        }
      ],
      "created": "2021-03-17T21:38:02Z",
      "createdByUserName": "Bob Brown"
    },

How do I revoke my access to a data source for a company?

If you'd like to revoke your access to pull and push using a data connection, you can unlink it using the following endpoint: PATCH /companies/{companyId}/connections/{connectionId} and providing: companyId, connectionId, and the Unlinked status in the request body.

Once a connection is Unlinked, you will be able to access any data that was already pulled or pushed, but you won't be able to perform any new pulls or pushes until the connection is re-linked.

Note: Only Linked data connections can be unlinked.

Sample request to unlink a data connectionSample request to unlink a data connection

Sample request to unlink a data connection

{
  "id": "69c25cc8-e1cd-4b63-b43d-75da021df35d",
  "integrationId": "43b64770-a953-46d6-ab30-46c21094a276",
  "sourceId": "9a96f326-226a-4e0f-923a-6758fdba40cc",
  "platformName": "Stripe",
  "linkUrl": "https://link-uat.codat.io/link/start/c9219b93-4eff-4806-99d8-ed3337b6ded2/69c25cc8-e1cd-4b63-b43d-75da021df35d",
  "status": "Unlinked",
  "lastSync": "2021-02-11T12:12:13.1988465Z",
  "created": "2021-02-11T12:04:53Z",
  "sourceType": "Commerce"
}

How do I delete a data connection?

You can delete a data connection using the following endpoint:
DELETE /companies/{companyId}/connections/{connectionId} and providing: companyId, connectionId.

Deleting a data connection means that:

  • You won't be able to make any data pulls or pushes against the underlying data provider.
  • The data connection won't be returned under GET /connections or GET / companies.

Did this page help you?