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

# Get logbook statistics

> Get the statistics of all of the trips a user has taken according to the logbook



## OpenAPI

````yaml /api-reference/m2m-api.yml post /api/fleets/v1/{assetProviderCountryCode}/{assetProviderCode}/{vehicleId}/logbook/statistics
openapi: 3.0.3
info:
  title: M2M API
  version: '@version@'
servers:
  - url: https://api.smartmove.eu/m2m
security: []
tags:
  - name: Vehicles
  - name: Maintenance
  - name: Logbook
  - name: Drivers
  - name: Users
  - name: Checklist
  - name: Incidents
  - name: Databox
  - name: Assets
  - name: Asset Provider
  - name: Invoices
paths:
  /api/fleets/v1/{assetProviderCountryCode}/{assetProviderCode}/{vehicleId}/logbook/statistics:
    post:
      tags:
        - Logbook
      summary: Get logbook statistics
      description: >-
        Get the statistics of all of the trips a user has taken according to the
        logbook
      operationId: getLogbookStatistics
      parameters:
        - in: path
          name: assetProviderCountryCode
          schema:
            type: string
            minLength: 2
            maxLength: 2
          required: true
          example: AT
          description: >-
            The two-letter country code of the asset provider the vehicles
            belong to
        - in: path
          name: assetProviderCode
          schema:
            type: string
            minLength: 3
            maxLength: 3
          required: true
          example: ABC
          description: >-
            The three-character code of the asset provider the vehicles belong
            to
        - in: path
          name: vehicleId
          schema:
            type: string
          required: true
          example: AT*ABC*V100006
          description: The id of the vehicle
      requestBody:
        required: true
        description: >-
          The request body contains the user, time frame and potentially the
          trip type as well for which the statistics should be calculated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogbookStatisticsRequest'
      responses:
        '200':
          description: The summarised statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogbookStatistics'
        '401':
          description: Required and valid bearer token was not included
        '403':
          description: Access to the requested asset provider has been rejected
        '404':
          description: Could not find the vehicle of that asset provider
      security:
        - oauth:
            - openid
components:
  schemas:
    LogbookStatisticsRequest:
      type: object
      required:
        - driver
        - timeframe
      properties:
        driver:
          $ref: '#/components/schemas/Customer'
        timeframe:
          $ref: '#/components/schemas/Timeframe'
        type:
          $ref: '#/components/schemas/TripType'
    LogbookStatistics:
      type: object
      required:
        - totalDistance
        - hoursDriven
      properties:
        totalDistance:
          type: integer
          description: The covered distance
        hoursDriven:
          type: integer
          description: Sum of all the hours driven
    Customer:
      type: object
      required:
        - mobilityProviderCountryCode
        - mobilityProviderCode
        - customerId
      properties:
        mobilityProviderCountryCode:
          type: string
          description: Mobility provider country code
          minLength: 2
          maxLength: 2
          example: AT
        mobilityProviderCode:
          type: string
          description: Mobility provider code
          minLength: 3
          maxLength: 3
          example: ABC
        customerId:
          type: string
          description: >-
            The user id in UUID format (only the versions 1, 2, 3 and 4 are
            currently supported)
          format: uuid
          example: 828c2d1c-d933-4138-9577-02c292b6d869
    Timeframe:
      type: object
      required:
        - fromDatetime
        - toDatetime
      properties:
        fromDatetime:
          type: string
          description: Beginning date and time for the time frame in UTC
          format: date-time
          example: '2025-10-07T10:24:41.143Z'
        toDatetime:
          type: string
          description: Ending date and time for the time frame in UTC
          format: date-time
          example: '2025-10-07T10:24:41.143Z'
    TripType:
      type: string
      description: Type of trip
      enum:
        - Business
        - Private
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: >-
            https://api.smartmove.eu/auth/realms/countryCode-providerCode/protocol/openid-connect/token
          scopes:
            all: openid
        authorizationCode:
          authorizationUrl: >-
            https://api.smartmove.eu/auth/realms/countryCode-providerCode/protocol/openid-connect/auth
          tokenUrl: >-
            https://api.smartmove.eu/auth/realms/countryCode-providerCode/protocol/openid-connect/token
          scopes:
            all: openid

````