Update a vehicle
Changes one of your vehicles.
Presets are read-only. Free: no credits are charged.
Autenticação
Parâmetros de caminho
idstringobrigatórioA preset id or one of your vehicles (veh_…).
Parâmetros do corpo
application/jsontypestringVehicle type. Only the types listed in GET /v1/limits (allowed_vehicle_types) are accepted.
trucktrailerflatbedcontainerpalletaircraftshipnamestringDisplay name.
lengthnumber · cmInternal cargo-space length, along x (from the front wall toward the door).
widthnumber · cmInternal cargo-space width, along z.
heightnumber · cmInternal cargo-space height, along y.
max_weightnumber · kgMaximum payload.
floor_load_capacitynumber · kg/m²Floor load capacity: 0 or more (0 = no limit).
aux_deckbooleanThe vehicle has a second deck (double-decker).
falseaux_deck_heightnumber · cmSecond deck height above the floor. Required when aux_deck is true.
aux_deck_max_weightnumber · kgLoad limit of the second deck. Required when aux_deck is true.
blocked_areasRect[]Floor zones nothing may stand on (wheel arches, damage, reserved space). Each must lie on the vehicle floor.
xnumber · cmobrigatórioDistance from the front wall to the rectangle's near edge.
znumber · cmobrigatórioDistance from the right wall (z = 0; right as seen from the door looking in) to the rectangle's near edge.
lengthnumber · cmobrigatórioExtent along x.
widthnumber · cmobrigatórioExtent along z.
axle_positionsAcesso mediante pedidonumber[] · cmAxle (support point) positions measured from the front of the cargo area; negative = in front of it. Same length as axle_max_loads. Each between −300 (an axle ahead of the cargo area, e.g. a rigid truck's front axle under the cab) and the vehicle length.
axle_max_loadsAcesso mediante pedidonumber[] · kgMaximum cargo load per axle, in the order of axle_positions. Each greater than 0 and at most 100000.
cog_range_xAcesso mediante pedidonumber · cmAllowed centre-of-gravity deviation from the middle of the length: 0 to length / 2.
cog_range_yAcesso mediante pedidonumber · cmAllowed centre-of-gravity deviation from the middle of the width: 0 to width / 2.
tractor_weightAcesso mediante pedidonumber · kgSemi-trailer axle model: tractor unit mass.
empty_trailer_weightAcesso mediante pedidonumber · kgSemi-trailer axle model: unladen trailer mass.
front_axle_to_middle_axleAcesso mediante pedidonumber · cmSemi-trailer axle model: tractor front axle to drive (middle) axle.
front_axle_to_tractor_cogAcesso mediante pedidonumber · cmSemi-trailer axle model: front axle to tractor centre of gravity.
front_axle_to_kingpinAcesso mediante pedidonumber · cmSemi-trailer axle model: front axle to kingpin (fifth wheel).
kingpin_to_rear_axleAcesso mediante pedidonumber · cmSemi-trailer axle model: kingpin to trailer rear axle group.
trailer_cog_to_rear_axleAcesso mediante pedidonumber · cmSemi-trailer axle model: trailer centre of gravity to rear axle group.
trailer_start_to_kingpinAcesso mediante pedidonumber · cmSemi-trailer axle model: trailer front to kingpin.
max_middle_axle_weightAcesso mediante pedidonumber · kgSemi-trailer axle model: legal drive (middle) axle limit.
max_rear_axle_weightAcesso mediante pedidonumber · kgSemi-trailer axle model: legal rear axle group limit.
Exemplo de pedido
curl -X PATCH "https://runner.cargoduo.com/v1/vehicles/veh_118" \
-H "Authorization: Bearer $CARGODUO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_weight": 25000
}'const res = await fetch("https://runner.cargoduo.com/v1/vehicles/veh_118", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.CARGODUO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"max_weight": 25000
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
response = requests.patch(
"https://runner.cargoduo.com/v1/vehicles/veh_118",
headers={"Authorization": f"Bearer {os.environ['CARGODUO_API_KEY']}"},
json={
"max_weight": 25000,
},
)
print(response.status_code, response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"max_weight": 25000
}`)
req, err := http.NewRequest("PATCH", "https://runner.cargoduo.com/v1/vehicles/veh_118", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CARGODUO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"max_weight": 25000
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://runner.cargoduo.com/v1/vehicles/veh_118"))
.header("Authorization", "Bearer " + System.getenv("CARGODUO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("CARGODUO_API_KEY"));
var json = """
{
"max_weight": 25000
}
""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://runner.cargoduo.com/v1/vehicles/veh_118")
{
Content = new StringContent(json, Encoding.UTF8, "application/json"),
};
var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");<?php
$payload = <<<'JSON'
{
"max_weight": 25000
}
JSON;
$ch = curl_init('https://runner.cargoduo.com/v1/vehicles/veh_118');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CARGODUO_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), ' ', $response, PHP_EOL;require "net/http"
require "uri"
uri = URI("https://runner.cargoduo.com/v1/vehicles/veh_118")
request = Net::HTTP::Patch.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("CARGODUO_API_KEY")}"
request["Content-Type"] = "application/json"
request.body = <<~'JSON'
{
"max_weight": 25000
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.code, response.bodyExemplo de resposta
{
"id": "veh_118",
"object": "vehicle",
"kind": "custom",
"name": "Mega trailer 13.6 m",
"type": "trailer",
"length": 1360,
"width": 248,
"height": 300,
"max_weight": 25000,
"floor_load_capacity": null,
"axle_positions": [],
"axle_max_loads": [],
"cog_range_x": null,
"cog_range_y": null,
"aux_deck": false,
"aux_deck_height": null,
"aux_deck_max_weight": null,
"tractor_weight": null,
"empty_trailer_weight": null,
"front_axle_to_middle_axle": null,
"front_axle_to_tractor_cog": null,
"front_axle_to_kingpin": null,
"kingpin_to_rear_axle": null,
"trailer_cog_to_rear_axle": null,
"trailer_start_to_kingpin": null,
"max_middle_axle_weight": null,
"max_rear_axle_weight": null,
"blocked_areas": [],
"created_by": {
"id": "usr_7",
"name": "Elif Kaya"
},
"updated_by": {
"id": "usr_7",
"name": "Elif Kaya"
},
"created_at": "2026-10-02T08:41:17Z"
}Respostas
200OKThe vehicle after the change.
NomeTipoObrigatórioDescriçãoidstringstringNãoPreset id, or veh_… for your own vehicles.
objectstringstringNãovehiclekindstringstringNãopreset= the predefined catalogue;custom= your organization's.presetcustomtypestringstringNãoVehicle type. Only the types listed in GET /v1/limits (allowed_vehicle_types) are accepted.
trucktrailerflatbedcontainerpalletaircraftshipnamestringstringNãoDisplay name.
lengthnumber · cmnumber · cmNãoInternal cargo-space length, along x (from the front wall toward the door).
widthnumber · cmnumber · cmNãoInternal cargo-space width, along z.
heightnumber · cmnumber · cmNãoInternal cargo-space height, along y.
max_weightnumber · kgnumber · kgNãoMaximum payload.
floor_load_capacitynumber | null · kg/m²number | null · kg/m²NãoFloor load capacity: 0 or more (0 = no limit).
axle_positionsnumber[] · cmnumber[] · cmNãoAxle (support point) positions measured from the front of the cargo area; negative = in front of it. Same length as axle_max_loads. Each between −300 (an axle ahead of the cargo area, e.g. a rigid truck's front axle under the cab) and the vehicle length.
axle_max_loadsnumber[] · kgnumber[] · kgNãoMaximum cargo load per axle, in the order of axle_positions. Each greater than 0 and at most 100000.
cog_range_xnumber | null · cmnumber | null · cmNãoAllowed centre-of-gravity deviation from the middle of the length: 0 to length / 2.
cog_range_ynumber | null · cmnumber | null · cmNãoAllowed centre-of-gravity deviation from the middle of the width: 0 to width / 2.
aux_deckbooleanbooleanNãoThe vehicle has a second deck (double-decker).
aux_deck_heightnumber | null · cmnumber | null · cmNãoSecond deck height above the floor. Required when
aux_deckistrue.aux_deck_max_weightnumber | null · kgnumber | null · kgNãoLoad limit of the second deck. Required when
aux_deckistrue.tractor_weightnumber | null · kgnumber | null · kgNãoSemi-trailer axle model: tractor unit mass.
empty_trailer_weightnumber | null · kgnumber | null · kgNãoSemi-trailer axle model: unladen trailer mass.
front_axle_to_middle_axlenumber | null · cmnumber | null · cmNãoSemi-trailer axle model: tractor front axle to drive (middle) axle.
front_axle_to_tractor_cognumber | null · cmnumber | null · cmNãoSemi-trailer axle model: front axle to tractor centre of gravity.
front_axle_to_kingpinnumber | null · cmnumber | null · cmNãoSemi-trailer axle model: front axle to kingpin (fifth wheel).
kingpin_to_rear_axlenumber | null · cmnumber | null · cmNãoSemi-trailer axle model: kingpin to trailer rear axle group.
trailer_cog_to_rear_axlenumber | null · cmnumber | null · cmNãoSemi-trailer axle model: trailer centre of gravity to rear axle group.
trailer_start_to_kingpinnumber | null · cmnumber | null · cmNãoSemi-trailer axle model: trailer front to kingpin.
max_middle_axle_weightnumber | null · kgnumber | null · kgNãoSemi-trailer axle model: legal drive (middle) axle limit.
max_rear_axle_weightnumber | null · kgnumber | null · kgNãoSemi-trailer axle model: legal rear axle group limit.
blocked_areasRect[]Rect[]NãoFloor zones nothing may stand on (wheel arches, damage, reserved space). Each must lie on the vehicle floor.
xnumber · cmobrigatórionumber · cmSimDistance from the front wall to the rectangle's near edge.
znumber · cmobrigatórionumber · cmSimDistance from the right wall (z = 0; right as seen from the door looking in) to the rectangle's near edge.
lengthnumber · cmobrigatórionumber · cmSimExtent along x.
widthnumber · cmobrigatórionumber · cmSimExtent along z.
created_byUserRef | nullUserRef | nullNãoThe member who created it (for API calls: the member who created the key).
nullwhen unknown.idstringstringNãoMember id (usr_…). Filter lists with ?created_by=.
namestringstringNãoupdated_byUserRef | nullUserRef | nullNãoThe member who last changed it.
idstringstringNãoMember id (usr_…). Filter lists with ?created_by=.
namestringstringNãocreated_atstring | nullstring | nullNãoRFC 3339;
nullfor presets.400Bad request
invalid_jsoninvalid_jsonThe body is not valid JSON or a field has the wrong type.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
401Unauthorized
unauthorizedkey_revokedkey_expiredunauthorizedMissing, malformed or unknown API key.key_revokedThe key was revoked.key_expiredThe key passed its expiry date.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
403Forbidden
preset_read_onlyip_not_allowedsubscription_inactiveaccount_inactivescope_missingpreset_read_onlyPresets cannot be changed or deleted.ip_not_allowedThe calling IP is not on the key's allowlist.subscription_inactiveThe organization has no active subscription that includes the API.account_inactiveThe organization is suspended, or has no owner whose account is active.scope_missingThe key lacks a scope this endpoint needs.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
404Not found
vehicle_not_foundvehicle_not_foundNo vehicle with this id among the presets or your organization's vehicles.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
422Unprocessable entity
validation_failedvalidation_failedThe request is well-formed JSON but describes an invalid job. details[] lists every problem.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
429Too many requests
rate_limitedrate_limitedToo many requests in the current minute, hour or day (per key or per organization), or more than 60 failed authentications per minute from your IP address.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
500Internal server error
internal_errorinternal_errorSomething failed on our side.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
503Service unavailable
api_disabledapi_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.