> ## Documentation Index
> Fetch the complete documentation index at: https://smartcar.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List connections

> Get all vehicle connections for the application, with optional filters for user ID, vehicle ID, and mode. Results are paginated.



## OpenAPI

````yaml /specs/vehicle.yml get /connections
openapi: 3.0.3
info:
  title: Smartcar Vehicle API
  version: 3.0.0
  description: API for vehicle data (signals) and operations (commands).
servers:
  - url: https://vehicle.api.smartcar.com/v3
security: []
tags:
  - name: Charging
    description: Commands for controlling vehicle charging behavior.
  - name: Security
    description: Commands for controlling vehicle door locks.
  - name: Navigation
    description: Commands for setting destinations in the vehicle navigation system.
  - name: Command Executions
    description: Retrieve the recorded result of a previously issued vehicle command.
  - name: Charge Schedules
    description: Create, retrieve, and delete recurring charge schedules on a vehicle.
  - name: Schedule Executions
    description: >-
      Retrieve the recorded result of a previously issued schedule create or
      delete request.
paths:
  /connections:
    get:
      summary: List connections
      description: >-
        Get all vehicle connections for the application, with optional filters
        for user ID, vehicle ID, and mode. Results are paginated.
      operationId: getConnections
      parameters:
        - $ref: '#/components/parameters/FilterUserId'
        - $ref: '#/components/parameters/FilterVehicleId'
        - $ref: '#/components/parameters/FilterVehicleMode'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Get all vehicle connections for the application
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  parameters:
    FilterUserId:
      name: filter[userId]
      in: query
      description: Filter by user id in relationships
      required: false
      schema:
        type: string
    FilterVehicleId:
      name: filter[vehicleId]
      in: query
      description: Filter by vehicle id in relationships
      required: false
      schema:
        type: string
    FilterVehicleMode:
      name: filter[vehicle.mode]
      in: query
      description: Filter by mode (live or simulated)
      required: false
      schema:
        type: string
        enum:
          - live
          - simulated
        default: live
    PageNumber:
      name: page[number]
      in: query
      description: Page number for pagination (default is 1)
      required: false
      schema:
        type: integer
        default: 1
    PageSize:
      name: page[size]
      in: query
      description: Number of items per page for pagination (default is 10)
      required: false
      schema:
        type: integer
        default: 10
  schemas:
    ConnectionsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionResponse'
        meta:
          $ref: '#/components/schemas/PagingMetaAttributes'
        links:
          $ref: '#/components/schemas/PagingLinks'
    ConnectionResponse:
      type: object
      properties:
        id:
          type: string
          description: |
            The unique identifier for the connection.
        type:
          type: string
          enum:
            - connection
          default: connection
        attributes:
          $ref: '#/components/schemas/ConnectionAttributes'
        relationships:
          type: object
          properties:
            vehicle:
              $ref: '#/components/schemas/VehicleRelationship'
            user:
              $ref: '#/components/schemas/UserRelationship'
        meta:
          $ref: '#/components/schemas/MetaAttributes'
        links:
          type: object
          allOf:
            - $ref: '#/components/schemas/SelfLink'
    PagingMetaAttributes:
      type: object
      properties:
        pageNumber:
          type: integer
          description: The current page number
        pageSize:
          type: integer
          description: The number of items per page
        totalCount:
          type: integer
          description: The total number of items available
        orderBy:
          type: string
          description: The field by which the results are ordered
        orderDirection:
          type: string
          description: The direction of the ordering
          enum:
            - ASC
            - DESC
      example:
        pageNumber: 1
        pageSize: 10
        totalCount: 50
        orderBy: createdAt
        orderDirection: DESC
    PagingLinks:
      type: object
      required:
        - self
        - first
        - last
        - next
        - prev
      properties:
        self:
          type: string
          description: |
            The URL to access the current page of results.
        first:
          type: string
          description: |
            The URL to access the first page of results.
        prev:
          type: string
          nullable: true
          description: |
            The URL to access the previous page of results.
        next:
          type: string
          nullable: true
          description: |
            The URL to access the next page of results.
        last:
          type: string
          description: |
            The URL to access the last page of results.
      example:
        self: /connections?page[number]=1&page[size]=10
        first: /connections?page[number]=1&page[size]=10
        prev: null
        next: /connections?page[number]=2&page[size]=10
        last: /connections?page[number]=5&page[size]=10
    ErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - status
              - type
              - code
              - title
              - detail
            properties:
              status:
                type: string
              type:
                type: string
                enum:
                  - AUTHENTICATION
                  - BILLING
                  - COMPATIBILITY
                  - CONNECTED_SERVICES_ACCOUNT
                  - RATE_LIMIT
                  - RESOURCE_NOT_FOUND
                  - SERVER
                  - UPSTREAM
                  - VALIDATION
                  - VEHICLE_STATE
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              resolution:
                type: object
                description: >-
                  Optional field providing guidance on how to resolve the error,
                  if applicable. The structure of this object can vary based on
                  the error type and is intended to provide actionable
                  information to clients.
                properties:
                  type:
                    type: string
                    description: >-
                      The type of resolution recommended (e.g., "RETRY_LATER",
                      "CONTACT_SUPPORT", etc.)
              suggestedUserMessage:
                type: string
                description: >-
                  Optional field providing a user-friendly message that can be
                  displayed to end-users, if applicable. This message is
                  intended to be easily understandable and actionable for users
                  who encounter the error.
              links:
                type: object
                properties:
                  about:
                    type: string
                    format: uri
              meta:
                type: object
                properties:
                  debug:
                    type: object
                    description: >-
                      Debug information for internal use, not intended for
                      clients
                    properties:
                      applicationId:
                        type: string
                        description: The unique identifier for the application
                      requestId:
                        type: string
                        description: The unique identifier for the request
                      origin:
                        type: string
                        description: The origin of the error
                    example:
                      applicationId: app_123abc
                      requestId: req_456def
                      origin: internal.com/path
    ConnectionAttributes:
      type: object
      properties:
        permissions:
          type: array
          description: |
            The permissions granted to the connection.
          items:
            type: string
        vehicle:
          type: object
          properties:
            make:
              type: string
            model:
              type: string
            year:
              type: integer
            powertrainType:
              type: string
            mode:
              $ref: '#/components/schemas/VehicleMode'
      example:
        permissions:
          - read_vehicle_info
          - read_odometer
        vehicle:
          make: Tesla
          model: Model S
          year: 2020
          mode: live
          powertrainType: BEV
    VehicleRelationship:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: |
                The unique identifier for the vehicle.
            type:
              type: string
              enum:
                - vehicle
        links:
          $ref: '#/components/schemas/RelatedLink'
    UserRelationship:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: |
                The unique identifier for the user.
            type:
              type: string
              default: user
        links:
          $ref: '#/components/schemas/RelatedLink'
    MetaAttributes:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
          description: |
            ISO 8601 UTC date string when the resource was created
        updatedAt:
          type: string
          format: date-time
          description: |
            ISO 8601 UTC date string when the resource was last updated
      example:
        createdAt: '2023-10-01T20:00:00Z'
        updatedAt: '2023-10-01T20:00:00Z'
        lastUsedAt: null
    SelfLink:
      type: object
      properties:
        self:
          type: string
          description: |
            The URL to access the current resource.
    VehicleMode:
      type: string
      description: The mode of the vehicle
      enum:
        - live
        - simulated
      example: live
    RelatedLink:
      type: object
      properties:
        related:
          type: string
          description: |
            The URL to access the related resource.
  responses:
    BadRequest:
      description: 400 Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - status: '400'
                type: VALIDATION
                code: BAD_REQUEST
                title: Bad Request
                detail: >-
                  The request could not be understood by the server due to
                  malformed syntax.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/validation-errors
    Unauthorized:
      description: 401 Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - status: '401'
                type: AUTHENTICATION
                code: UNAUTHORIZED
                title: Unauthorized
                detail: The Authorization token is missing or invalid.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/authentication-errors#authentication
    Forbidden:
      description: 403 Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - status: '403'
                type: AUTHENTICATION
                code: FORBIDDEN
                title: Forbidden
                detail: You do not have permission to access this resource.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/authentication-errors
    NotFound:
      description: 404 Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - status: '404'
                type: RESOURCE_NOT_FOUND
                code: NOT_FOUND
                title: Not Found
                detail: The requested resource could not be found.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/resource-not-found-errors
    InternalError:
      description: 500 Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - status: '500'
                type: SERVER
                code: INTERNAL
                title: Internal Server Error
                detail: An unexpected error occurred on the server.
                links:
                  about: https://smartcar.com/docs/errors/api-errors/v3/server-errors
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or opaque
      description: |
        The Authorization header must be provided with a valid bearer token.
        Example: `Authorization: Bearer {token}`

````