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.
| Field | Type | Required | Description and constraints |
|---|---|---|---|
action | object | Yes | Additional properties: false |
action.execution_target | object | Yes | Additional properties: false |
action.execution_target.device_id | string | No | Required for desktop; must not be provided for cloud. |
action.execution_target.device_name | string | No | — |
action.execution_target.kind | string | Yes | Allowed values: ["cloud", "desktop"] |
delete_after_run | boolean | No | Can be true only for an at trigger. Default: false |
description | string | No | — |
name | string | Yes | Minimum length: 1 Maximum length: 100 |
status | string | No | Default: "active" Allowed values: ["active", "paused"] |
target | object | Yes | Additional properties: false |
target.payload | object | Yes | Additional properties: "Subject to schema constraints; see the complete contract" |
target.payload.additional_resources | array | No | 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. Maximum items: 100 |
target.payload.additional_resources[] | object | No | Additional properties: false |
target.payload.additional_resources[].resource_id | string | Yes | Resource UUID, not an installation record ID. Format: "uuid" |
target.payload.additional_resources[].resource_origin | string | Yes | skill supports public/org/user; connector and expert_kit support only public/org. Allowed values: ["public", "org", "user"] |
target.payload.additional_resources[].resource_type | string | Yes | Allowed values: ["skill", "connector", "expert_kit"] |
target.payload.agent_id | string | No | — |
target.payload.child_session_mode | string | No | — |
target.payload.delivery_mode | string | No | Each execution of a new task creates a separate session. Allowed values: ["", "isolated"] |
target.payload.enable_multi_session | boolean | No | — |
target.payload.files | array | No | — |
target.payload.files[] | object | No | Additional properties: true |
target.payload.files[].mime_type | string | No | — |
target.payload.files[].name | string | No | — |
target.payload.files[].oss_id | string | Yes | — |
target.payload.mode | string | No | 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. |
target.payload.prompt | string | No | Execution prompt. Provide a nonempty prompt or at least one valid files attachment. |
target.payload.required_connectors | array | No | List of connector Nango integration keys for injecting session credentials. These identifiers are distinct from connector resource references in additional_resources. |
target.payload.required_connectors[] | string | No | — |
target.payload.session_name | string | No | — |
target.payload.variant | string | No | — |
trigger | object | Yes | — |
trigger | object | Yes | Exactly one branch must match: branch 1 Additional properties: false |
trigger.kind | string | Yes | Exactly one branch must match: branch 1 Constant value: "at" |
trigger.spec | object | Yes | Exactly one branch must match: branch 1 Additional properties: true |
trigger.spec.fire | string | Yes | Exactly one branch must match: branch 1 Format: "date-time" |
trigger.spec.rest_day | object | No | Exactly one branch must match: branch 1 Additional properties: true |
trigger.spec.rest_day.enabled | boolean | No | Exactly one branch must match: branch 1 — |
trigger.spec.rest_day.region | string | No | Exactly one branch must match: branch 1 — |
trigger.spec.rest_day.skip_on | string | No | Exactly one branch must match: branch 1 Allowed values: ["WORKDAY", "HOLIDAY"] |
trigger | object | Yes | Exactly one branch must match: branch 2 Additional properties: false |
trigger.kind | string | Yes | Exactly one branch must match: branch 2 Constant value: "every" |
trigger.spec | object | Yes | Exactly one branch must match: branch 2 Additional properties: true |
trigger.spec.interval_ns | integer | Yes | Exactly one branch must match: branch 2 Minimum (inclusive): 60000000000 Maximum (inclusive): 31536000000000000 |
trigger.spec.rest_day | object | No | Exactly one branch must match: branch 2 Additional properties: true |
trigger.spec.rest_day.enabled | boolean | No | Exactly one branch must match: branch 2 — |
trigger.spec.rest_day.region | string | No | Exactly one branch must match: branch 2 — |
trigger.spec.rest_day.skip_on | string | No | Exactly one branch must match: branch 2 Allowed values: ["WORKDAY", "HOLIDAY"] |
trigger.spec.start_from | string | Yes | Exactly one branch must match: branch 2 Format: "date-time" |
trigger | object | Yes | Exactly one branch must match: branch 3 Additional properties: false |
trigger.kind | string | Yes | Exactly one branch must match: branch 3 Constant value: "cron" |
trigger.spec | object | Yes | Exactly one branch must match: branch 3 Additional properties: true |
trigger.spec.expr | string | Yes | Exactly one branch must match: branch 3 Five-field Cron expression |
trigger.spec.rest_day | object | No | Exactly one branch must match: branch 3 Additional properties: true |
trigger.spec.rest_day.enabled | boolean | No | Exactly one branch must match: branch 3 — |
trigger.spec.rest_day.region | string | No | Exactly one branch must match: branch 3 — |
trigger.spec.rest_day.skip_on | string | No | Exactly one branch must match: branch 3 Allowed values: ["WORKDAY", "HOLIDAY"] |
trigger.spec.tz | string | Yes | Exactly one branch must match: branch 3 IANA time zone, such as 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
| Field | Type | Required | Description and constraints |
|---|---|---|---|
action | object | Yes | Additional properties: false |
action.execution_target | object | Yes | Additional properties: false |
action.execution_target.device_id | string | No | Required for desktop; must not be provided for cloud. |
action.execution_target.device_name | string | No | — |
action.execution_target.kind | string | Yes | Allowed values: ["cloud", "desktop"] |
created_at | string | Yes | Format: "date-time" |
delete_after_run | boolean | Yes | Can be true only for an at trigger. Default: false |
description | string | Yes | — |
id | string | Yes | Format: "uuid" |
name | string | Yes | Minimum length: 1 Maximum length: 100 |
status | string | Yes | Default: "active" Allowed values: ["active", "paused"] |
target | object | Yes | Additional properties: false |
target.kind | string | Yes | — |
target.payload | object | Yes | Additional properties: "Subject to schema constraints; see the complete contract" |
trigger | object | Yes | — |
trigger | object | Yes | Exactly one branch must match: branch 1 Additional properties: false |
trigger.kind | string | Yes | Exactly one branch must match: branch 1 Constant value: "at" |
trigger.spec | object | Yes | Exactly one branch must match: branch 1 Additional properties: true |
trigger.spec.fire | string | Yes | Exactly one branch must match: branch 1 Format: "date-time" |
trigger.spec.rest_day | object | No | Exactly one branch must match: branch 1 Additional properties: true |
trigger.spec.rest_day.enabled | boolean | No | Exactly one branch must match: branch 1 — |
trigger.spec.rest_day.region | string | No | Exactly one branch must match: branch 1 — |
trigger.spec.rest_day.skip_on | string | No | Exactly one branch must match: branch 1 Allowed values: ["WORKDAY", "HOLIDAY"] |
trigger | object | Yes | Exactly one branch must match: branch 2 Additional properties: false |
trigger.kind | string | Yes | Exactly one branch must match: branch 2 Constant value: "every" |
trigger.spec | object | Yes | Exactly one branch must match: branch 2 Additional properties: true |
trigger.spec.interval_ns | integer | Yes | Exactly one branch must match: branch 2 Minimum (inclusive): 60000000000 Maximum (inclusive): 31536000000000000 |
trigger.spec.rest_day | object | No | Exactly one branch must match: branch 2 Additional properties: true |
trigger.spec.rest_day.enabled | boolean | No | Exactly one branch must match: branch 2 — |
trigger.spec.rest_day.region | string | No | Exactly one branch must match: branch 2 — |
trigger.spec.rest_day.skip_on | string | No | Exactly one branch must match: branch 2 Allowed values: ["WORKDAY", "HOLIDAY"] |
trigger.spec.start_from | string | Yes | Exactly one branch must match: branch 2 Format: "date-time" |
trigger | object | Yes | Exactly one branch must match: branch 3 Additional properties: false |
trigger.kind | string | Yes | Exactly one branch must match: branch 3 Constant value: "cron" |
trigger.spec | object | Yes | Exactly one branch must match: branch 3 Additional properties: true |
trigger.spec.expr | string | Yes | Exactly one branch must match: branch 3 Five-field Cron expression |
trigger.spec.rest_day | object | No | Exactly one branch must match: branch 3 Additional properties: true |
trigger.spec.rest_day.enabled | boolean | No | Exactly one branch must match: branch 3 — |
trigger.spec.rest_day.region | string | No | Exactly one branch must match: branch 3 — |
trigger.spec.rest_day.skip_on | string | No | Exactly one branch must match: branch 3 Allowed values: ["WORKDAY", "HOLIDAY"] |
trigger.spec.tz | string | Yes | Exactly one branch must match: branch 3 IANA time zone, such as Asia/Shanghai |
type | string | Yes | Constant value: "time" |
updated_at | string | Yes | Format: "date-time" |
Error responses
| HTTP | Description and handling |
|---|---|
400 | Invalid request or pagination. Correct the parameters before calling again. |
401 | User credentials are invalid, expired, or of an unsupported type. Obtain a new user OAuth token. |
403 | Missing the operation Scope or business resource permissions. Check application enablement and user authorization. |
404 | The requested business resource does not exist. |
409 | The task status does not allow this operation. Check the task status. |
413 | The request body exceeds 512 KiB. Reduce its size. |
415 | The request must use application/json. |
422 | The current execution mode is unavailable. Select a mode available to the user. |
429 | Platform rate limiting or a business quota limit was reached. Back off as indicated by the platform response. |
500 | Business processing failed. Use X-Request-Id to troubleshoot. Do not blindly retry if the creation outcome is uncertain. |
502 | The gateway upstream response failed or exceeded 4 MiB. For queries, reduce size. Verify the outcome first if creation is uncertain. |
503 | Gateway or business integration is not configured, or a dependency is unavailable. Contact the platform administrator. |
504 | The request timed out. Creation may have succeeded; query to verify first. |
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.
Expand the complete OpenAPI JSON
Expand the complete OpenAPI JSON