Saltar para o conteúdo
CargoDuo logoCargoDuo
Preços
Entrar

Por enquanto, esta documentação está disponível só em inglês.

Cancel a job

Stops a queued or running job.

DELETEhttps://runner.cargoduo.com/v1/jobs/{id}

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

Chave de API Bearer com a permissãopack:writeSaber mais

Parâmetros de caminho

NomeTipoObrigatórioDescrição
idstringobrigatório
string
Sim

Job id (job_…).

Exemplo de pedido

curl -X DELETE "https://runner.cargoduo.com/v1/jobs/job_2cR8vL4nXp6tQb1mZk9WsH5e" \
  -H "Authorization: Bearer $CARGODUO_API_KEY"

Exemplo de resposta

200 OK · Job
{
  "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ção
    idstringobrigatório
    string
    Sim

    Job id (job_…).

    objectstringobrigatório
    string
    Sim

    Always job.

    job
    statusstringobrigatório
    string
    Sim

    queued → running → succeeded | failed | canceled.

    queuedrunningsucceededfailedcanceled
    referencestring
    string
    Não

    Your reference from the request.

    sourcestring
    string
    Não

    Where the job was created.

    apiplayground
    project_idstring
    string
    Não

    The project (prj_…) a POST /v1/projects/{id}/pack job saves its plan into. Absent on other jobs.

    created_atstringobrigatório
    string
    Sim

    RFC 3339 timestamp.

    started_atstring | null
    string | null
    Não

    When computing started (RFC 3339) or null.

    finished_atstring | null
    string | null
    Não

    When the job ended (RFC 3339) or null.

    progressJobProgress
    JobProgress
    Não

    Live progress while queued/running.

    summaryJobSummary
    JobSummary
    Não

    Counts and timings.

    costJobCost
    JobCost
    Não

    Credits charged (final once the job ended) and the reservation held while it ran.

    errorJobError | null
    JobError | null
    Não

    Why the job failed or was canceled; null otherwise.

    warningsWarning[]
    Warning[]
    Não

    Non-blocking remarks about the request (also repeated in the result).

    result_urlstring
    string
    Não

    GET this URL for the full result once status is succeeded.

    pdf_urlstring
    string
    Não

    A browser link that renders the load plan as a PDF (3D views + loading steps). Valid until expires_at. Empty after expiry.

    expires_atstring
    string
    Não

    When the request/result bodies and the PDF link are deleted (RFC 3339). Job metadata and charges are kept.

    resultResult
    Result
    Não

    The full result, inlined only when requested (?include=result) or when POST /v1/pack?wait= finished in time.

  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedMissing, malformed or unknown API key.
    • key_revokedThe key was revoked.
    • key_expiredThe key passed its expiry date.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 403Forbiddenip_not_allowedsubscription_inactiveaccount_inactivescope_missing
    • 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.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 404Not foundjob_not_found
    • job_not_foundNo job with this id in your organization.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 409Conflictjob_already_finished
    • job_already_finishedThe job already ended and cannot be canceled.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 429Too many requestsrate_limited
    • rate_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.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 500Internal server errorinternal_error
    • internal_errorSomething failed on our side.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro
  • 503Service unavailableapi_disabled
    • api_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
    NomeTipoObrigatórioDescrição
    errorErrorBodyobrigatório
    ErrorBody
    Sim
    Todos os códigos de erro