释放单个运行队列项
方法: POST
端点: /api/v2/run-queue/items/{queueId}/release
认证: 支持 Authorization: Bearer <YOUR_API_KEY>、api-key: <YOUR_API_KEY> 和 ?token=<YOUR_API_KEY>。推荐优先使用 Bearer token。
POST
/api/v2/run-queue/items/{queueId}/releaseRelease one run queue itemAuthenticationRequired
Stored only in this browser tab. Sent only to https://openapi.coreclaw.com.
Parameters
Required
Queue item ID.
Request BodyRequiredapplication/json
FieldTypeRequiredDescription
reasonstringOptionalRelease reason.Request body (JSON)
什么时候使用这个接口
Section titled “什么时候使用这个接口”用于把单个运行从运行队列移除,使其不再执行。它的作用和批量 释放运行队列项 一样,区别是 queue_ref 直接写在 URL 里——当你只释放一个项时更方便。
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
queueId | 是 | string | 队列项 ID。从 查询运行队列项 返回的 queue_ref 复制。 |
使用 Content-Type: application/json 发送请求体。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
reason | 否 | string | 可选的释放原因,用于事后查阅。 |
JSON 示例
Section titled “JSON 示例”{ "reason": "no longer needed"}curl -X POST "https://openapi.coreclaw.com/api/v2/run-queue/items/123456/release" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ --data '{"reason":"no longer needed"}'{ "code": 0, "data": { "results": [ { "queue_ref": "123456", "success": true } ] }, "message": "success", "request_id": "req-123"}| 字段 | 类型 | 说明 |
|---|---|---|
data.results[] | array | 单项释放结果,结构与批量 释放运行队列项 响应一致。 |
data.results[].queue_ref | string | 该结果对应的队列项 ID。 |
data.results[].success | boolean | 是否释放成功。当项已不在可释放状态时为 false。 |
data.results[].error | string | 可选。仅当 success 为 false 时出现,说明该队列项无法释放的简短原因。 |
- API v2 支持 Bearer token、旧版
api-key请求头和 query token。新集成推荐使用 Bearer token。 - 释放是不可逆的:项会从队列移除且不会执行。如需一次释放多个项,请改用批量 释放运行队列项 接口。
- 状态处理与取消行为可参考 运行生命周期与状态。
HTTP 响应
Section titled “HTTP 响应”| HTTP 状态码 | 应用码 | 含义 |
|---|---|---|
200 | 0 | OK |
400 | 11000 | Bad Request |
401 | 12001 | Unauthorized |
404 | 11004 | Not Found |
422 | 11000 | Unprocessable Entity |
429 | 13000 | Too Many Requests |
500 | 10000 | Internal Server Error |