Skip to main content
PATCH
Update maintenance record
The Update Maintenance Record endpoint applies a partial update to an existing maintenance record. Send only the fields you want to change. A field left out of the body keeps its saved value, and an empty string clears a free-text field. 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:update scope. See Authentication.

If-Match is required

This endpoint uses optimistic concurrency. Send the record’s current ETag in the If-Match header. The ETag response header of Get maintenance record, of Create maintenance record, and of every successful update carries it.
  • If you omit If-Match, the request is rejected with 428 Precondition Required.
  • If the record changed after you read it, the request is rejected with 412 Precondition Failed. Get the record again and retry with the new ETag.

Clearing values

  • Free-text fields (Description, Comments, PO, Reference, WorkPerformed): send an empty string.
  • RepairShop and Vendor: send an empty object, {}.
  • Category cannot be cleared. Sending an empty object is rejected with 400 Bad Request.
  • Reminders are replaced as a whole list: send the full list you want to keep, or [] to remove all of them.
If your JSON serializer writes an unset list as [], it clears the record’s reminders. Leave Reminders out of the body when you do not mean to change them.
Category, RepairShop and Vendor are resolved by Name, as in Create maintenance record.

The asset cannot be changed

A maintenance record stays on the truck or trailer it was created for. The body has no Asset field. To move work to another asset, create a new record against it.

Records linked to a driver deduction

When IsDeducted is true, the record is linked to a driver settlement deduction made in Alvys. Category, Description, Amount and Date cannot be changed through this endpoint, because the change would replace that deduction and change the driver’s pay. A request that sends any of them is rejected with 422 Unprocessable Entity and the problem type https://api.alvys.com/errors/UnprocessableEntity/MaintenanceDeductionLocked. You can still change the other fields, or edit the record in Alvys.

A body with nothing to change

A body with no fields, {}, changes nothing. The request still needs a current If-Match, and it returns 200 OK with the record and its unchanged ETag.

Request parameters

The following parameters are required in the URL path: The following header is required:

Request body

All fields are optional. Limits and allowed values are the same as in Create maintenance record. ExternalId cannot be changed.

Example cURL request

Replace YOUR_ACCESS_TOKEN with your actual Bearer token and the If-Match value with the record’s current ETag.

Response fields

A successful request returns 200 OK with the updated record, in the same shape as Create maintenance record. The new ETag is in the ETag response header.

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 specifying the API version and the maintenance record 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.

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

Headers

If-Match
string
required

The maintenance record's current ETag (the ETag response header of your most recent GET, POST or PATCH), for optimistic concurrency. Required; if omitted the request is rejected with 428.

Path Parameters

id
string
required
version
string
default:1.0
required

API version (e.g., 1.0)

Example:

"1.0"

Body

Category
object | null
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

Replaces the whole reminder list when supplied. Omit the property to leave the stored reminders unchanged; send [] to remove them all. Note the consequence: a client that serializes an unset collection as [] will clear this record's reminders, so omit the property rather than sending an empty array. Same rule as Email and Phone on the customer write surface.

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