Skip to main content
POST
/
link
/
short
Create Short Link URL
curl --request POST \
  --url https://api.withterminal.com/tsp/v1/link/short \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "geotab",
  "externalId": "fleet_456",
  "name": "<string>",
  "tags": [
    "Tag Name"
  ],
  "redirectUrl": "https://app.acme.com/telematics-success",
  "syncMode": "automatic",
  "backfill": {
    "startFrom": "2021-01-06T03:24:53.000Z",
    "days": 123
  },
  "template": "ltp_01HXQ4YK8V2X0X0X0X0X0X0X0X"
}
'
{
  "id": "slk_01JB7K3N2QZP7TVR4FX8SDWFH9",
  "code": "az9qtk2d",
  "url": "https://term.new/az9qtk2d",
  "expiresAt": "2021-01-06T03:24:53.000Z"
}
The response contains an 8-character code and the full url to share with your user. Short links are valid for 1 year from creation. Identical request bodies are de-duplicated automatically. Calling this endpoint a second time with the same parameters returns the original short link with an Idempotent-Replayed: true response header.

Authorizations

Authorization
string
header
required

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

Body

application/json
provider
string

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"

externalId
string

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

Example:

"fleet_456"

name
string

An optional human-readable name to associate with the resulting connection.

tags
string[]

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

redirectUrl
string<uri>

URL to redirect your user to after they complete the Link flow.

Example:

"https://app.acme.com/telematics-success"

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.

template
string<ulid>

Unique identifier for the Link Template.

Example:

"ltp_01HXQ4YK8V2X0X0X0X0X0X0X0X"

Response

OK

A short URL for the Link onboarding flow. The associated parameters are stored at creation time and retrieved when your user visits the URL.

id
string<ulid>
required

Durable identifier for the short link resource.

Pattern: ^slk_[0-9A-HJKMNP-TV-Z]{26}$
Example:

"slk_01JB7K3N2QZP7TVR4FX8SDWFH9"

code
string
required

8-character code that is associated with the original Link parameters.

Pattern: ^[a-hjkmnp-z2-9]{8}$
Example:

"az9qtk2d"

url
string<uri>
required

Full short URL to share with your user.

Example:

"https://term.new/az9qtk2d"

expiresAt
string<date-time>
required
Example:

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