跳到主要内容
开发者文档API 参考任务

列出任务

您组织的任务,按创建时间倒序分页返回。

GEThttps://runner.cargoduo.com/v1/jobs

认证

Bearer API 密钥 · 所需权限范围jobs:read了解更多

查询参数

名称类型必填说明
limitinteger
integer
否

每页条数。

默认值 201–100
cursorstring
string
否

上一页返回的 next_cursor。

statusstring
string
否

仅返回处于该状态的任务。

queuedrunningsucceededfailedcanceled

请求示例

curl -X GET "https://runner.cargoduo.com/v1/jobs?limit=2&status=succeeded" \
  -H "Authorization: Bearer $CARGODUO_API_KEY"

响应示例

200 OK · JobList
{
  "data": [
    {
      "id": "job_4bK9mT2xQe7LpW1zRc8VdN3f",
      "object": "job",
      "status": "succeeded",
      "reference": "order-1042",
      "source": "api",
      "created_at": "2026-10-19T09:12:03Z",
      "started_at": "2026-10-19T09:12:03Z",
      "finished_at": "2026-10-19T09:12:07Z",
      "progress": {
        "stage": "done",
        "vehicles_done": 1,
        "placed_items": 58
      },
      "summary": {
        "items_requested": 58,
        "items_placed": 58,
        "items_unplaced": 0,
        "vehicles_used": 1,
        "total_weight": 8580,
        "volume_utilization": 0.3116,
        "queue_ms": 12,
        "compute_ms": 4210
      },
      "cost": {
        "credits": 0.28105,
        "reserved_credits": 1.11,
        "rate_card_version": 1,
        "breakdown": {
          "base": 0.06,
          "vehicles": 0.2,
          "compute": 0.02105,
          "large_load": 0
        }
      },
      "error": null,
      "warnings": [],
      "result_url": "https://runner.cargoduo.com/v1/jobs/job_4bK9mT2xQe7LpW1zRc8VdN3f/result",
      "pdf_url": "https://app.cargoduo.com/r/Xq7Lm2Vt9KbR4cN8wZp1Hs6Yd3Fg5Jk0Ta2Ue7Wn4Ci",
      "expires_at": "2026-11-02T09:12:03Z"
    },
    {
      "id": "job_7hN2wQ5rTb9xKc3LmP8sVa1d",
      "object": "job",
      "status": "succeeded",
      "reference": "order-1039",
      "source": "api",
      "created_at": "2026-10-18T07:12:03Z",
      "started_at": "2026-10-18T07:12:03Z",
      "finished_at": "2026-10-18T07:12:05Z",
      "progress": {
        "stage": "done",
        "vehicles_done": 1,
        "placed_items": 24
      },
      "summary": {
        "items_requested": 24,
        "items_placed": 24,
        "items_unplaced": 0,
        "vehicles_used": 1,
        "total_weight": 6240,
        "volume_utilization": 0.2213,
        "queue_ms": 9,
        "compute_ms": 2870
      },
      "cost": {
        "credits": 0.27435,
        "reserved_credits": 1.11,
        "rate_card_version": 1,
        "breakdown": {
          "base": 0.06,
          "vehicles": 0.2,
          "compute": 0.01435,
          "large_load": 0
        }
      },
      "error": null,
      "warnings": [],
      "result_url": "https://runner.cargoduo.com/v1/jobs/job_7hN2wQ5rTb9xKc3LmP8sVa1d/result",
      "pdf_url": "https://app.cargoduo.com/r/Xq7Lm2Vt9KbR4cN8wZp1Hs6Yd3Fg5Jk0Ta2Ue7Wn4Ci",
      "expires_at": "2026-11-01T07:12:03Z"
    }
  ],
  "next_cursor": "job_7hN2wQ5rTb9xKc3LmP8sVa1d"
}

响应

  • 200OK一页任务。
    名称类型必填说明
    dataJob[]
    Job[]
    否
    next_cursorstring
    string
    否

    作为 ?cursor= 传入以获取下一页;最后一页为空。

  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedAPI 密钥缺失、格式错误或无法识别。
    • key_revoked密钥已被撤销。
    • key_expired密钥已过期。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 403Forbiddenip_not_allowedsubscription_inactiveaccount_inactivescope_missing
    • ip_not_allowed调用方 IP 不在该密钥的 IP 白名单中。
    • subscription_inactive组织没有包含 API 的有效订阅。
    • account_inactive组织已被暂停使用,或其所有者的账户均未处于有效状态。
    • scope_missing密钥缺少此接口所需的权限范围。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 422Unprocessable entityvalidation_failed
    • validation_failed请求是格式正确的 JSON,但描述的任务无效。details[] 列出了所有问题。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 429Too many requestsrate_limited
    • rate_limited当前分钟、小时或天内的请求过多(按密钥或按组织计),或您的 IP 地址每分钟认证失败超过 60 次。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 500Internal server errorinternal_error
    • internal_error服务端发生内部错误。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 503Service unavailableapi_disabled
    • api_disabledAPI 暂时停用(维护中),或已对该组织关闭。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码