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

# Get maintenance record

> Retrieve a single maintenance record by ID, including the truck or trailer, work order details, vendor, parts, labor cost, and completion date.

The GET Maintenance by ID API endpoint allows you to retrieve detailed information about a specific maintenance record using its unique ID. This endpoint provides comprehensive data about the maintenance record, facilitating effective asset management and tracking within the Alvys system.

### Request Parameters

The following parameters are required in the URL path:

| Parameter | Type   | Required | Description                                      |
| --------- | ------ | -------- | ------------------------------------------------ |
| version   | String | Yes      | The API version to use.                          |
| id        | String | Yes      | The unique identifier of the maintenance record. |

#### Example CURL request

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v{version}/maintenance/{id}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

Replace `{version}` with the API version number, `{id}` with the actual maintenance ID, and `YOUR_ACCESS_TOKEN` with your actual Bearer token:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/maintenance/123456789a-00b0-00ae-0000-0e01234567e6f' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...'
```

### Response Parameters

The following table lists the parameters included in the response for maintenance-related requests:

| Parameter                | Type               | Required | Description                                                           |
| ------------------------ | ------------------ | -------- | --------------------------------------------------------------------- |
| Id                       | String             | Yes      | The unique identifier of the maintenance record.                      |
| PO                       | String             | No       | The purchase order number associated with the maintenance.            |
| Reference                | String             | No       | A reference string for the maintenance record.                        |
| RelatedAsset             | Object             | No       | Details about the related asset for the maintenance.                  |
| RelatedAsset.AssetId     | String             | No       | The unique identifier of the asset.                                   |
| RelatedAsset.AssetNumber | String             | No       | The asset number.                                                     |
| RelatedAsset.AssetType   | String             | No       | The type of asset (e.g., Truck, Trailer).                             |
| Category                 | Object             | No       | The category of the maintenance work.                                 |
| Category.Id              | String             | No       | The unique identifier of the category.                                |
| Category.Name            | String             | No       | The name of the category.                                             |
| Description              | String             | No       | A description of the maintenance work.                                |
| Comments                 | String             | No       | Additional comments or notes about the maintenance.                   |
| Amount                   | Object             | No       | The total amount for the maintenance work.                            |
| Amount.Amount            | Number             | No       | The amount value.                                                     |
| Amount.Currency          | Integer            | No       | The currency identifier of the amount (Money = { Amount, Currency }). |
| RepairShop               | Object             | No       | Information about the repair shop.                                    |
| RepairShop.Id            | String             | No       | The unique identifier of the repair shop.                             |
| RepairShop.Name          | String             | No       | The name of the repair shop.                                          |
| Reminders                | Array              | No       | A list of reminders associated with the maintenance.                  |
| Reminders.id             | String             | No       | The unique identifier of the reminder.                                |
| Reminders.DueDate        | String (Date-Time) | No       | The due date for the reminder.                                        |
| CreatedAt                | String (Date-Time) | Yes      | The date and time when the maintenance record was created.            |
| CreatedBy                | String             | No       | The user who created the maintenance record.                          |
| ModifiedAt               | String (Date-Time) | No       | The date and time when the maintenance record was last modified.      |
| ModifiedBy               | String             | No       | The user who last modified the maintenance record.                    |

#### Example Response

On the right side, you can see examples of different error codes by clicking "Example" and selecting the response code.

<img src="https://mintcdn.com/alvys/MPqgFq1pceM5E4R4/images/migrated/75211c3-Retr.gif?s=b31c37ff3fd2d09f3c71c5e64c789bec" alt="" width="706" height="818" data-path="images/migrated/75211c3-Retr.gif" />

<br />

#### Rate Limits

All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the [Rate Limits](/docs/rate-limits) section.

This page is interactive, allowing you to try a request by providing the driver ID in the URL path. As you fill out the parameters, the Curl command on the right side of the page will be automatically updated. Alternatively, you can directly edit the Curl command. Make sure to authorize yourself before trying a request.


## OpenAPI

````yaml GET /api/p/v{version}/maintenance/{id}
openapi: 3.0.1
info:
  title: Alvys
  description: >-
    Alvys provides a robust set of REST APIs to allow you to integrate Alvys
    into virtually any platform. These APIs cover most of Alvys' major product
    areas with additional endpoints being added regularly based on customer
    requests.
  contact:
    name: Alvys Support
    url: https://www.alvys.com/resources/contact/
  version: v1
servers:
  - url: https://integrations.alvys.com
    description: Public API Server
  - url: https://api.alvys.com/
    description: Public API Server
security:
  - Public: []
tags:
  - name: Authentication
    description: Obtain an OAuth 2.0 access token for the Alvys Public API.
  - name: Carrier Settlement Statements
    description: >-
      Search carrier settlement statements and retrieve a single statement by
      number.
  - name: Carriers
    description: Read carrier records, search carriers, and manage carrier documents.
  - name: Customers
    description: Create, read, update, delete, and search customer records.
  - name: Deductions
    description: >-
      Create one-time deductions and search or delete existing deduction
      records.
  - name: DispatchPreferences
    description: Dispatch preferences endpoints for reading dispatch rules and preferences.
  - name: Driver Settlement Statements
    description: >-
      Search driver settlement statements and retrieve a single statement by
      number.
  - name: Drivers
    description: >-
      Read driver records, search drivers and driver events, and manage driver
      documents.
  - name: Fuel
    description: Read and search fuel transactions.
  - name: Invoices
    description: >-
      Read invoices, create carrier invoices, and record carrier and customer
      payments.
  - name: Loads
    description: Read, update, search loads, and manage load documents and notes.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read, search trips, manage trip documents, and record stop appointments,
      arrivals, and departures.
  - name: Trucks
    description: Read trucks, search truck events, and manage truck documents.
  - name: Users
    description: List and search users.
  - name: Visibility
    description: >-
      Read inbound and outbound visibility history and search outbound
      visibility errors.
  - name: Webhooks
    description: >-
      Create, read, update, delete, enable, disable, verify, test, and rotate
      secrets for webhook subscriptions; read event types, delivery logs, and
      health metrics.
paths:
  /api/p/v{version}/maintenance/{id}:
    get:
      tags:
        - Maintenance
      summary: Get maintenance record
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alvys.Models.Loads.MaintenanceResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.Loads.MaintenanceResponse:
      required:
        - Amount
        - Category
        - CreatedAt
        - CreatedBy
        - Id
        - RelatedAsset
      type: object
      properties:
        Id:
          type: string
        PO:
          type: string
          nullable: true
        Reference:
          type: string
          nullable: true
        RelatedAsset:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Loads.MaintenanceResponseAsset'
        Category:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Models.Loads.MaintenanceResponseMaintenanceCategory
        Description:
          type: string
          nullable: true
        Comments:
          type: string
          nullable: true
        Amount:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        RepairShop:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Loads.MaintenanceResponseShop'
          nullable: true
        Reminders:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Maintenance.Asset.Reminder'
          nullable: true
        CreatedAt:
          type: string
          format: date-time
        CreatedBy:
          type: string
        ModifiedAt:
          type: string
          format: date-time
          nullable: true
        ModifiedBy:
          type: string
          nullable: true
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Alvys.Models.Loads.MaintenanceResponseAsset:
      required:
        - AssetId
        - AssetType
      type: object
      properties:
        AssetId:
          type: string
        AssetNumber:
          type: string
          nullable: true
        AssetType:
          type: string
      additionalProperties: false
    Alvys.Models.Loads.MaintenanceResponseMaintenanceCategory:
      required:
        - Id
        - Name
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
      additionalProperties: false
    Alvys.Money:
      required:
        - Amount
      type: object
      properties:
        Amount:
          type: number
          format: double
        Currency:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
    Alvys.Models.Loads.MaintenanceResponseShop:
      required:
        - Id
        - Name
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
      additionalProperties: false
    Alvys.Models.Maintenance.Asset.Reminder:
      type: object
      properties:
        id:
          type: string
          nullable: true
        DueDate:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
  securitySchemes:
    Public:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OAuth 2.0 client-credentials access token. Obtain one from
        https://auth.alvys.com/oauth/token (grant_type=client_credentials,
        audience=https://api.alvys.com/public/), then paste it here. The
        playground sends it as `Authorization: Bearer <token>`.

````