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

# Trip By Id

> This endpoint returns a Trip by ID.



## OpenAPI

````yaml openapi_2024-03-26 get /trip/{trip_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: '2024-03-26'
servers:
  - url: https://api.pathstack.io
    description: PathStack production environment
security: []
paths:
  /trip/{trip_id}:
    get:
      tags:
        - Trips
      summary: Trip By Id
      description: This endpoint returns a Trip by ID.
      operationId: trip_by_id_trip__trip_id__get
      parameters:
        - name: trip_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Trip id
            description: Trip ID of the Trip to be returned
          description: Trip ID of the Trip to be returned
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            format: date
            default: '2024-03-26'
            title: X-Api-Version
          examples:
            default:
              value: '2024-03-26'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success_Trip_'
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                        title: Error code
                      message:
                        type: string
                        example: Invalid JWT format
                        title: Error message
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 401
                        title: Error code
                      message:
                        type: string
                        example: >-
                          Authentication header is missing, or token is
                          invalid/expired.
                        title: Error message
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 403
                        title: Error code
                      message:
                        type: string
                        example: You do not have access to this resource
                        title: Error message
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 404
                        title: Error code
                      message:
                        type: string
                        example: Trip with ID <trip_id> not found
                        title: Error message
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 422
                        title: Error code
                      message:
                        type: string
                        example: Field required
                        title: Error message
                      loc:
                        items:
                          anyOf:
                            - type: string
                            - type: integer
                        type: array
                        title: Location
                      msg:
                        type: string
                        title: Message
                      type:
                        type: string
                        title: Error Type
          description: Unprocessable Entity
      security:
        - JWTBearer: []
components:
  schemas:
    Success_Trip_:
      properties:
        data:
          $ref: '#/components/schemas/Trip'
          description: Successful response payload
      type: object
      required:
        - data
      title: Success[Trip]
    Trip:
      properties:
        start_latitude:
          type: number
          title: Start Latitude
        start_longitude:
          type: number
          title: Start Longitude
        end_latitude:
          type: number
          title: End Latitude
        end_longitude:
          type: number
          title: End Longitude
        system_trip_id:
          anyOf:
            - type: string
            - type: 'null'
          title: System Trip Id
        start_time:
          type: string
          title: Start Time
        end_time:
          type: string
          title: End Time
        distance_metres:
          type: number
          title: Distance Metres
        duration_seconds:
          type: number
          title: Duration Seconds
        driving_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Driving Seconds
        idling_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Idling Seconds
        auxiliary_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Auxiliary Seconds
        is_valid:
          type: boolean
          title: Is Valid
        validation_comments:
          anyOf:
            - type: string
            - type: 'null'
          title: Validation Comments
        id:
          type: string
          format: uuid4
          title: Id
        device_id:
          type: string
          format: uuid4
          title: Device Id
      type: object
      required:
        - start_latitude
        - start_longitude
        - end_latitude
        - end_longitude
        - system_trip_id
        - start_time
        - end_time
        - distance_metres
        - duration_seconds
        - driving_seconds
        - idling_seconds
        - auxiliary_seconds
        - is_valid
        - validation_comments
        - id
        - device_id
      title: Trip
  securitySchemes:
    JWTBearer:
      type: http
      scheme: bearer

````