Cancel a job
Stops a queued or running job.
A canceled job pays the per-job fee, any large-load surcharge and the compute used so far, never the per-vehicle fee. Canceling a canceled job returns it unchanged.
Autenticação
Parâmetros de caminho
idstringobrigatórioJob id (job_…).
Exemplo de pedido
curl -X DELETE "https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e" \
-H "Authorization: Bearer $CARGODUO_API_KEY"const res = await fetch("https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.CARGODUO_API_KEY}`,
},
});
const data = await res.json();
console.log(res.status, data);import os
import requests
response = requests.delete(
"https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e",
headers={"Authorization": f"Bearer {os.environ['CARGODUO_API_KEY']}"},
)
print(response.status_code, response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CARGODUO_API_KEY"))
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 {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e"))
.header("Authorization", "Bearer " + System.getenv("CARGODUO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.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 request = new HttpRequestMessage(HttpMethod.Delete, "https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e");
var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");<?php
$ch = curl_init('https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CARGODUO_API_KEY'),
],
]);
$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/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e")
request = Net::HTTP::Delete.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("CARGODUO_API_KEY")}"
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": "job_2cR8vL4nXp6tQb1mZk9WsH5e",
"object": "job",
"status": "canceled",
"reference": "order-1043",
"source": "api",
"created_at": "2026-10-19T09:15:03Z",
"started_at": "2026-10-19T09:15:03Z",
"finished_at": "2026-10-19T09:15:05Z",
"progress": {
"stage": "done",
"vehicles_done": 0,
"placed_items": 0
},
"summary": {
"items_requested": 58,
"items_placed": 0,
"items_unplaced": 0,
"vehicles_used": 0,
"total_weight": 0,
"volume_utilization": 0,
"queue_ms": 15,
"compute_ms": 2300
},
"cost": {
"credits": 0.0715,
"reserved_credits": 1.11,
"rate_card_version": 1,
"breakdown": {
"base": 0.06,
"vehicles": 0,
"compute": 0.0115,
"large_load": 0
}
},
"error": {
"code": "canceled",
"message": "Canceled by request."
},
"warnings": [],
"result_url": "https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e/result",
"pdf_url": "",
"expires_at": "2026-11-02T09:15:03Z"
}Respostas
200OKThe canceled job.
NomeTipoObrigatórioDescriçãoidstringobrigatóriostringSimJob id (job_…).
objectstringobrigatóriostringSimAlways
job.jobstatusstringobrigatóriostringSimqueued→running→succeeded|failed|canceled.queuedrunningsucceededfailedcanceledreferencestringstringNãoYour reference from the request.
sourcestringstringNãoWhere the job was created.
apiplaygroundproject_idstringstringNãoThe project (prj_…) a POST /v1/projects/{id}/pack job saves its plan into. Absent on other jobs.
created_atstringobrigatóriostringSimRFC 3339 timestamp.
started_atstring | nullstring | nullNãoWhen computing started (RFC 3339) or
null.finished_atstring | nullstring | nullNãoWhen the job ended (RFC 3339) or
null.progressJobProgressJobProgressNãoLive progress while queued/running.
stagestringstringNãoCurrent stage, such as
queued,running,finalizingordone. Informational: branch onJob.status.vehicles_doneintegerintegerNãoVehicles packed so far.
placed_itemsintegerintegerNãoItem units placed so far.
summaryJobSummaryJobSummaryNãoCounts and timings.
items_requestedintegerintegerNãoTotal item units (sum of quantities).
items_placedintegerintegerNãoUnits placed.
items_unplacedintegerintegerNãoUnits that could not be placed.
vehicles_usedintegerintegerNãoVehicles that carry at least one item.
total_weightnumber · kgnumber · kgNãoWeight loaded.
volume_utilizationnumbernumberNãoAverage volume utilization of the used vehicles, 0–1.
queue_msintegerintegerNãoTime spent waiting for a compute slot (not billed).
compute_msintegerintegerNãoCompute time (billed).
costJobCostJobCostNãoCredits charged (final once the job ended) and the reservation held while it ran.
creditsnumber · creditsnumber · creditsNãoCredits charged (0 until the job ends). Failed jobs are not charged, except time_limit_exceeded, which is charged like a canceled job.
reserved_creditsnumber · creditsnumber · creditsNãoCredits held while the job was queued/running (the worst-case price). Released when it ends.
rate_card_versionintegerintegerNãoRate card the job is priced with.
breakdownCostBreakdownCostBreakdownNãoItemized price.
basenumber · creditsnumber · creditsNãoPer-job fee.
vehiclesnumber · creditsnumber · creditsNãoPer loaded vehicle (not charged for canceled or time_limit_exceeded jobs).
computenumber · creditsnumber · creditsNãoPer compute-second, pro-rated per millisecond.
large_loadnumber · creditsnumber · creditsNãoSurcharge per started 100 items above the large-load threshold.
errorJobError | nullJobError | nullNãoWhy the job failed or was canceled;
nullotherwise.codestringstringNãoMachine code (see Errors).
messagestringstringNãoEnglish explanation.
warningsWarning[]Warning[]NãoNon-blocking remarks about the request (also repeated in the result).
codestringstringNãoMachine code.
messagestringstringNãoEnglish explanation.
result_urlstringstringNãoGET this URL for the full result once
statusissucceeded.pdf_urlstringstringNãoA browser link that renders the load plan as a PDF (3D views + loading steps). Valid until expires_at. Empty after expiry.
expires_atstringstringNãoWhen the request/result bodies and the PDF link are deleted (RFC 3339). Job metadata and charges are kept.
resultResultResultNãoThe full result, inlined only when requested (?include=result) or when POST /v1/pack?wait= finished in time.
job_idstringstringNãoThe job.
vehiclesResultVehicle[]ResultVehicle[]NãoLoaded vehicles in loading order (empty vehicles are left out).
indexintegerintegerNão0-based position in the plan.
vehicle_idstringstringNãoYour vehicle definition id (for a project job: the slot id, pv_…).
copyintegerintegerNão1-based copy number of that definition (quantity > 1, or added in auto mode).
auto_addedbooleanbooleanNãoAdded by
packing_modeautobeyond thequantityyou listed.namestringstringNãoVehicle name.
typestringstringNãoVehicle type.
lengthnumber · cmnumber · cmNãoCargo-space length.
widthnumber · cmnumber · cmNãoCargo-space width.
heightnumber · cmnumber · cmNãoCargo-space height.
max_weightnumber · kgnumber · kgNãoPayload limit.
items_placedintegerintegerNãoUnits in this vehicle.
total_weightnumber · kgnumber · kgNãoWeight in this vehicle.
volume_utilizationnumbernumberNãoUsed volume / cargo-space volume, 0–1.
weight_utilizationnumbernumberNãototal_weight / max_weight, 0–1 (may exceed 1 with allow_overweight).
center_of_gravityPointPointNãoCentre of gravity of the load (cm).
xnumber · cmnumber · cmNãoynumber · cmnumber · cmNãoznumber · cmnumber · cmNãoplacementsPlacement[]Placement[]NãoEvery unit in this vehicle.
item_idstringstringNãoYour item definition id (for a project job: the item id, item_…).
instanceintegerintegerNão1-based unit number within that item definition (unique across the whole plan).
labelstringstringNãoItem label.
xnumber · cmnumber · cmNãoMin-corner position along the length.
ynumber · cmnumber · cmNãoMin-corner height above the floor.
znumber · cmnumber · cmNãoMin-corner position across the width.
lengthnumber · cmnumber · cmNãoSize along x as placed.
widthnumber · cmnumber · cmNãoSize along z as placed.
heightnumber · cmnumber · cmNãoSize along y as placed.
rotatedbooleanbooleanNãoPlaced in a different orientation than defined.
orientationstringstringNãoWhich defined side lies along x, z and y:
lwh= as defined,wlh= turned 90° around the vertical axis,lhw,hwl,whl,hlw= tipped onto a side.stepintegerintegerNão1-based loading step within the vehicle (load in ascending order).
weightnumber · kgnumber · kgNãoUnit weight.
axle_loadsAcesso mediante pedidoAxleLoad[]AxleLoad[]NãoLoad per axle (vehicles with axle data only).
namestringstringNãoAxle 1,Axle 2… in the order ofaxle_positions.positionnumber · cmnumber · cmNãoAxle position from the front of the cargo area.
loadnumber · kgnumber · kgNãoCargo load on the axle.
maxnumber · kgnumber · kgNãoConfigured maximum (0 = none).
okbooleanbooleanNãoload≤max(alwaystruewithout a maximum).unplacedUnplacedItem[]UnplacedItem[]NãoUnits that could not be placed, with the reason.
item_idstringstringNãoYour item definition id.
instanceintegerintegerNão1-based unit number.
labelstringstringNãoItem label.
reasonstringstringNãoWhy it could not be placed.
warningsWarning[]Warning[]NãoRemarks about the plan.
codestringstringNãoMachine code.
messagestringstringNãoEnglish explanation.
pdf_urlstringstringNãoBrowser link that renders the plan as a PDF.
expires_atstringstringNãoWhen this result is deleted (RFC 3339).
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.
404Not found
job_not_foundjob_not_foundNo job with this id in your 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.
409Conflict
job_already_finishedjob_already_finishedThe job already ended and cannot be canceled.
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.