Skip to main content

Send a prompt

Call requirements, permissions, request fields, response fields, and error handling.

Request and permissions

POST https://openapi.qwenwork.ai/v1/session/sessions/{session_id}/prompt Authentication: Authorization: Bearer <access_token>; use an access token obtained through user OAuth authorization. Required business Scope: session.session.execute Authorization methods declared by the contract: Organization authorization (organization), personal authorization (personal) The platform must enable the Scope for the application. The user must have the corresponding business permissions, and the target resource must be within their accessible scope. Whether personal or organization authorization is available to the application depends on the actual console configuration.

Behavior and limitations

Omitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; the open platform validates the corresponding Scope declared by each endpoint. Cloud sessions: Queue a prompt as the next turn. Returns 202, meaning the prompt is queued, not executed. Track progress through the event stream or GET /sessions/{session_id}. If the runtime is sleeping, this call resumes it first and may take substantially longer than usual. Set client timeouts accordingly. Sending to an ended session returns 409. Prompt text undergoes content safety checks and may be rejected with 403. Remote-control sessions: Shares public gateway authentication with cloud sessions; this endpoint requires the business Scope stated below. No controller device ID or pairing is required. The target remote-control master switch must be enabled. If explicitly disabled, returns 403 FORBIDDEN with detail.reason=ACP_HOST_DISABLED; rejected write requests return detail.acceptance=not_accepted. An explicitly nonexistent session returns 404 NOT_FOUND with detail.reason=SESSION_NOT_FOUND. Commands route only to target connections signed in to the currently authenticated account. Offline targets, unknown targets, and targets belonging to other accounts all return device unavailable. Unknown request body fields are rejected. All write operations require Idempotency-Key. Do not retry automatically after a timeout or disconnection, even with the same key: acceptance may be unknown, desktop deduplication is bounded, and persistence across restarts is not guaranteed. Errors include detail.acceptance (not_accepted or unknown). No queuing, offline execution, or automatic fallback to cloud is provided. Returns 202 only after an explicit acceptance acknowledgment from the desktop. A busy session returns 409 with reason=SESSION_BUSY. The returned turn_id correlates subsequent events. Files are downloaded as the target account; subsequent download or execution failures are reported through events. Call through the open platform, retaining the existing oauth_app Token, identity resolution, application IP restrictions, and resource ownership checks. Cloud and remote-control parameters retain their actual contract semantics. Short paths such as /sessions in this page are relative to the common prefix /v1/session. Use the full path at the top of this page for actual requests. Supported session types: cloud, remote In the full JSON, x-session-variants preserves the parameters, request bodies, and responses for cloud and remote-control sessions separately. Do not mix fields from the two branches.

Path parameters

ParameterTypeRequiredDescription and constraints
session_idstringYesSession identifier: a UUID for cloud sessions; an opaque identifier on the selected device for remote-control sessions.
Minimum length: 1
Maximum length: 256

Query parameters

ParameterTypeRequiredDescription and constraints
session_typestringNoOmitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; the open platform validates the corresponding Scope declared by each endpoint.
Default: "cloud"
Allowed values: ["cloud", "remote"]
device_idstringNoRequired only for remote control. An opaque target device identifier from device discovery; it must be URL-encoded. The target connection must be signed in to the currently authenticated account.
Minimum length: 1
Maximum length: 256

Header parameters

ParameterTypeRequiredDescription and constraints
Idempotency-KeystringNoRemote-control sessions only: a stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key.
A stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key.
Minimum length: 1
Maximum length: 128

Request body

The request body is required.

application/json

