Skip to main content
POST
/
connections
Create Connection
curl --request POST \
  --url https://api.withterminal.com/tsp/v1/connections \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "geotab",
  "credentials": {},
  "company": {
    "name": "<string>",
    "dotNumbers": [
      "<string>"
    ]
  },
  "options": {},
  "externalId": "<string>",
  "syncMode": "automatic",
  "backfill": {
    "startFrom": "2021-01-06T03:24:53.000Z",
    "days": 123
  },
  "tags": [
    "Tag Name"
  ],
  "agreements": [
    {
      "agreementUrl": "<string>",
      "type": "end-user-agreement",
      "ipAddress": "127.0.0.1",
      "acceptedAt": "2021-01-06T03:24:53.000Z",
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
    }
  ]
}
'
{
  "id": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
  "company": {
    "name": "Frank's Trucking",
    "dotNumbers": [
      "1234567"
    ]
  },
  "account": {
    "name": "Frank's Trucking",
    "dotNumbers": [
      "1234567"
    ],
    "user": {
      "sourceId": "1234567",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com"
    }
  },
  "status": "connected",
  "provider": {
    "code": "geotab",
    "name": "Geotab"
  },
  "syncMode": "automatic",
  "token": "con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4",
  "options": {},
  "linkUrl": "https://link.withterminal.com/connection/{CONNECTION_ID}?key={PUBLISHABLE_KEY}",
  "createdAt": "2021-01-06T03:24:53.000Z",
  "updatedAt": "2021-01-06T03:24:53.000Z",
  "externalId": "1234",
  "sourceId": "123456789",
  "tags": [
    "Tag Name"
  ],
  "filters": {
    "vehicles": {
      "status": "active",
      "excludeIds": [
        "vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC"
      ],
      "includeIds": [
        "vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC"
      ]
    },
    "drivers": {
      "status": "active",
      "excludeIds": [
        "drv_01D8ZQFGHVJ858NBF2Q7DV9MNC"
      ],
      "includeIds": [
        "drv_01D8ZQFGHVJ858NBF2Q7DV9MNC"
      ]
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.withterminal.com/llms.txt

Use this file to discover all available pages before exploring further.

For most use cases we recommend using the Link UI to create connections.

Authorizations

Authorization
string
header
required

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

Body

application/json
provider
string
required

Every provider has a unique code to identify it across Terminal's system. You can find each provider's code under provider details.

Example:

"geotab"

credentials
object
required
company
object
options
object
externalId
string
syncMode
enum<string>
default:automatic

Enum values:

  • automatic: Terminal will keep this connections data up to date
  • manual: Terminal will only sync data upon request
Available options:
automatic,
manual
backfill
object

Optional backfill to be requested upon successful connection. Will start from NOW if not provided.

tags
string[]
agreements
AgreementAcceptance · object[]

The agreements to link the connection to.

Response

Created

id
string<ulid>
required
Example:

"conn_01GV12VR4DJP70GD1ZBK0SDWFH"

company
object
required
account
object
required
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
  • pending_deletion: connection has been marked for deletion and is awaiting the grace period
  • deleting: connection data is actively being deleted - this process is irreversible
  • deleted: connection data has been deleted and the record is retained as a stub
Available options:
connected,
disconnected,
archived,
pending_deletion,
deleting,
deleted
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
token
string
required

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

Pattern: ^con_tkn_\S+$
Example:

"con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4"

options
object
required

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

Example:

"https://link.withterminal.com/connection/{CONNECTION_ID}?key={PUBLISHABLE_KEY}"

createdAt
string<date-time>
required
Example:

"2021-01-06T03:24:53.000Z"

updatedAt
string<date-time>
required
Example:

"2021-01-06T03:24:53.000Z"

externalId
string

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

Example:

"1234"

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.

Example:

"123456789"

tags
string[]

An optional list of tags from your system that can be used to reference connections.

filters
object

Filters applied to connection data