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

# List All Connections

> List all of the connections you have for your application. Connections represent the authenticated access you have to your customer's TSP data.



## OpenAPI

````yaml GET /connections
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:
  /connections:
    parameters: []
    get:
      tags:
        - Connections
      summary: List All Connections
      description: >-
        List all of the connections you have for your application. Connections
        represent the authenticated access you have to your customer's TSP data.
      operationId: listConnections
      parameters:
        - name: X-Application-Id
          in: header
          required: false
          description: >-
            Scopes the request to a Terminal application in the caller's
            organization. Required for multi-application organizations when
            using a user session or OAuth access token. API keys are already
            bound to a single application.
          schema:
            type: string
        - name: cursor
          in: query
          schema:
            type: string
            format: cursor
            example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
          description: Pagination cursor to start requests from
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: The maximum number of results to return in a page.
        - schema:
            type: string
          in: query
          name: externalId
        - schema:
            type: string
          in: query
          name: dotNumber
        - schema:
            type: string
          in: query
          name: tag
          description: Filter connections by tag
        - name: updatedAfter
          in: query
          schema:
            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'
          description: Filter connections that were last updated on or after a given time.
        - name: updatedBefore
          in: query
          schema:
            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'
          description: Filter connections that were last updated on or before a given time.
        - name: status
          in: query
          schema:
            title: Connection Status
            type: string
            description: >-
              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
            enum:
              - connected
              - disconnected
              - archived
              - pending_deletion
              - deleting
              - deleted
          description: Filter connections by status
        - name: provider
          in: query
          schema:
            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).
          description: Filter connections by provider
        - name: order
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: >-
            Sort order by id (which is monotonically increasing by creation
            time). `desc` returns the most recently created connections first.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      title: Connection
                      x-model-category: platform
                      oneOf:
                        - title: Full Connection
                          description: >-
                            The connection your application has with your
                            customer's TSP.
                          allOf:
                            - title: Connection Base
                              type: object
                              description: Fields shared by all connection records.
                              properties:
                                id:
                                  title: ConnectionId
                                  type: string
                                  format: ulid
                                  example: conn_01GV12VR4DJP70GD1ZBK0SDWFH
                                company:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      example: Frank's Trucking
                                      description: Optional name of the connection.
                                    dotNumbers:
                                      type: array
                                      description: >-
                                        Optional DOT numbers associated with
                                        this connection.
                                      items:
                                        type: string
                                        example: '1234567'
                                account:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      example: Frank's Trucking
                                      description: >-
                                        The name of the account according to the
                                        provider.
                                    dotNumbers:
                                      type: array
                                      description: >-
                                        DOT numbers associated with the account
                                        according to the provider.
                                      items:
                                        type: string
                                        example: '1234567'
                                    user:
                                      type: object
                                      description: >-
                                        The user of the provider account that
                                        created the connection.
                                      properties:
                                        sourceId:
                                          description: >-
                                            The ID of the user in the provider's
                                            system.
                                          example: '1234567'
                                          type: string
                                        firstName:
                                          example: John
                                          type: string
                                        lastName:
                                          example: Doe
                                          type: string
                                        email:
                                          example: john.doe@example.com
                                          type: string
                                provider:
                                  type: object
                                  required:
                                    - code
                                    - name
                                  properties:
                                    code:
                                      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).
                                    name:
                                      type: string
                                      example: Geotab
                                      description: >-
                                        The name of the Telematics Service
                                        Provider.
                                externalId:
                                  type: string
                                  example: '1234'
                                  description: >-
                                    An optional ID from your system that can be
                                    used to reference connections.
                                sourceId:
                                  description: >-
                                    The ID used in the source system to
                                    represent the account this connection has or
                                    had access to.


                                    This may be an `organizationId` or
                                    `accountId`.


                                    Note: not all systems expose this
                                    information, in which case it may be
                                    undefined.
                                  title: SourceId
                                  type: string
                                  example: '123456789'
                                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
                                token:
                                  type: string
                                  example: con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4
                                  pattern: ^con_tkn_\S+$
                                  description: >-
                                    This token is used when interacting with a
                                    connections' data.
                                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
                                createdAt:
                                  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
                                updatedAt:
                                  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
                                - company
                                - account
                                - provider
                                - syncMode
                                - token
                                - createdAt
                                - updatedAt
                            - type: object
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - connected
                                    - disconnected
                                    - archived
                                    - pending_deletion
                                  description: The current status of the connection.
                                options:
                                  type: object
                                  additionalProperties: true
                                filters:
                                  type: object
                                  properties:
                                    vehicles:
                                      type: object
                                      properties:
                                        status:
                                          type: string
                                          enum:
                                            - active
                                            - inactive
                                          description: >-
                                            Filter connection to only include data
                                            related to vehicles with a specified
                                            status
                                        excludeIds:
                                          type: array
                                          items:
                                            title: VehicleId
                                            description: >-
                                              Unique identifier for the vehicle in
                                              Terminal.
                                            type: string
                                            format: ulid
                                            pattern: ^vcl_[0-9A-HJKMNP-TV-Z]{26}$
                                            example: vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC
                                          description: >-
                                            IDs of vehicles to exclude from data
                                            ingestion
                                        includeIds:
                                          type: array
                                          items:
                                            title: VehicleId
                                            description: >-
                                              Unique identifier for the vehicle in
                                              Terminal.
                                            type: string
                                            format: ulid
                                            pattern: ^vcl_[0-9A-HJKMNP-TV-Z]{26}$
                                            example: vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC
                                          description: >-
                                            IDs of vehicles to include in data
                                            ingestion (takes priority over other
                                            filters)
                                    drivers:
                                      type: object
                                      properties:
                                        status:
                                          type: string
                                          enum:
                                            - active
                                            - inactive
                                          description: >-
                                            Filter connection to only include data
                                            related to drivers with a specified
                                            status
                                        excludeIds:
                                          type: array
                                          items:
                                            title: DriverId
                                            description: >-
                                              Unique identifier for the driver in
                                              Terminal.
                                            type: string
                                            format: ulid
                                            pattern: ^drv_[0-9A-HJKMNP-TV-Z]{26}$
                                            example: drv_01D8ZQFGHVJ858NBF2Q7DV9MNC
                                          description: >-
                                            IDs of drivers to exclude from data
                                            ingestion
                                        includeIds:
                                          type: array
                                          items:
                                            title: DriverId
                                            description: >-
                                              Unique identifier for the driver in
                                              Terminal.
                                            type: string
                                            format: ulid
                                            pattern: ^drv_[0-9A-HJKMNP-TV-Z]{26}$
                                            example: drv_01D8ZQFGHVJ858NBF2Q7DV9MNC
                                          description: >-
                                            IDs of drivers to include in data
                                            ingestion (takes priority over other
                                            filters)
                                  description: Filters applied to connection data
                                linkUrl:
                                  type: string
                                  format: uri
                                  example: >-
                                    https://link.withterminal.com/connection/{CONNECTION_ID}?key={PUBLISHABLE_KEY}
                                  description: >-
                                    The URL to send your user to in order to
                                    have them re-authenticate the connection.
                              required:
                                - status
                                - options
                                - linkUrl
                        - title: Deleted Connection
                          description: >-
                            A retained connection record after connection-scoped
                            data has been deleted.
                          allOf:
                            - title: Connection Base
                              type: object
                              description: Fields shared by all connection records.
                              properties:
                                id:
                                  title: ConnectionId
                                  type: string
                                  format: ulid
                                  example: conn_01GV12VR4DJP70GD1ZBK0SDWFH
                                company:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      example: Frank's Trucking
                                      description: Optional name of the connection.
                                    dotNumbers:
                                      type: array
                                      description: >-
                                        Optional DOT numbers associated with
                                        this connection.
                                      items:
                                        type: string
                                        example: '1234567'
                                account:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      example: Frank's Trucking
                                      description: >-
                                        The name of the account according to the
                                        provider.
                                    dotNumbers:
                                      type: array
                                      description: >-
                                        DOT numbers associated with the account
                                        according to the provider.
                                      items:
                                        type: string
                                        example: '1234567'
                                    user:
                                      type: object
                                      description: >-
                                        The user of the provider account that
                                        created the connection.
                                      properties:
                                        sourceId:
                                          description: >-
                                            The ID of the user in the provider's
                                            system.
                                          example: '1234567'
                                          type: string
                                        firstName:
                                          example: John
                                          type: string
                                        lastName:
                                          example: Doe
                                          type: string
                                        email:
                                          example: john.doe@example.com
                                          type: string
                                provider:
                                  type: object
                                  required:
                                    - code
                                    - name
                                  properties:
                                    code:
                                      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).
                                    name:
                                      type: string
                                      example: Geotab
                                      description: >-
                                        The name of the Telematics Service
                                        Provider.
                                externalId:
                                  type: string
                                  example: '1234'
                                  description: >-
                                    An optional ID from your system that can be
                                    used to reference connections.
                                sourceId:
                                  description: >-
                                    The ID used in the source system to
                                    represent the account this connection has or
                                    had access to.


                                    This may be an `organizationId` or
                                    `accountId`.


                                    Note: not all systems expose this
                                    information, in which case it may be
                                    undefined.
                                  title: SourceId
                                  type: string
                                  example: '123456789'
                                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
                                token:
                                  type: string
                                  example: con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4
                                  pattern: ^con_tkn_\S+$
                                  description: >-
                                    This token is used when interacting with a
                                    connections' data.
                                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
                                createdAt:
                                  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
                                updatedAt:
                                  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
                                - company
                                - account
                                - provider
                                - syncMode
                                - token
                                - createdAt
                                - updatedAt
                            - type: object
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - deleting
                                    - deleted
                              required:
                                - status
                      x-description: >-
                        The connection your application has with your customer's
                        TSP.
                  next:
                    title: Pagination Cursor
                    type: string
                    example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
                    description: Cursor used for pagination.
                    format: cursor
                required:
                  - results
        '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

````