A child field is required only when its containing object exists. Union branches are listed separately; this does not mean that fields from all branches are required simultaneously.
FieldTypeRequiredDescription and constraints
$schemastringNoAt least one of: branch 1
URL of the JSON Schema for this object.
Format: "uri"
attachmentsarrayNoAt least one of: branch 1
Supplementary text for the agent, not displayed in the QwenWork session UI or used to generate titles. At most 10 hidden_text attachments, with at most 100000 UTF-8 bytes of text in total. Entries are submitted with this prompt in array order and are not automatically reinjected in later turns. Content remains in raw events and the agent may repeat it; do not use it for secrets. Omit or pass [] for no attachments; null is not accepted.
Maximum items: 10
attachments[]objectNoAt least one of: branch 1
Additional fields: false
attachments[].textstringYesAt least one of: branch 1
Non-whitespace text for the agent, counted toward the total attachment text limit of 100000 UTF-8 bytes. Does not grant the system role or additional permissions.
Minimum length: 1
Maximum length: 100000
attachments[].typestringYesAt least one of: branch 1
Attachment type. hidden_text sends text to the agent without displaying it as user body text or an attachment card.
Allowed values: ["hidden_text"]
filesarrayNoAt least one of: branch 1
Files to attach, up to 50. Files must already be in storage—this API does not upload them.
Maximum items: 50
files[]objectNoAt least one of: branch 1
Additional fields: false
files[].pathstringYesAt least one of: branch 1
Storage path of an existing file, such as an upload or output from an earlier session. Must not contain "..". Only files owned by the currently authenticated account are accessible.
Minimum length: 1
textstringYesAt least one of: branch 1
Instructions for the agent. 1 to 100000 characters.
Minimum length: 1
Maximum length: 100000
$schemastringNoAt least one of: branch 2
URL of the JSON Schema for this object.
Format: "uri"
filesarrayNoAt least one of: branch 2
Files to attach, up to 50. Files must already be in storage—this API does not upload them.
Maximum items: 50
files[]objectNoAt least one of: branch 2
Additional fields: false
files[].pathstringYesAt least one of: branch 2
Storage path of an existing file, such as an upload or output from an earlier session. Must not contain "..". Only files owned by the currently authenticated account are accessible.
Minimum length: 1
textstringYesAt least one of: branch 2
Instructions for the agent. 1 to 100000 characters.
Minimum length: 1
Maximum length: 100000

Successful responses

Preserve the original response structure of each business endpoint; do not add a common code/msg/data wrapper.

HTTP 202

Accepted Response type: application/json
FieldTypeRequiredDescription and constraints
$schemastringNoAt least one of: branch 1
URL of the JSON Schema for this object.
Format: "uri"
prompt_idstringYesAt least one of: branch 1
Id of this queued prompt. Withdraw it while it is still waiting using DELETE /sessions/{id}/prompt-queue/{prompt_id}.
statusstringYesAt least one of: branch 1
Always "queued". The prompt has been accepted but has not started executing. Poll GET /sessions/{id}, or wait for a prompt_response event.
turn_idstringYesAt least one of: branch 1
Id of the turn this prompt will execute as. Available before the turn starts—retain it to query GET /turns/{turn_id} later or filter the event stream.
$schemastringNoAt least one of: branch 2
URL of the JSON Schema for this object.
Format: "uri"
prompt_idstringYesAt least one of: branch 2
—
session_idstringYesAt least one of: branch 2
—
statusstringYesAt least one of: branch 2
Allowed values: ["accepted"]
turn_idstringYesAt least one of: branch 2
—

Error responses

HTTPDescription and handling
defaultError. Branch on code, not just the HTTP status code—multiple conditions can share the same status code.
Retain the request ID and error fields in the response for troubleshooting. A write operation may already have taken effect after a timeout or disconnection. Do not automatically retry merely because no successful response was received.

Full field contract

