Skip to main content
POST
Create truck
The Create Truck endpoint registers a company-owned truck. On success it returns the new truck and its optimistic-concurrency token in the ETag response header. Send that value in the If-Match header of a later Update truck 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 truck:create scope. See Authentication.

Truck number and VIN must be unique

TruckNum must be unique among your company’s trucks. When you supply VinNumber, it must be unique too. A request that would create a duplicate is rejected with 409 Conflict, and the problem type tells you which value clashed: The response does not identify the existing truck. If your credential also has the truck:read scope, find it with Search trucks and update that record instead. This lets an onboarding job that runs twice reconcile with what it already created.

Subsidiary

SubsidiaryId must be a subsidiary that your credential may write to. Get the ids from List subsidiaries. If the credential can write to exactly one subsidiary, you can omit SubsidiaryId and the truck is created in that subsidiary.

Truck status

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. Crashed and Inactive remove the truck from the ELD live map and from the truck lists you pick from in Alvys.

Request parameters

The following parameter is required in the URL path:

Request body

Only TruckNum is required. Dates are date-only values in yyyy-MM-dd format.

Example cURL request

Replace YOUR_ACCESS_TOKEN with your actual Bearer token.

Response fields

A successful request returns 201 Created with the new truck, in the same shape as Get truck. The truck’s current ETag is in the ETag response header.

Example response

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

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

Path Parameters

version
string
default:1.0
required

API version (e.g., 1.0)

Example:

"1.0"

Body

TruckNum
string
required
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. Defaults to Active.

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

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

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.

IftaEnrollments
object[] | null

IFTA enrollments, replaced whole.

EldProviders
object[] | null

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

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.

Response

Created

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