Skip to main content

Delete a scheduled task

Requirements, permissions, request and response fields, and error handling.

Request and permissions

DELETE https://openapi.qwenwork.ai/v1/scheduler/tasks/{id} Authentication: Authorization: Bearer <access_token>. Use an access token obtained through user OAuth authorization. Required business Scope: scheduler.task.delete Authorization types declared in the contract: Organization authorization (organization) and personal authorization (personal). The platform must enable the Scope for your application. The user must have the relevant business permissions and access to the target resource. Availability of personal and organization authorization for your application depends on its console configuration.

Behavior and limitations

Use a user OAuth token with scheduler.task.delete. Only user OAuth tokens are supported; application tokens and login sessions are not supported. The task is soft-deleted and removed from the cloud scheduling pool, so it no longer fires. Only the task owner can delete it. A nonexistent or deleted task returns 404. Identity parameters such as user_id and org_id, as well as query parameters, are not accepted.

Path parameters

ParameterTypeRequiredDescription and constraints
idstringYesTask ID (UUID).
Format: "uuid"

Request body

The public contract does not declare a request body. Do not add identity fields or undeclared business fields.

Success responses

Each business API retains its original response structure; no common code/msg/data wrapper is added.

HTTP 204

Success. No response body.

Error responses

HTTPDescription and handling
400Invalid task ID or request.
401User credentials are invalid, expired, or of an unsupported type.
403Missing scheduler.task.delete Scope, or the task does not belong to the current user.
404The task does not exist or has been deleted.
500Business processing failed.
502Gateway upstream response failed.
503Gateway or business dependency unavailable.
504Request timed out.
Keep the request ID and error fields from the response for troubleshooting. A write operation may have taken effect even if the request times out or the connection drops. Do not automatically retry solely because you did not receive a success response.

Complete field contract

The JSON below contains the complete request, response, and error schemas, nested constraints, and public extension definitions for this API. Copy it to verify the contract. Success examples not declared in the contract are not inferred.
{
  "components": {
    "schemas": {
      "Error": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "GatewayError": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {
            "type": "null"
          },
          "msg": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "msg",
          "data"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/scheduler/tasks/{id}": {
      "delete": {
        "description": "Use a user OAuth token with scheduler.task.delete. Only user OAuth tokens are supported; application tokens and login sessions are not supported. The task is soft-deleted and removed from the cloud scheduling pool, so it no longer fires. Only the task owner can delete it. A nonexistent or deleted task returns 404. Identity parameters such as user_id and org_id, as well as query parameters, are not accepted.",
        "operationId": "deleteSchedulerTask",
        "parameters": [
          {
            "description": "Task ID (UUID).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success. No response body.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "任务 ID 或请求不合法。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Invalid task ID or request.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "用户凭证无效、过期或凭证类型不支持。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "User credentials are invalid, expired, or of an unsupported type.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "缺少 scheduler.task.delete Scope 或任务不属于当前用户。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Missing scheduler.task.delete Scope, or the task does not belong to the current user.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "任务不存在或已删除。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The task does not exist or has been deleted.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Business processing failed.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Gateway upstream response failed.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Gateway or business dependency unavailable.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Request timed out.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "Delete a scheduled task",
        "tags": [
          "定时任务"
        ]
      }
    }
  },
  "info": {
    "title": "Delete a scheduled task",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.