The JSON below contains the complete request, response, and error schemas, nested constraints, and public extension definitions for this endpoint. Copy it for verification. Success examples not declared in the contract are not inferred.
{
  "components": {
    "schemas": {
      "SessionPublicErrorBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "Stable machine-readable error code. Branch on it rather than the HTTP status code, because different conditions can share the same status. New codes may be added; treat unrecognized values as unexpected errors in that HTTP status class.",
            "examples": [
              "VALIDATION_ERROR"
            ],
            "type": "string"
          },
          "detail": {
            "description": "Structured context whose shape depends on code—for example, the fields rejected by validation. null when no additional information is available."
          },
          "message": {
            "description": "Human-readable explanation for logs and error displays. The wording is not part of the contract and may change without a version increment.",
            "examples": [
              "Request validation failed"
            ],
            "type": "string"
          },
          "trace_id": {
            "description": "W3C trace id for this request. Include it when reporting problems—it locates the request in platform logs. If the request carried no trace context, this is 32 zero characters.",
            "examples": [
              "00000000000000000000000000000000"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "detail",
          "trace_id"
        ],
        "type": "object"
      },
      "SessionPublicHiddenTextAttachment": {
        "additionalProperties": false,
        "properties": {
          "text": {
            "description": "Non-whitespace text for the agent, counted toward the total attachment text limit of 100000 UTF-8 bytes. Does not grant the system role or additional permissions.",
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "description": "Attachment type. hidden_text sends text to the agent without displaying it as user body text or an attachment card.",
            "enum": [
              "hidden_text"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "text"
        ],
        "type": "object"
      },
      "SessionPublicPromptFile": {
        "additionalProperties": false,
        "properties": {
          "path": {
            "description": "Storage path of an existing file, such as an upload or output from an earlier session. Must not contain \"..\". Only files owned by the currently authenticated account are accessible.",
            "examples": [
              "/Uploads/sales.csv"
            ],
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "type": "object"
      },
      "SessionPublicPromptRequest": {
        "additionalProperties": false,
        "description": "Applies only to cloud sessions. Omit session_type or use cloud. Task input supports text, files, and hidden_text attachments.",
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/PromptRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attachments": {
            "description": "Supplementary text for the agent, not displayed in the QwenWork session UI or used to generate titles. At most 10 hidden_text attachments, with at most 100000 UTF-8 bytes of text in total. Entries are submitted with this prompt in array order and are not automatically reinjected in later turns. Content remains in raw events and the agent may repeat it; do not use it for secrets. Omit or pass [] for no attachments; null is not accepted.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicHiddenTextAttachment"
            },
            "maxItems": 10,
            "type": "array"
          },
          "files": {
            "description": "Files to attach, up to 50. Files must already be in storage—this API does not upload them.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicPromptFile"
            },
            "maxItems": 50,
            "type": "array"
          },
          "text": {
            "description": "Instructions for the agent. 1 to 100000 characters.",
            "examples": [
              "Now chart the monthly totals."
            ],
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "PromptRequest",
        "type": "object"
      },
      "SessionPublicPromptResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/PromptResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "prompt_id": {
            "description": "Id of this queued prompt. Withdraw it while it is still waiting using DELETE /sessions/{id}/prompt-queue/{prompt_id}.",
            "examples": [
              "7d3c9b02-1e46-4a85-9f70-2c58b41ea6d9"
            ],
            "type": "string"
          },
          "status": {
            "description": "Always \"queued\". The prompt has been accepted but has not started executing. Poll GET /sessions/{id}, or wait for a prompt_response event.",
            "examples": [
              "queued"
            ],
            "type": "string"
          },
          "turn_id": {
            "description": "Id of the turn this prompt will execute as. Available before the turn starts—retain it to query GET /turns/{turn_id} later or filter the event stream.",
            "examples": [
              "2f7a1e88-4c05-4b93-8d61-3ea90c5b7d24"
            ],
            "type": "string"
          }
        },
        "required": [
          "prompt_id",
          "turn_id",
          "status"
        ],
        "type": "object"
      },
      "SessionPublicRemoteInitialPrompt": {
        "additionalProperties": false,
        "description": "Applies only to remote-control sessions. Select session_type=remote and provide device_id. Task input accepts only text and files; attachments is unsupported, including [] or null.",
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/RemoteInitialPrompt.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "files": {
            "description": "Files to attach, up to 50. Files must already be in storage—this API does not upload them.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicPromptFile"
            },
            "maxItems": 50,
            "type": "array"
          },
          "text": {
            "description": "Instructions for the agent. 1 to 100000 characters.",
            "examples": [
              "Read sales.csv and produce a weekly summary."
            ],
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "RemoteInitialPrompt",
        "type": "object"
      },
      "SessionPublicRemotePromptResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/RemotePromptResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "prompt_id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "accepted"
            ],
            "type": "string"
          },
          "turn_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "prompt_id",
          "turn_id",
          "status"
        ],
        "type": "object"
      },
      "SessionRelayError": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_description",
          "error_code"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "description": "Authorization: Bearer <access_token>; JSON Content-Type: application/json; charset=utf-8. The current CN Review temporarily allows access only for routing debugging.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/session/sessions/{session_id}/prompt": {
      "post": {
        "description": "Omitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; the open platform validates the corresponding Scope declared by each endpoint.\n\nCloud sessions:\nQueue a prompt as the next turn.\n\n**Returns 202**, meaning the prompt is queued, not executed. Track progress through the event stream or `GET /sessions/{session_id}`.\n\nIf the runtime is sleeping, this call resumes it first and may take substantially longer than usual. Set client timeouts accordingly.\n\nSending to an ended session returns 409. Prompt text undergoes content safety checks and may be rejected with 403.\n\nRemote-control sessions:\nShares public gateway authentication with cloud sessions; this endpoint requires the business Scope stated below. No controller device ID or pairing is required. The target remote-control master switch must be enabled. If explicitly disabled, returns 403 FORBIDDEN with detail.reason=ACP_HOST_DISABLED; rejected write requests return detail.acceptance=not_accepted. An explicitly nonexistent session returns 404 NOT_FOUND with detail.reason=SESSION_NOT_FOUND. Commands route only to target connections signed in to the currently authenticated account. Offline targets, unknown targets, and targets belonging to other accounts all return device unavailable. Unknown request body fields are rejected. All write operations require Idempotency-Key. Do not retry automatically after a timeout or disconnection, even with the same key: acceptance may be unknown, desktop deduplication is bounded, and persistence across restarts is not guaranteed. Errors include detail.acceptance (not_accepted or unknown). No queuing, offline execution, or automatic fallback to cloud is provided. Returns 202 only after an explicit acceptance acknowledgment from the desktop. A busy session returns 409 with reason=SESSION_BUSY. The returned turn_id correlates subsequent events. Files are downloaded as the target account; subsequent download or execution failures are reported through events.\nCall through the open platform, retaining the existing oauth_app Token, identity resolution, application IP restrictions, and resource ownership checks. Cloud and remote-control parameters retain their actual contract semantics.",
        "operationId": "publishedSend-prompt",
        "parameters": [
          {
            "description": "Session identifier: a UUID for cloud sessions; an opaque identifier on the selected device for remote-control sessions.",
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Omitting session_type selects a cloud session. Every remote-control request must use session_type=remote and provide a nonempty device_id. Providing device_id for a cloud session, an empty or unknown type, or duplicate target parameters returns 422 VALIDATION_ERROR. Cross-device aggregated lists and automatic fallback to cloud are not provided. Both types use the same authentication chain; The upstream does not validate OAuth session scope; the open platform validates the corresponding Scope according to the manifest.",
            "in": "query",
            "name": "session_type",
            "schema": {
              "default": "cloud",
              "enum": [
                "cloud",
                "remote"
              ],
              "type": "string"
            }
          },
          {
            "description": "Required only for remote control. An opaque target device identifier from device discovery; it must be URL-encoded. The target connection must be signed in to the currently authenticated account.",
            "in": "query",
            "name": "device_id",
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Remote-control sessions only: a stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "description": "A stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "cloud-files": {
                  "value": {
                    "files": [
                      {
                        "path": "/Uploads/report.csv"
                      }
                    ],
                    "text": "Summarise the report."
                  }
                },
                "cloud-hidden-text": {
                  "value": {
                    "attachments": [
                      {
                        "text": "Focus on the quarterly totals.",
                        "type": "hidden_text"
                      }
                    ],
                    "text": "Summarise the report."
                  }
                },
                "cloud-text": {
                  "value": {
                    "text": "Summarise the report."
                  }
                },
                "remote-files": {
                  "value": {
                    "files": [
                      {
                        "path": "/Uploads/report.csv"
                      }
                    ],
                    "text": "Summarise the report."
                  }
                },
                "remote-text": {
                  "value": {
                    "text": "Summarise the report."
                  }
                }
              },
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionPublicPromptRequest"
                  },
                  {
                    "$ref": "#/components/schemas/SessionPublicRemoteInitialPrompt"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicPromptResponse"
                    },
                    {
                      "$ref": "#/components/schemas/SessionPublicRemotePromptResponse"
                    }
                  ]
                }
              }
            },
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, for log correlation and troubleshooting. Retries generate new IDs; this is not an idempotency key or 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 the sample was not retained.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicErrorBody"
                    },
                    {
                      "$ref": "#/components/schemas/SessionRelayError"
                    }
                  ]
                }
              }
            },
            "description": "Error. Branch on `code`, not just the HTTP status code—multiple conditions can share the same status code.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, for log correlation and troubleshooting. Retries generate new IDs; this is not an idempotency key or 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 the sample was not retained.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "Send a prompt",
        "tags": [
          "会话管理"
        ],
        "x-session-variants": {
          "cloud": {
            "summary": "Send a prompt",
            "description": "Queue a prompt as the next turn.\n\n**Returns 202**, meaning the prompt is queued, not executed. Track progress through the event stream or `GET /sessions/{session_id}`.\n\nIf the runtime is sleeping, this call resumes it first and may take substantially longer than usual. Set client timeouts accordingly.\n\nSending to an ended session returns 409. Prompt text undergoes content safety checks and may be rejected with 403.",
            "parameters": [
              {
                "description": "Session ID returned by POST /sessions.",
                "in": "path",
                "name": "session_id",
                "required": true,
                "schema": {
                  "description": "Session ID returned by POST /sessions.",
                  "format": "uuid",
                  "type": "string"
                }
              }
            ],
            "requestBody": {
              "content": {
                "application/json": {
                  "examples": {
                    "cloud-files": {
                      "value": {
                        "files": [
                          {
                            "path": "/Uploads/report.csv"
                          }
                        ],
                        "text": "Summarise the report."
                      }
                    },
                    "cloud-hidden-text": {
                      "value": {
                        "attachments": [
                          {
                            "text": "Focus on the quarterly totals.",
                            "type": "hidden_text"
                          }
                        ],
                        "text": "Summarise the report."
                      }
                    },
                    "cloud-text": {
                      "value": {
                        "text": "Summarise the report."
                      }
                    }
                  },
                  "schema": {
                    "$ref": "#/components/schemas/SessionPublicPromptRequest"
                  }
                }
              },
              "required": true
            },
            "responses": {
              "202": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicPromptResponse"
                    }
                  }
                },
                "description": "Accepted"
              }
            }
          },
          "remote": {
            "summary": "Send a task to a remote-control session",
            "description": "Shares public gateway authentication with cloud sessions; this endpoint requires the business Scope stated below. No controller device ID or pairing is required. The target remote-control master switch must be enabled. If explicitly disabled, returns 403 FORBIDDEN with detail.reason=ACP_HOST_DISABLED; rejected write requests return detail.acceptance=not_accepted. An explicitly nonexistent session returns 404 NOT_FOUND with detail.reason=SESSION_NOT_FOUND. Commands route only to target connections signed in to the currently authenticated account. Offline targets, unknown targets, and targets belonging to other accounts all return device unavailable. Unknown request body fields are rejected. All write operations require Idempotency-Key. Do not retry automatically after a timeout or disconnection, even with the same key: acceptance may be unknown, desktop deduplication is bounded, and persistence across restarts is not guaranteed. Errors include detail.acceptance (not_accepted or unknown). No queuing, offline execution, or automatic fallback to cloud is provided. Returns 202 only after an explicit acceptance acknowledgment from the desktop. A busy session returns 409 with reason=SESSION_BUSY. The returned turn_id correlates subsequent events. Files are downloaded as the target account; subsequent download or execution failures are reported through events.",
            "parameters": [
              {
                "description": "Opaque target device identifier, possibly including suffixes such as :dev. The target connection must belong to the currently authenticated account.",
                "explode": false,
                "in": "query",
                "name": "device_id",
                "required": true,
                "schema": {
                  "description": "Opaque target device identifier, possibly including suffixes such as :dev. The target connection must belong to the currently authenticated account.",
                  "maxLength": 256,
                  "type": "string"
                }
              },
              {
                "description": "Session identifier on the target device.",
                "in": "path",
                "name": "session_id",
                "required": true,
                "schema": {
                  "description": "Session identifier on the target device.",
                  "maxLength": 256,
                  "type": "string"
                }
              },
              {
                "description": "A stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key.",
                "in": "header",
                "name": "Idempotency-Key",
                "required": true,
                "schema": {
                  "description": "A stable key scoped to the account, device, session, and operation. Slashes, backslashes, whitespace, and control characters are not allowed. Credentials and controller IDs are not part of the key.",
                  "maxLength": 128,
                  "minLength": 1,
                  "type": "string"
                }
              }
            ],
            "requestBody": {
              "content": {
                "application/json": {
                  "examples": {
                    "remote-files": {
                      "value": {
                        "files": [
                          {
                            "path": "/Uploads/report.csv"
                          }
                        ],
                        "text": "Summarise the report."
                      }
                    },
                    "remote-text": {
                      "value": {
                        "text": "Summarise the report."
                      }
                    }
                  },
                  "schema": {
                    "$ref": "#/components/schemas/SessionPublicRemoteInitialPrompt"
                  }
                }
              },
              "required": true
            },
            "responses": {
              "202": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicRemotePromptResponse"
                    }
                  }
                },
                "description": "Accepted"
              }
            }
          }
        },
        "x-supported-session-types": [
          "cloud",
          "remote"
        ]
      }
    }
  },
  "info": {
    "title": "Send a prompt",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.