Skip to main content

Create a scheduled task

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

Request and permissions

POST https://openapi.qwenwork.ai/v1/scheduler/tasks Authentication: Authorization: Bearer <access_token>. Use an access token obtained through user OAuth authorization. Required business Scope: scheduler.task.create 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.create. Only user OAuth tokens are supported; application tokens and login sessions are not supported. The task belongs to the authorized user; with organization authorization, it is created in the currently authorized organization. Tasks use the existing scheduled execution capability, continue to run, and may consume quota. This API does not support idempotent replay. Do not automatically retry after a timeout. Revoking OAuth authorization does not automatically disable tasks already created.

Request body

A request body is required.

application/json

A child field is required only when its parent object is present. Union branches are listed separately; fields from all branches are not required together.
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"]
delete_after_runbooleanNoCan be true only for an at trigger.
Default: false
descriptionstringNo—
namestringYesMinimum length: 1
Maximum length: 100
statusstringNoDefault: "active"
Allowed values: ["active", "paused"]
targetobjectYesAdditional properties: false
target.payloadobjectYesAdditional properties: "Subject to schema constraints; see the complete contract"
target.payload.additional_resourcesarrayNoReferences to skill, connector, and expert kit resources to add to the execution session. Combined with the user's default resources as a union; does not change user settings or replace connector authorization. Supported only for cloud targets.
Maximum items: 100
target.payload.additional_resources[]objectNoAdditional properties: false
target.payload.additional_resources[].resource_idstringYesResource UUID, not an installation record ID.
Format: "uuid"
target.payload.additional_resources[].resource_originstringYesskill supports public/org/user; connector and expert_kit support only public/org.
Allowed values: ["public", "org", "user"]
target.payload.additional_resources[].resource_typestringYesAllowed values: ["skill", "connector", "expert_kit"]
target.payload.agent_idstringNo—
target.payload.child_session_modestringNo—
target.payload.delivery_modestringNoEach execution of a new task creates a separate session.
Allowed values: ["", "isolated"]
target.payload.enable_multi_sessionbooleanNo—
target.payload.filesarrayNo—
target.payload.files[]objectNoAdditional properties: true
target.payload.files[].mime_typestringNo—
target.payload.files[].namestringNo—
target.payload.files[].oss_idstringYes—
target.payload.modestringNoAn existing model catalog key (such as pro or flash). Uses the service default when omitted. A key not in the user's model catalog returns 422.
target.payload.promptstringNoExecution prompt. Provide a nonempty prompt or at least one valid files attachment.
target.payload.required_connectorsarrayNoList of connector Nango integration keys for injecting session credentials. These identifiers are distinct from connector resource references in additional_resources.
target.payload.required_connectors[]stringNo—
target.payload.session_namestringNo—
target.payload.variantstringNo—
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
{
  "action": {
    "execution_target": {
      "kind": "cloud"
    }
  },
  "delete_after_run": false,
  "description": "每天上午汇总工作",
  "name": "每日工作摘要",
  "status": "active",
  "target": {
    "payload": {
      "delivery_mode": "isolated",
      "prompt": "汇总今天的待办事项"
    }
  },
  "trigger": {
    "kind": "cron",
    "spec": {
      "expr": "0 9 * * *",
      "tz": "Asia/Shanghai"
    }
  }
}

Success responses

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

HTTP 201

