Skip to main content
PATCH
Update truck
The Update Truck endpoint applies a partial update to an existing truck. Send only the fields you want to change. A field that is absent from the body keeps its stored value. 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 truck:update scope. See Authentication.

If-Match is required

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

Fields that are replaced whole

Dimensions, FuelProfile, TollPasses, IftaEnrollments, EldProviders, and References are replaced whole: send the complete value you want stored. For the four arrays, null clears the list.
  • EldProviders: moving the truck off an ELD link stops its location updates from that provider. Omit SensorId, or send null, to keep the sensor id stored on the same link.
  • References: include the Id of each reference already on the truck that you want to keep or edit. Omit Id for a new reference. A reference identical to one already stored is kept as it is.

Truck number and VIN must stay unique

If you change TruckNum or VinNumber to a value another truck in your company already has, the request is rejected with 409 Conflict. The problem type is https://api.alvys.com/errors/Conflict/DuplicateAssetNumber for the truck number and https://api.alvys.com/errors/Conflict/DuplicateVin for the VIN.

Status and owner operator

Status is shown in the dispatch planner. It does not by itself block dispatch. A maintenance work order started in Alvys moves the truck to In Shop, and back to Active when the work order completes, so a status you write can be overwritten. OwnerOperatorId set to null unassigns the truck: it goes back to the carrier of its subsidiary. Fuel cards with Deduct Fuel follow the change in the same write. They stop deducting when the truck leaves its owner operator, and deduct from the new owner operator when the truck moves to one.

Request parameters

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

Request body

All fields are optional. The fields are the same as in Create truck, with these differences:

Example cURL request

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

Response fields

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

Status codes

Why a request is refused with 422

The problem type is https://api.alvys.com/errors/UnprocessableEntity/ followed by the reason:

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

Headers

If-Match
string
required

The truck'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

TruckNum
string | null
VinNumber
string | null
Year
integer<int32> | null
Make
string | null
Model
string | null
LicenseNum
string | null
LicenseState
string | null
LicenseCountry
string | null
LicenseExpirationDate
string<date> | null

Plate registration expiration ("License Expiration" in the app). Date only (yyyy-MM-dd), stored as 00:00 UTC.

Status
string | null

One of Active, Planned, Temporary, Repair, In Shop, Leased Out, Crashed, Inactive (case-insensitive). Shown in the dispatch planner; does not by itself block dispatch. In Shop and Active are also written by the maintenance work-order sync. Crashed and Inactive remove the truck from the ELD live map and from truck pickers. A maintenance work order started in Alvys moves the truck to In Shop and back to Active on its own.

SubsidiaryId
string | null

Subsidiary id from GET /subsidiaries. Must be one this credential may write to. May be omitted only when the credential can write to exactly one subsidiary.

FleetId
string | null

Fleet id, as returned in Fleet.Id by GET /trucks. Must be an active fleet of your account.

NumberOfAxles
integer<int32> | null
GrossWeight
object | null

Maximum gross weight, with its unit (Pounds, Kilograms, ...). Stored and returned in pounds.

EmptyWeight
object | null

Empty (tare) weight, with its unit (Pounds, Kilograms, ...). Stored and returned in pounds.

Dimensions
object | null

Outside dimensions for the routing vehicle profile: Height, Width and Length, each with its unit (Feet, Inches, Meters, ...). Replaced whole.

GrossCombinationWeightRating
object | null

Gross combination weight rating: what the unit can pull, with its unit (Pounds, Kilograms, ...).

TireCount
integer<int32> | null

Tires on the power unit.

Color
string | null
FuelType
string | null
FuelProfile
object | null

Fuel-cost inputs: MpgLoaded, MpgEmpty, TankCapacity (with its unit), TankCount and FuelKind (Diesel, Gasoline, Cng, Lng, Electric, Hybrid). Replaced whole.

DeductToll
boolean | null

Deduct this truck's tolls from the driver's settlement.

InsuranceCompany
string | null
InsurancePolicyNumber
string | null
InsuranceExpirationDate
string<date> | null

Date only (yyyy-MM-dd), stored as 00:00 UTC.

InspectionExpirationDate
string<date> | null

Annual inspection expiration. Date only (yyyy-MM-dd), stored as 00:00 UTC.

InsuranceValue
number<double> | null
LossPayee
string | null
LeasedFrom
object | null
LeasedTo
object | null
StartDate
string<date> | null

Date the truck entered service. Date only (yyyy-MM-dd), stored as 00:00 UTC.

EndDate
string<date> | null

Date the truck left service. Date only (yyyy-MM-dd), stored as 00:00 UTC.

OwnerOperatorId
string | null

Driver id of the owner operator the asset belongs to ("Assigned to Owner Operator" in the app). The driver must exist in your account with contractor type Owner Operator. null unassigns the asset: it goes back to its subsidiary's carrier. On a truck, fuel cards with Deduct Fuel follow the change in the same write: they stop deducting when the truck leaves its owner operator, and deduct from the new one when it moves.

SteerTire
string | null

Steer axle tire size. Tire size, free text (e.g. 295/75R22.5).

DriveTire
string | null

Drive axles tire size. Tire size, free text (e.g. 295/75R22.5).

TollPasses
object[] | null

Toll passes, replaced whole. One pass per issuer. null clears.

IftaEnrollments
object[] | null

IFTA enrollments, replaced whole. null clears.

EldProviders
object[] | null

ELD links, replaced whole. Moving an asset off a link stops its location updates from that provider. null clears.

References
object[] | null

Custom references, replaced whole. Each new or changed reference must name a definition the tenant set up for this asset type; type, access and visibility come from the definition. null clears.

Response

OK

Id
string
required
TruckNum
string
required
Status
string
required
SubsidiaryId
string
required
GrossWeight
object
required
EmptyWeight
object
required
FuelCards
object[]
required
Notes
object[]
required
CreatedAt
string<date-time>
required
VinNumber
string | null
Year
integer<int32> | null
Make
string | null
Model
string | null
LicenseNum
string | null
LicenseState
string | null
LicenseCountry
string | null
PlateExpirationDate
string<date> | null
LicenseExpirationDate
string<date> | null
NumberOfAxles
integer<int32> | null
Fleet
object | null
Color
string | null
FuelType
string | null
InsuranceCompany
string | null
InsurancePolicyNumber
string | null
InsuranceExpirationDate
string<date> | null
InspectionExpirationDate
string<date> | null
References
object[] | null
DeductToll
boolean | null
InsuranceValue
number<double> | null
LossPayee
string | null
LeasedFrom
object | null
LeasedTo
object | null
StartDate
string<date> | null
EndDate
string<date> | null
Dimensions
object | null
GrossCombinationWeightRating
object | null
TireCount
integer<int32> | null
FuelProfile
object | null