Skip to main content
POST
Create maintenance record
The Create Maintenance Record endpoint opens a maintenance record against one of your trucks or trailers, for example a PM service or a repair invoice from your shop system. On success it returns the new record and its optimistic-concurrency token in the ETag response header. Send that value in the If-Match header of a later Update maintenance record request. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
This endpoint requires the maintenance:create scope. See Authentication.
To attach the invoice or another file to the record, use Upload maintenance document with the Id this endpoint returns.

Asset

Asset.AssetId is the Alvys id of the truck or trailer, as returned by Search trucks or Search trailers. Asset.AssetType is Truck or Trailer (case-insensitive). The asset cannot be changed after the record is created. If the asset does not exist in your account, or it belongs to a subsidiary your credential cannot access, the request is rejected with 404 Not Found.

Category, repair shop and vendor

Category, RepairShop and Vendor are resolved by Name. A name that already exists in your maintenance lists is reused. A name that does not exist yet is added, the same way typing a new value in the Alvys maintenance form adds it. The response returns the Id and Name the value was saved under. You may send back the Id you received in a response, but it is not used to look anything up: always send Name with it. An Id without a Name is rejected with 400 Bad Request.

Retry safely with ExternalId

ExternalId is your own unique id for the record, such as your work order or invoice number. Send the same value when you retry a request, for example after a timeout. If a record with that ExternalId already exists, it is returned with 200 OK and no second record is created. Without ExternalId, a retry creates another record.
  • Matching ignores case and surrounding spaces.
  • The check protects a retry that follows the first request. Two requests with the same ExternalId sent at exactly the same time can both create a record.
  • If the existing record with that ExternalId belongs to an asset your credential cannot access, the request is rejected with 404 Not Found.

Driver deductions

A record created through this endpoint is never linked to a driver settlement deduction, so creating one does not change any driver’s pay. IsDeducted is false on the response. A deduction can still be linked to the record later in Alvys.

Request parameters

The following parameter is required in the URL path:

Request body

Only Asset and Category are required.

Example cURL request

Replace YOUR_ACCESS_TOKEN with your actual Bearer token.

Response fields

A successful request returns the maintenance record. The record’s current ETag is in the ETag response header.

Example response

201 Created
The example shows a subset of the response fields.

Status codes


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 section. This page is interactive, allowing you to try a request by completing the fields for the parameters below. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated.

Authorizations

Authorization
string
header
required

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>.

Path Parameters

version
string
default:1.0
required

API version (e.g., 1.0)

Example:

"1.0"

Body

Asset
object
required
Category
object
required
Status
string | null
Date
string<date-time> | null
Description
string | null
Comments
string | null
Amount
number<double> | null
PO
string | null
Reference
string | null
RepairShop
object | null
Vendor
object | null
OdometerReading
number<double> | null
WorkPerformed
string | null
Reminders
object[] | null
ExternalId
string | null

Response

OK

Id
string
required
Category
object
required
Amount
object
required
CreatedAt
string<date-time>
required
CreatedBy
string
required
Status
string
required
OdometerReading
number<double>
required
IsDeducted
boolean
required

True when this record is linked to a driver settlement deduction. While true, a PATCH that changes Category, Description, Amount or Date is refused with 422, because applying it would replace the driver's linked deduction. All other fields stay writable.

PO
string | null
Reference
string | null
Description
string | null
Comments
string | null
RepairShop
object | null
Reminders
object[] | null
ModifiedAt
string<date-time> | null
ModifiedBy
string | null
RecordNumber
string | null

Per-tenant sequence number, server-assigned and not writable. Unique within your tenant, so it is safe to reconcile against: a simultaneous create cannot take the same number. NOT guaranteed gapless or strictly increasing - a losing race burns a number and a deleted record leaves its number behind, so treat it as an identifier, not a count.

Date
string<date-time> | null
WorkPerformed
string | null
Vendor
object | null
ExternalId
string | null