Update a template
Changes a template.
Items already in projects keep their own copy. Free: no credits are charged.
Authentication
Path parameters
idstringrequiredTemplate id (tpl_…).
Body parameters
application/jsonlabelstringDisplay label.
shapestringItem shape. cylinder and drum use radius + height instead of length + width; pallet and drum always stay upright.
boxcylinderpalletbagdrumDefault "box"lengthnumber · cmLength. Required unless shape is cylinder or drum.
widthnumber · cmWidth. Required unless shape is cylinder or drum.
heightnumber · cmHeight (the vertical side when the item stands as defined).
radiusnumber · cmRadius. Required when shape is cylinder or drum.
weightnumber · kgWeight of ONE unit.
stackablebooleanOther items may be placed on top of this one.
truemax_stack_weightnumber · kgMaximum weight that may rest on one unit. 0 = unlimited.
0rotationstringall = any of the six orientations; upright = may only turn around the vertical axis (this side up); fixed = never rotated.
alluprightfixedDefault "all"hazardousbooleanDangerous goods: kept low and separated from other hazardous items.
falsepriorityintegerLoad priority. Higher = loaded first and kept when space runs out. 0 = none.
0colorstringDisplay colour as #rrggbb (viewer and PDF only).
nesting_heightnumber · cmTelescoping overlap when identical units stack (nested crates, buckets).
0Example request
curl -X PATCH "https://runner.cargoduo.com/v1/templates/tpl_42" \
-H "Authorization: Bearer $CARGODUO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"weight": 480
}'const res = await fetch("https://runner.cargoduo.com/v1/templates/tpl_42", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.CARGODUO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"weight": 480
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
response = requests.patch(
"https://runner.cargoduo.com/v1/templates/tpl_42",
headers={"Authorization": f"Bearer {os.environ['CARGODUO_API_KEY']}"},
json={
"weight": 480,
},
)
print(response.status_code, response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"weight": 480
}`)
req, err := http.NewRequest("PATCH", "https://runner.cargoduo.com/v1/templates/tpl_42", 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 = """
{
"weight": 480
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://runner.cargoduo.com/v1/templates/tpl_42"))
.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 = """
{
"weight": 480
}
""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://runner.cargoduo.com/v1/templates/tpl_42")
{
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'
{
"weight": 480
}
JSON;
$ch = curl_init('https://runner.cargoduo.com/v1/templates/tpl_42');
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/templates/tpl_42")
request = Net::HTTP::Patch.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("CARGODUO_API_KEY")}"
request["Content-Type"] = "application/json"
request.body = <<~'JSON'
{
"weight": 480
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.code, response.bodyExample response
{
"id": "tpl_42",
"object": "template",
"label": "Euro pallet",
"shape": "box",
"length": 120,
"width": 80,
"height": 140,
"radius": 0,
"weight": 480,
"stackable": false,
"max_stack_weight": 0,
"rotation": "all",
"hazardous": false,
"priority": 0,
"color": "#3b82f6",
"nesting_height": 0,
"created_by": {
"id": "usr_7",
"name": "Elif Kaya"
},
"updated_by": {
"id": "usr_7",
"name": "Elif Kaya"
},
"created_at": "2026-09-28T14:05:52Z",
"updated_at": "2026-10-19T09:12:03Z"
}Responses
200OKThe template after the change.
NameTypeRequiredDescriptionidstringstringNoTemplate id (tpl_…).
objectstringstringNotemplatelabelstringstringNoDisplay label.
shapestringstringNoItem shape.
cylinderanddrumuseradius+heightinstead oflength+width;palletanddrumalways stay upright.boxcylinderpalletbagdrumlengthnumber · cmnumber · cmNoLength. Required unless
shapeiscylinderordrum.widthnumber · cmnumber · cmNoWidth. Required unless
shapeiscylinderordrum.heightnumber · cmnumber · cmNoHeight (the vertical side when the item stands as defined).
radiusnumber · cmnumber · cmNoRadius. Required when
shapeiscylinderordrum.weightnumber · kgnumber · kgNoWeight of ONE unit.
stackablebooleanbooleanNoOther items may be placed on top of this one.
max_stack_weightnumber · kgnumber · kgNoMaximum weight that may rest on one unit. 0 = unlimited.
rotationstringstringNoall= any of the six orientations;upright= may only turn around the vertical axis (this side up);fixed= never rotated.alluprightfixedhazardousbooleanbooleanNoDangerous goods: kept low and separated from other hazardous items.
priorityintegerintegerNoLoad priority. Higher = loaded first and kept when space runs out. 0 = none.
colorstringstringNoDisplay colour as #rrggbb (viewer and PDF only).
nesting_heightnumber · cmnumber · cmNoTelescoping overlap when identical units stack (nested crates, buckets).
created_byUserRef | nullUserRef | nullNoThe member who created it (for API calls: the member who created the key).
nullwhen unknown.idstringstringNoMember id (usr_…). Filter lists with ?created_by=.
namestringstringNoupdated_byUserRef | nullUserRef | nullNoThe member who last changed it.
idstringstringNoMember id (usr_…). Filter lists with ?created_by=.
namestringstringNocreated_atstringstringNoRFC 3339.
updated_atstringstringNoRFC 3339.
400Bad request
invalid_jsoninvalid_jsonThe body is not valid JSON or a field has the wrong type.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.
401Unauthorized
unauthorizedkey_revokedkey_expiredunauthorizedMissing, malformed or unknown API key.key_revokedThe key was revoked.key_expiredThe key passed its expiry date.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.
403Forbidden
ip_not_allowedsubscription_inactiveaccount_inactivescope_missingip_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.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.
404Not found
template_not_foundtemplate_not_foundNo template with this id in your organization.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.
422Unprocessable entity
validation_failedvalidation_failedThe request is well-formed JSON but describes an invalid job. details[] lists every problem.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish 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.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.
500Internal server error
internal_errorinternal_errorSomething failed on our side.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.
503Service unavailable
api_disabledapi_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
All error codesNameTypeRequiredDescriptionerrorErrorBodyrequiredErrorBodyYescodestringrequiredstringYesMachine code (snake_case). Branch on this, never on
message.messagestringrequiredstringYesEnglish explanation.
request_idstringrequiredstringYesSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NoPer-field problems (
validation_failed).pathstringstringNoJSON path of the offending field, e.g. items[3].length.
codestringstringNorequired,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.messagestringstringNoEnglish explanation.