Create a template
Saves an item as a template (it shows in the app too).
Same fields and checks as a /v1/pack item. Free: no credits are charged.
Autenticação
Parâmetros do corpo
application/jsonlabelstringobrigatórioDisplay label.
shapestringItem shape. cylinder and drum use radius + height instead of length + width; pallet and drum always stay upright.
boxcylinderpalletbagdrumPredefinição "box"lengthnumber · cmLength. Required unless shape is cylinder or drum.
widthnumber · cmWidth. Required unless shape is cylinder or drum.
heightnumber · cmobrigatórioHeight (the vertical side when the item stands as defined).
radiusnumber · cmRadius. Required when shape is cylinder or drum.
weightnumber · kgobrigatórioWeight 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.
alluprightfixedPredefinição "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).
0Exemplo de pedido
curl -X POST "https://runner.cargoduo.com/v1/templates" \
-H "Authorization: Bearer $CARGODUO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}'const res = await fetch("https://runner.cargoduo.com/v1/templates", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CARGODUO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
response = requests.post(
"https://runner.cargoduo.com/v1/templates",
headers={"Authorization": f"Bearer {os.environ['CARGODUO_API_KEY']}"},
json={
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": False,
"color": "#3b82f6",
},
)
print(response.status_code, response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}`)
req, err := http.NewRequest("POST", "https://runner.cargoduo.com/v1/templates", 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 = """
{
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://runner.cargoduo.com/v1/templates"))
.header("Authorization", "Bearer " + System.getenv("CARGODUO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", 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 = """
{
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://runner.cargoduo.com/v1/templates")
{
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'
{
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}
JSON;
$ch = curl_init('https://runner.cargoduo.com/v1/templates');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("CARGODUO_API_KEY")}"
request["Content-Type"] = "application/json"
request.body = <<~'JSON'
{
"label": "Euro pallet",
"length": 120,
"width": 80,
"height": 140,
"weight": 450,
"stackable": false,
"color": "#3b82f6"
}
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": "tpl_42",
"object": "template",
"label": "Euro pallet",
"shape": "box",
"length": 120,
"width": 80,
"height": 140,
"radius": 0,
"weight": 450,
"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-09-28T14:05:52Z"
}Respostas
201The new template.
NomeTipoObrigatórioDescriçãoidstringstringNãoTemplate id (tpl_…).
objectstringstringNãotemplatelabelstringstringNãoDisplay label.
shapestringstringNãoItem shape.
cylinderanddrumuseradius+heightinstead oflength+width;palletanddrumalways stay upright.boxcylinderpalletbagdrumlengthnumber · cmnumber · cmNãoLength. Required unless
shapeiscylinderordrum.widthnumber · cmnumber · cmNãoWidth. Required unless
shapeiscylinderordrum.heightnumber · cmnumber · cmNãoHeight (the vertical side when the item stands as defined).
radiusnumber · cmnumber · cmNãoRadius. Required when
shapeiscylinderordrum.weightnumber · kgnumber · kgNãoWeight of ONE unit.
stackablebooleanbooleanNãoOther items may be placed on top of this one.
max_stack_weightnumber · kgnumber · kgNãoMaximum weight that may rest on one unit. 0 = unlimited.
rotationstringstringNãoall= any of the six orientations;upright= may only turn around the vertical axis (this side up);fixed= never rotated.alluprightfixedhazardousbooleanbooleanNãoDangerous goods: kept low and separated from other hazardous items.
priorityintegerintegerNãoLoad priority. Higher = loaded first and kept when space runs out. 0 = none.
colorstringstringNãoDisplay colour as #rrggbb (viewer and PDF only).
nesting_heightnumber · cmnumber · cmNãoTelescoping overlap when identical units stack (nested crates, buckets).
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_atstringstringNãoRFC 3339.
updated_atstringstringNãoRFC 3339.
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
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.
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.
413Payload too large
payload_too_largepayload_too_largeThe request body exceeds 10 MB.
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.