删除构建

OpenAPI 契约

方法
DELETE
路径
/api/v1/builds/{taskId}
认证
jwtBearer (bearer) OR automationKey (bearer)
响应状态
204 400 401 403 404 429 500
请求与响应 Schema
JSON
{
  "requestBody": {},
  "responses": {
    "204": {
      "description": "Build deleted",
      "content": {}
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RequestError"
        }
      }
    },
    "401": {
      "description": "Authentication required or invalid",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "403": {
      "description": "Authenticated but not permitted",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "404": {
      "description": "Requested build was not found",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "429": {
      "description": "HTTP rate limit or API-key NCU usage limit exceeded",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RateLimitError"
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

使用 JWT 或带 build:write 的 nfy_ 密钥删除一个非活跃任务。project task 还要求调用方对项目拥有有效 build:write capability;legacy 或 ad-hoc task 使用 exact-owner fallback。服务会移除受管理的任务文件和任务记录。活跃的待处理/运行中任务,或工作线程尚未停止的任务,必须先取消并等待稳定。

删除还会移除底层输出,因此两条经过认证的 artifact 路由都会在清理完成后停止。该操作无法通过 API 恢复;删除前请复制所有必需 artifact。调用方不能删除项目 capability 或 exact-owner 边界之外的任务。