Skip to main content

Pause (disable) a scheduled task

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

Request and permissions

POST https://openapi.qwenwork.ai/v1/scheduler/tasks/{id}/pause Authentication: Authorization: Bearer <access_token>. Use an access token obtained through user OAuth authorization. Required business Scope: scheduler.task.pause 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.pause. Only user OAuth tokens are supported. Sets the task status to paused and removes it from the cloud scheduling pool, so it no longer fires while paused. Only the task owner can pause it. A nonexistent or deleted task returns 404. Identity parameters such as user_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 200

Success. Returns the updated task object. Response type: application/json
FieldTypeRequiredDescription and constraints
actionobjectYesAdditional properties: false
action.execution_targetobjectYesAdditional properties: false
action.execution_target.device_idstringNoRequired for desktop; must not be provided for cloud.
action.execution_target.device_namestringNo—
action.execution_target.kindstringYesAllowed values: ["cloud", "desktop"]
created_atstringYesFormat: "date-time"
delete_after_runbooleanYesCan be true only for an at trigger.
Default: false
descriptionstringYes—
idstringYesFormat: "uuid"
namestringYesMinimum length: 1
Maximum length: 100
statusstringYesDefault: "active"
Allowed values: ["active", "paused"]
targetobjectYesAdditional properties: false
target.kindstringYes—
target.payloadobjectYesAdditional properties: "Subject to schema constraints; see the complete contract"
triggerobjectYes—
triggerobjectYesExactly one branch must match: branch 1
Additional properties: false
trigger.kindstringYesExactly one branch must match: branch 1
Constant value: "at"
trigger.specobjectYesExactly one branch must match: branch 1
Additional properties: true
trigger.spec.firestringYesExactly one branch must match: branch 1
Format: "date-time"
trigger.spec.rest_dayobjectNoExactly one branch must match: branch 1
Additional properties: true
trigger.spec.rest_day.enabledbooleanNoExactly one branch must match: branch 1
—
trigger.spec.rest_day.regionstringNoExactly one branch must match: branch 1
—
trigger.spec.rest_day.skip_onstringNoExactly one branch must match: branch 1
Allowed values: ["WORKDAY", "HOLIDAY"]
triggerobjectYesExactly one branch must match: branch 2
Additional properties: false
trigger.kindstringYesExactly one branch must match: branch 2
Constant value: "every"
trigger.specobjectYesExactly one branch must match: branch 2
Additional properties: true
trigger.spec.interval_nsintegerYesExactly one branch must match: branch 2
Minimum (inclusive): 60000000000
Maximum (inclusive): 31536000000000000
trigger.spec.rest_dayobjectNoExactly one branch must match: branch 2
Additional properties: true
trigger.spec.rest_day.enabledbooleanNoExactly one branch must match: branch 2
—
trigger.spec.rest_day.regionstringNoExactly one branch must match: branch 2
—
trigger.spec.rest_day.skip_onstringNoExactly one branch must match: branch 2
Allowed values: ["WORKDAY", "HOLIDAY"]
trigger.spec.start_fromstringYesExactly one branch must match: branch 2
Format: "date-time"
triggerobjectYesExactly one branch must match: branch 3
Additional properties: false
trigger.kindstringYesExactly one branch must match: branch 3
Constant value: "cron"
trigger.specobjectYesExactly one branch must match: branch 3
Additional properties: true
trigger.spec.exprstringYesExactly one branch must match: branch 3
Five-field Cron expression
trigger.spec.rest_dayobjectNoExactly one branch must match: branch 3
Additional properties: true
trigger.spec.rest_day.enabledbooleanNoExactly one branch must match: branch 3
—
trigger.spec.rest_day.regionstringNoExactly one branch must match: branch 3
—
trigger.spec.rest_day.skip_onstringNoExactly one branch must match: branch 3
Allowed values: ["WORKDAY", "HOLIDAY"]
trigger.spec.tzstringYesExactly one branch must match: branch 3
IANA time zone, such as Asia/Shanghai
typestringYesConstant value: "time"
updated_atstringYesFormat: "date-time"

