GET
/
connections
/
current
curl --request GET \
  --url https://api.withterminal.com/tsp/v1/connections/current \
  --header 'Authorization: Bearer <token>' \
  --header 'Connection-Token: <connection-token>'
{
  "id": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
  "company": {
    "name": "Acme Inc.",
    "dotNumbers": [
      "1234567"
    ]
  },
  "options": {
    "ingestHistoryFromSourceSystem": true
  },
  "token": "T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB",
  "status": "connected",
  "provider": {
    "code": "geotab",
    "name": "Geotab"
  },
  "sourceId": "123456789",
  "externalId": "1234",
  "tags": [
    "<string>"
  ],
  "syncMode": "automatic",
  "linkUrl": "https://link.withterminal.com/connection/{CONNECTION_ID}?key={PUBLISHABLE_KEY}",
  "lastSync": {
    "id": "sync_01GV12VR4DJP70GD1ZBK0SDWFH",
    "status": "completed",
    "failureReason": "Reason for failure if sync status is 'failed'",
    "issues": [
      "isu_01D8ZQFGHVJ858NBF2Q7DV9MNC"
    ],
    "startFrom": "2021-01-06T03:24:53.000Z",
    "requestedAt": "2021-01-06T03:24:53.000Z",
    "completedAt": "2021-01-06T03:24:53.000Z"
  },
  "createdAt": "2021-01-06T03:24:53.000Z",
  "updatedAt": "2021-01-06T03:24:53.000Z",
  "agreements": [
    {
      "id": "agr_01D9ZQFGHVJ858NBF2Q7DV9MNH",
      "connectionId": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
      "agreementUrl": "<string>",
      "acceptedBy": {
        "sourceId": "<string>",
        "firstName": "<string>",
        "lastName": "<string>",
        "email": "<string>"
      },
      "acceptedAt": "2021-01-06T03:24:53.000Z",
      "location": "New York, NY",
      "ipAddress": "127.0.0.1",
      "userAgent": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Connection-Token
string
required

The token returned when a user authenticated their account. This authorizes access to a specific account.

Response

200
application/json
OK

The connection your application has with your customer's TSP.

id
string
required
company
object
required
token
string
required

This token is used when interacting with a connections' data.

status
enum<string>
required

Enum values:

  • connected: active and authenticated connection
  • disconnected: connection is no longer authenticated - please ask your user to link the account again
  • archived: connection has been archived from view - attempts to re-connect will cause us to check the connection status again
Available options:
connected,
disconnected,
archived,
pending_deletion
provider
object
required
syncMode
enum<string>
default:
automatic
required

Enum values:

  • automatic: Terminal will keep this connections data up to date
  • manual: Terminal will only sync data upon request
Available options:
automatic,
manual
createdAt
string
required
updatedAt
string
required
agreements
object[]
required
options
object
sourceId
string

The ID used in the source system to represent the account this connection has access to.

This may be an organizationId or accountId.

Note: not all systems expose this information, in which case it may be undefined.

externalId
string

An optional ID from your system that can be used to reference connections.

tags
string[]

The URL to send your user to in order to have them re-authenticate the connection.

lastSync
object

An object containing the state of a sync job. This can be polled after connection linking to know when data is available for ingestion.