Success Response type: application/json
{
  "action": {
    "execution_target": {
      "kind": "cloud"
    }
  },
  "created_at": "2026-11-16T01:00:00Z",
  "delete_after_run": false,
  "description": "每天上午汇总工作",
  "id": "73abb1ac-8c5a-4538-95ba-97c06297ebce",
  "name": "每日工作摘要",
  "status": "active",
  "target": {
    "kind": "cloud_session",
    "payload": {
      "delivery_mode": "isolated",
      "prompt": "汇总今天的待办事项"
    }
  },
  "trigger": {
    "kind": "cron",
    "spec": {
      "expr": "0 9 * * *",
      "tz": "Asia/Shanghai"
    }
  },
  "type": "time",
  "updated_at": "2026-11-16T01:00:00Z"
}
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 request or pagination. Correct the parameters before calling again.
401User credentials are invalid, expired, or of an unsupported type. Obtain a new user OAuth token.
403Missing the operation Scope or business resource permissions. Check application enablement and user authorization.
404The requested business resource does not exist.
409The task status does not allow this operation. Check the task status.
413The request body exceeds 512 KiB. Reduce its size.
415The request must use application/json.
422The current execution mode is unavailable. Select a mode available to the user.
429Platform rate limiting or a business quota limit was reached. Back off as indicated by the platform response.
500Business processing failed. Use X-Request-Id to troubleshoot. Do not blindly retry if the creation outcome is uncertain.
502The gateway upstream response failed or exceeded 4 MiB. For queries, reduce size. Verify the outcome first if creation is uncertain.
503Gateway or business integration is not configured, or a dependency is unavailable. Contact the platform administrator.
504The request timed out. Creation may have succeeded; query to verify first.
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"
      },
      "CreateTask": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "$ref": "#/components/schemas/Action"
          },
          "delete_after_run": {
            "default": false,
            "description": "Can be true only for an at trigger.",
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "default": "active",
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "target": {
            "additionalProperties": false,
            "properties": {
              "payload": {
                "$ref": "#/components/schemas/Payload"
              }
            },
            "required": [
              "payload"
            ],
            "type": "object"
          },
          "trigger": {
            "$ref": "#/components/schemas/Trigger"
          }
        },
        "required": [
          "name",
          "trigger",
          "target",
          "action"
        ],
        "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"
      },
      "Payload": {
        "additionalProperties": {},
        "properties": {
          "additional_resources": {
            "description": "References to skill, connector, and expert kit resources to add to the execution session. Combined with the user's default resources as a union; does not change user settings or replace connector authorization. Supported only for cloud targets.",
            "items": {
              "$ref": "#/components/schemas/ResourceRef"
            },
            "maxItems": 100,
            "type": "array"
          },
          "agent_id": {
            "type": "string"
          },
          "child_session_mode": {
            "type": "string"
          },
          "delivery_mode": {
            "description": "Each execution of a new task creates a separate session.",
            "enum": [
              "",
              "isolated"
            ],
            "type": "string"
          },
          "enable_multi_session": {
            "type": "boolean"
          },
          "files": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "mime_type": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "oss_id": {
                  "type": "string"
                }
              },
              "required": [
                "oss_id"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "mode": {
            "description": "An existing model catalog key (such as pro or flash). Uses the service default when omitted. A key not in the user's model catalog returns 422.",
            "type": "string"
          },
          "prompt": {
            "description": "Execution prompt. Provide a nonempty prompt or at least one valid files attachment.",
            "type": "string"
          },
          "required_connectors": {
            "description": "List of connector Nango integration keys for injecting session credentials. These identifiers are distinct from connector resource references in additional_resources.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "session_name": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResourceRef": {
        "additionalProperties": false,
        "properties": {
          "resource_id": {
            "description": "Resource UUID, not an installation record ID.",
            "format": "uuid",
            "type": "string"
          },
          "resource_origin": {
            "description": "skill supports public/org/user; connector and expert_kit support only public/org.",
            "enum": [
              "public",
              "org",
              "user"
            ],
            "type": "string"
          },
          "resource_type": {
            "enum": [
              "skill",
              "connector",
              "expert_kit"
            ],
            "type": "string"
          }
        },
        "required": [
          "resource_type",
          "resource_origin",
          "resource_id"
        ],
        "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": {
      "post": {
        "description": "Use a user OAuth token with scheduler.task.create. Only user OAuth tokens are supported; application tokens and login sessions are not supported. The task belongs to the authorized user; with organization authorization, it is created in the currently authorized organization. Tasks use the existing scheduled execution capability, continue to run, and may consume quota. This API does not support idempotent replay. Do not automatically retry after a timeout. Revoking OAuth authorization does not automatically disable tasks already created.",
        "operationId": "createSchedulerTask",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "action": {
                  "execution_target": {
                    "kind": "cloud"
                  }
                },
                "delete_after_run": false,
                "description": "每天上午汇总工作",
                "name": "每日工作摘要",
                "status": "active",
                "target": {
                  "payload": {
                    "delivery_mode": "isolated",
                    "prompt": "汇总今天的待办事项"
                  }
                },
                "trigger": {
                  "kind": "cron",
                  "spec": {
                    "expr": "0 9 * * *",
                    "tz": "Asia/Shanghai"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/CreateTask"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "action": {
                    "execution_target": {
                      "kind": "cloud"
                    }
                  },
                  "created_at": "2026-11-16T01:00:00Z",
                  "delete_after_run": false,
                  "description": "每天上午汇总工作",
                  "id": "73abb1ac-8c5a-4538-95ba-97c06297ebce",
                  "name": "每日工作摘要",
                  "status": "active",
                  "target": {
                    "kind": "cloud_session",
                    "payload": {
                      "delivery_mode": "isolated",
                      "prompt": "汇总今天的待办事项"
                    }
                  },
                  "trigger": {
                    "kind": "cron",
                    "spec": {
                      "expr": "0 9 * * *",
                      "tz": "Asia/Shanghai"
                    }
                  },
                  "type": "time",
                  "updated_at": "2026-11-16T01:00:00Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            },
            "description": "Success",
            "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": "请求或分页无效;修正参数后再调用。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Invalid request or pagination. Correct the parameters before calling again.",
            "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": "用户凭证无效、过期或凭证类型不支持;重新获取用户 OAuth token。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "User credentials are invalid, expired, or of an unsupported type. Obtain a new user OAuth token.",
            "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": "insufficient_scope",
                    "message": "缺少操作 Scope 或业务资源权限;检查应用开通和用户授权。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Missing the operation Scope or business resource permissions. Check application enablement and user authorization.",
            "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 requested business resource does not exist.",
            "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"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "任务状态不允许当前操作;核实任务状态。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The task status does not allow this operation. Check the task status.",
            "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"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "请求正文超过 512 KiB;缩小请求。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The request body exceeds 512 KiB. Reduce its size.",
            "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"
                }
              }
            }
          },
          "415": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "请求必须为 application/json。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The request must use application/json.",
            "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"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "MODE_UNAVAILABLE",
                    "message": "当前执行模式不可用;选择用户可用的模式。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The current execution mode is unavailable. Select a mode available to the 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"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "触发平台限流或业务额度限制;按平台响应退避。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Platform rate limiting or a business quota limit was reached. Back off as indicated by the platform response.",
            "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": {
                "example": {
                  "error": {
                    "code": "internal_error",
                    "message": "业务处理失败;通过 X-Request-Id 排查。创建结果不确定时不要盲目重试。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Business processing failed. Use X-Request-Id to troubleshoot. Do not blindly retry if the creation outcome is uncertain.",
            "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": {
                "example": {
                  "error": {
                    "code": "bad_gateway",
                    "message": "网关上游响应失败或超过 4 MiB;查询可缩小 size。创建结果不确定时先核实。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The gateway upstream response failed or exceeded 4 MiB. For queries, reduce size. Verify the outcome first if creation is uncertain.",
            "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": {
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "网关或业务接入未配置、依赖不可用;联系平台管理员。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "Gateway or business integration is not configured, or a dependency is unavailable. Contact the platform administrator.",
            "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": {
                "example": {
                  "error": {
                    "code": "timeout",
                    "message": "请求超时;创建可能已经成功,先查询核实。"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayError"
                    }
                  ]
                }
              }
            },
            "description": "The request timed out. Creation may have succeeded; query to verify first.",
            "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": "Create a scheduled task",
        "tags": [
          "定时任务"
        ]
      }
    }
  },
  "info": {
    "title": "Create a scheduled task",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.