Error responses

HTTPDescription and handling
400Invalid task ID or request.
401User credentials are invalid, expired, or of an unsupported type.
403Missing scheduler.task.pause 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": {
      "Action": {
        "additionalProperties": false,
        "properties": {
          "execution_target": {
            "additionalProperties": false,
            "properties": {
              "device_id": {
                "description": "Required for desktop; must not be provided for cloud.",
                "type": "string"
              },
              "device_name": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "cloud",
                  "desktop"
                ],
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          }
        },
        "required": [
          "execution_target"
        ],
        "type": "object"
      },
      "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"
      },
      "Task": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "$ref": "#/components/schemas/Action"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delete_after_run": {
            "default": false,
            "description": "Can be true only for an at trigger.",
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "default": "active",
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "target": {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "type": "string"
              },
              "payload": {
                "additionalProperties": {},
                "type": "object"
              }
            },
            "required": [
              "kind",
              "payload"
            ],
            "type": "object"
          },
          "trigger": {
            "$ref": "#/components/schemas/Trigger"
          },
          "type": {
            "const": "time",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "trigger",
          "target",
          "action",
          "status",
          "delete_after_run",
          "id",
          "type",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "Trigger": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "at",
                "type": "string"
              },
              "spec": {
                "additionalProperties": true,
                "properties": {
                  "fire": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "rest_day": {
                    "additionalProperties": true,
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "region": {
                        "type": "string"
                      },
                      "skip_on": {
                        "enum": [
                          "WORKDAY",
                          "HOLIDAY"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "fire"
                ],
                "type": "object"
              }
            },
            "required": [
              "kind",
              "spec"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "every",
                "type": "string"
              },
              "spec": {
                "additionalProperties": true,
                "properties": {
                  "interval_ns": {
                    "maximum": 31536000000000000,
                    "minimum": 60000000000,
                    "type": "integer"
                  },
                  "rest_day": {
                    "additionalProperties": true,
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "region": {
                        "type": "string"
                      },
                      "skip_on": {
                        "enum": [
                          "WORKDAY",
                          "HOLIDAY"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "start_from": {
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "required": [
                  "interval_ns",
                  "start_from"
                ],
                "type": "object"
              }
            },
            "required": [
              "kind",
              "spec"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "cron",
                "type": "string"
              },
              "spec": {
                "additionalProperties": true,
                "properties": {
                  "expr": {
                    "description": "Five-field Cron expression",
                    "type": "string"
                  },
                  "rest_day": {
                    "additionalProperties": true,
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "region": {
                        "type": "string"
                      },
                      "skip_on": {
                        "enum": [
                          "WORKDAY",
                          "HOLIDAY"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "tz": {
                    "description": "IANA time zone, such as Asia/Shanghai",
                    "type": "string"
                  }
                },
                "required": [
                  "expr",
                  "tz"
                ],
                "type": "object"
              }
            },
            "required": [
              "kind",
              "spec"
            ],
            "type": "object"
          }
        ]
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/scheduler/tasks/{id}/pause": {
      "post": {
        "description": "Use a user OAuth token with scheduler.task.pause. Only user OAuth tokens are supported. Sets the task status to paused and removes it from the cloud scheduling pool, so it no longer fires while paused. Only the task owner can pause it. A nonexistent or deleted task returns 404. Identity parameters such as user_id, as well as query parameters, are not accepted.",
        "operationId": "pauseSchedulerTask",
        "parameters": [
          {
            "description": "Task ID (UUID).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            },
            "description": "Success. Returns the updated task object.",
            "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": {
                "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": {
                "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": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Missing scheduler.task.pause 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": {
                "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": "Pause (disable) a scheduled task",
        "tags": [
          "定时任务"
        ]
      }
    }
  },
  "info": {
    "title": "Pause (disable) a scheduled task",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.