Connections
Get Current Connection
Get the details of the current active connection. The current connection is derived from the provided connection token.
GET
/
connections
/
current
Authorization
Header
curl --request GET \
--url https://api.withterminal.com/tsp/v1/connections/current \
--header 'Authorization: <authorization>' \
--header 'Connection-Token: <connection-token>'
{
"id": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
"status": "connected",
"sourceId": "123456789",
"provider": {
"name": "Geotab",
"code": "geotab"
},
"company": {
"name": "Acme Inc.",
"dotNumbers": []
},
"token": "T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB",
"externalId": "1234",
"syncMode": "automatic",
"lastSync": {
"id": "sync_01GV12VR4DJP70GD1ZBK0SDWFH",
"status": "completed",
"failureReason": "Reason for failure if sync status is 'failed'",
"issues": [],
"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"
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Connection-Token
string
requiredThe token returned when a user authenticated their account. This authorizes access to a specific account.
Response
200 - application/json
id
string
requiredstatus
enum<string>
requiredEnum values:
connected
: active and authenticated connectiondisconnected
: connection is no longer authenticated - please ask your user to link the account againarchived
: connection has been archived from view - attempts to re-connect will cause us to check the connection status again
Available options:
connected
, disconnected
, archived
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.
provider
object
requiredcompany
object
requiredtoken
string
requiredThis token is used when interacting with a connections' data.
externalId
string
An optional ID from your system that can be used to reference connections.
syncMode
enum<string>
default: automaticrequiredEnum values:
automatic
: Terminal will keep this connections data up to datemanual
: Terminal will only sync data upon request
Available options:
automatic
, manual
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.
createdAt
string
requiredISO 8601 date
updatedAt
string
requiredISO 8601 date
curl --request GET \
--url https://api.withterminal.com/tsp/v1/connections/current \
--header 'Authorization: <authorization>' \
--header 'Connection-Token: <connection-token>'
{
"id": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
"status": "connected",
"sourceId": "123456789",
"provider": {
"name": "Geotab",
"code": "geotab"
},
"company": {
"name": "Acme Inc.",
"dotNumbers": []
},
"token": "T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB",
"externalId": "1234",
"syncMode": "automatic",
"lastSync": {
"id": "sync_01GV12VR4DJP70GD1ZBK0SDWFH",
"status": "completed",
"failureReason": "Reason for failure if sync status is 'failed'",
"issues": [],
"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"
}