> ## 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.

# Create Short Link URL

> Create a short URL for the Link onboarding flow as an alternative to the full Link URL with all its query parameters.

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.


## OpenAPI

````yaml POST /link/short
openapi: 3.1.0
info:
  title: Terminal Telematics API
  description: >-
    Terminal is a unified API that makes it easy to integrate with the leading
    telematics service providers.
  version: '0.0'
  contact:
    name: Terminal
    email: connect@withterminal.com
    url: https://www.withterminal.com
servers:
  - url: https://api.withterminal.com/tsp/v1
    description: Production
  - url: https://api.sandbox.withterminal.com/tsp/v1
    description: Sandbox
security:
  - Authorization: []
tags:
  - name: Authentication
  - name: Connections
  - name: Data Management
  - name: Drivers
  - name: Groups
  - name: Hours of Service
  - name: IFTA
  - name: Issues
  - name: Link
  - name: Providers
  - name: Safety
  - name: Trailers
  - name: Vehicles
  - name: Vehicle Utilization
  - name: Webhook Events
paths:
  /link/short:
    post:
      tags:
        - Link
      summary: Create Short Link URL
      description: >-
        Create a short URL for the Link onboarding flow as an alternative to the
        full Link URL with all its query parameters.


        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.
      operationId: createShortLink
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  title: Provider Code
                  type: string
                  example: geotab
                  description: >-
                    Every provider has a unique code to identify it across
                    Terminal's system. You can find each provider's code under
                    [provider details](/providers).
                providerHints:
                  type: array
                  description: >-
                    An optional list of provider codes to hoist to the top of
                    the Link provider list.
                  items:
                    title: Provider Code
                    type: string
                    example: geotab
                    description: >-
                      Every provider has a unique code to identify it across
                      Terminal's system. You can find each provider's code under
                      [provider details](/providers).
                externalId:
                  type: string
                  example: fleet_456
                  description: >-
                    An optional ID from your system that can be used to
                    reference connections.
                name:
                  type: string
                  description: >-
                    An optional human-readable name to associate with the
                    resulting connection.
                tags:
                  type: array
                  description: >-
                    An optional list of tags from your system that can be used
                    to reference connections.
                  items:
                    type: string
                    example: Tag Name
                redirectUrl:
                  type: string
                  format: uri
                  example: https://app.acme.com/telematics-success
                  description: >-
                    URL to redirect your user to after they complete the Link
                    flow.
                syncMode:
                  title: SyncMode
                  type: string
                  enum:
                    - automatic
                    - manual
                  description: >-
                    Enum values:

                    - `automatic`: Terminal will keep this connections data up
                    to date

                    - `manual`: Terminal will only sync data upon request
                  default: automatic
                backfill:
                  additionalProperties: false
                  description: >-
                    Optional backfill to be requested upon successful
                    connection. Will start from NOW if not provided.
                  type: object
                  properties:
                    startFrom:
                      title: ISODateTime
                      type: string
                      format: date-time
                      example: '2021-01-06T03:24:53.000Z'
                      description: '[ISO 8601](https://www.w3.org/TR/NOTE-datetime) date'
                    days:
                      type: number
                template:
                  title: LinkTemplateId
                  description: Unique identifier for the Link Template.
                  type: string
                  format: ulid
                  example: ltp_01HXQ4YK8V2X0X0X0X0X0X0X0X
      responses:
        '200':
          description: OK
          headers:
            Idempotent-Replayed:
              schema:
                type: boolean
                enum:
                  - true
              description: >-
                Always `true` on a 200 response. It indicates that an existing
                short link was returned instead of minting a new one.
          content:
            application/json:
              schema:
                title: ShortLink
                type: object
                description: >-
                  A short URL for the Link onboarding flow. The associated
                  parameters are stored at creation time and retrieved when your
                  user visits the URL.
                properties:
                  id:
                    type: string
                    format: ulid
                    pattern: ^slk_[0-9A-HJKMNP-TV-Z]{26}$
                    example: slk_01JB7K3N2QZP7TVR4FX8SDWFH9
                    description: Durable identifier for the short link resource.
                  code:
                    type: string
                    pattern: ^[a-hjkmnp-z2-9]{8}$
                    example: az9qtk2d
                    description: >-
                      8-character code that is associated with the original Link
                      parameters.
                  url:
                    type: string
                    format: uri
                    example: https://term.new/az9qtk2d
                    description: Full short URL to share with your user.
                  expiresAt:
                    title: ISODateTime
                    type: string
                    format: date-time
                    example: '2021-01-06T03:24:53.000Z'
                    description: '[ISO 8601](https://www.w3.org/TR/NOTE-datetime) date'
                required:
                  - id
                  - code
                  - url
                  - expiresAt
        '201':
          description: Created
          content:
            application/json:
              schema:
                title: ShortLink
                type: object
                description: >-
                  A short URL for the Link onboarding flow. The associated
                  parameters are stored at creation time and retrieved when your
                  user visits the URL.
                properties:
                  id:
                    type: string
                    format: ulid
                    pattern: ^slk_[0-9A-HJKMNP-TV-Z]{26}$
                    example: slk_01JB7K3N2QZP7TVR4FX8SDWFH9
                    description: Durable identifier for the short link resource.
                  code:
                    type: string
                    pattern: ^[a-hjkmnp-z2-9]{8}$
                    example: az9qtk2d
                    description: >-
                      8-character code that is associated with the original Link
                      parameters.
                  url:
                    type: string
                    format: uri
                    example: https://term.new/az9qtk2d
                    description: Full short URL to share with your user.
                  expiresAt:
                    title: ISODateTime
                    type: string
                    format: date-time
                    example: '2021-01-06T03:24:53.000Z'
                    description: '[ISO 8601](https://www.w3.org/TR/NOTE-datetime) date'
                required:
                  - id
                  - code
                  - url
                  - expiresAt
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - bad_request
                  message:
                    type: string
                    example: Invalid request body
                  detail:
                    type: array
                    items:
                      title: ErrorPathDetail
                      type: object
                      properties:
                        message:
                          type: string
                          example: '''vehicleId'' property must be a valid ulid'
                        path:
                          type: string
                          example: '{requestQuery}.vehicleId'
                        suggestion:
                          type: string
                          example: >-
                            Please ensure you submit a valid 'vehicleId'
                            property
                        context:
                          type: object
                      required:
                        - message
                        - path
                required:
                  - code
                  - message
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - unauthorized
                  message:
                    type: string
                    example: Unauthorized Request
                  detail:
                    type: string
                    example: Please ensure you have a valid API key
                required:
                  - code
                  - message
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - forbidden
                  message:
                    type: string
                    example: Forbidden Request
                  detail:
                    type: string
                    example: >-
                      Please ensure the connection token matches the resource
                      you are attempting to access.
                required:
                  - code
                  - message
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  code:
                    enum:
                      - too_many_requests
                  retryAfter:
                    description: The number of seconds to wait before retrying the request
                    type: integer
                    example: 60
                  message:
                    type: string
                    example: Too Many Requests
                  detail:
                    type: string
                    example: You have exceeded your rate limit. Please try again later.
                required:
                  - code
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - internal_server_error
                  message:
                    type: string
                    example: Internal Server Error
                  detail:
                    type: string
                    example: Something went wrong
                required:
                  - code
                  - message
        '504':
          description: Gateway Timeout Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - gateway_timeout
                  message:
                    type: string
                    example: Gateway Timeout
                required:
                  - code
                  - message
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````