Keep your fleet in sync
Planners in Alrik choose vehicles for each tour, and each vehicle's details feed into planning and tour costs. If your vehicles already live in a fleet register, maintenance tool or ERP, keeping a second copy up to date by hand in Connect is slow and drifts.
This guide sets up a sync so that each branch's fleet in Alrik follows your own register.
What you will build
- A regular sync that creates and updates each branch's vehicles in Alrik from your register.
- Vehicles that are off the road shown as unavailable, and vehicles you have disposed of removed.
Before you begin, you need an API key with permission to manage vehicles,
and the origin_reference of each branch — see
Locations.
1. Give every vehicle your own ID
Each vehicle in Alrik can carry an external_id — the identifier your register
already uses for it. It is unique within a branch, and it is how Alrik matches
your vehicles to its own on every sync, so you never need to store Alrik's IDs.
Set it on every vehicle you send.
2. Send the whole fleet, on a schedule or on change
Bulk create or update takes up to 500 vehicles for
one branch in a single request. For each one, Alrik looks up its external_id:
- Already known — the vehicle is updated with the fields you sent. Fields you leave out keep their values.
- New — the vehicle is created. A name is required for this.
The simplest sync sends a branch's entire fleet every time — nightly, or whenever your register changes. Sending a vehicle that has not changed does no harm. Split fleets larger than 500 across several requests.
Send what planners need: capacity (payload, volume, pallets), equipment (crane, tail lift, truck-mounted forklift), dangerous-goods limits, and the vehicle's hourly cost.
Each vehicle in a bulk request succeeds or fails on its own. The request
returns 200 even when some vehicles were rejected — for a missing name, an
unknown fuel type or an external_id repeated in the same request. Check the
failure count in the response, and the reason given for each failed vehicle.
3. Mark vehicles off the road as inactive
A vehicle in for service, or waiting for repair, should stay in Alrik but not be planned. Set its status to inactive with a note saying why. Inactive vehicles are kept, but not counted as available. Set it back to active when it returns.
4. Delete vehicles that have left the fleet
Bulk sync only creates and updates — a vehicle you stop sending is left as it was. When a vehicle leaves your register for good, compare your list with the branch's vehicles and delete the ones that are gone.
Deleted vehicles are hidden but kept for history. If the same external_id
appears in a later sync, the vehicle is restored rather than created again.