> ## 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 all planned maintenances

> Receive all planned maintenances of all of the vehicles that are registered under an asset provider in the shortened format



## OpenAPI

````yaml /api-reference/m2m-api.yml post /api/fleets/v1/{assetProviderCountryCode}/{assetProviderCode}/planned-maintenances
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}/planned-maintenances:
    post:
      tags:
        - Maintenance
      summary: Get all planned maintenances
      description: >-
        Receive all planned maintenances of all of the vehicles that are
        registered under an asset provider in the shortened format
      operationId: getAllMaintenances
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenancePaginationRequest'
      responses:
        '200':
          description: All maintenance objects of all vehicles in the shortened format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllMaintenances'
        '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 that asset provider
      security:
        - oauth:
            - openid
components:
  schemas:
    MaintenancePaginationRequest:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/PaginationRequest'
    AllMaintenances:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/PaginationResult'
        items:
          type: object
          description: >-
            The key of each property is the vehicle-id and the value the next
            recommended maintenance
          additionalProperties:
            $ref: '#/components/schemas/Maintenance'
    PaginationRequest:
      description: Request what page is wanted to be retrieved
      type: object
      required:
        - pageSize
        - page
      properties:
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
        page:
          type: integer
          minimum: 0
          default: 0
    PaginationResult:
      type: object
      required:
        - pageNumber
        - pageSize
        - totalEntries
      properties:
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
        pageNumber:
          type: integer
          minimum: 0
          default: 0
        totalEntries:
          type: integer
          minimum: 0
    Maintenance:
      type: object
      properties:
        plannedToDate:
          type: string
          format: date
          example: '2023-04-08T00:00:00.000Z'
        plannedToMileage:
          type: integer
          example: 123456
          description: In kilometers
  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

````