Skip to main content

OpenAPI Overview

Learn about authentication, scopes, request and response conventions, and the four API categories.

This section covers enterprise management, files and uploads, scheduled tasks, and sessions and execution. Start with the Open Platform Overview for the integration workflow.

Base URL and authentication

The base URL is https://openapi.qwenwork.ai. Append the endpoint path, for example https://openapi.qwenwork.ai/v1/drive/files. Business APIs use a user OAuth access token:
Authorization: Bearer <access_token>
Complete OAuth Authorization to obtain a token with the required business scopes. Enterprise management APIs use organization authorization. See each endpoint for its supported authorization modes.

Access requirements

A successful call requires all of the following:
  1. The app is published and available, and the source IP meets its restrictions.
  2. The platform has enabled the required scopes and authorization mode for the app.
  3. The user has granted the permissions, and the token is valid.
  4. The user has the required business permissions and can access the target resource.

Request and response conventions

  • Use the HTTP method, parameters, and Content-Type specified by the endpoint.
  • Read the response using the structure specified by the endpoint.
  • Record X-Request-ID and X-Trace-ID from responses for troubleshooting.
  • Use the signed URLs and headers returned for file uploads and downloads.

API directory

Enterprise management: 13 endpoints

All require organization authorization. See each endpoint for member, team, seat, audit, and usage permissions.
EndpointMethod and path
Get Enterprise Seat StatisticsGET /v1/biz/seats/stats
List Enterprise MembersGET /v1/biz/members
Create an Enterprise MemberPOST /v1/biz/members
Resolve an Enterprise MemberPOST /v1/biz/members:resolve
Get Enterprise Member DetailsGET /v1/biz/members/{user_id}
Approve a Member Join RequestPOST /v1/biz/member-join-requests/{request_id}:approve
Assign a Member SeatPOST /v1/biz/members/{user_id}:assign-seat
Revoke a Member SeatPOST /v1/biz/members/{user_id}:revoke-seat
List Enterprise Operation Audit LogsGET /v1/biz/operation-logs
Get Usage Data VersionGET /v1/biz/usage/meta
List Member UsageGET /v1/biz/usage/members
Get Member QuotaGET /v1/biz/members/{user_id}/quota
Set Member QuotaPOST /v1/biz/members/{user_id}/quota

Files and uploads: 5 endpoints

EndpointMethod and path
Get File Information and Download URLGET /v1/drive/files
Create or Resume a Direct UploadPOST /v1/drive/direct-uploads
Get an Upload SessionGET /v1/drive/direct-uploads
Complete a Direct UploadPOST /v1/drive/direct-uploads/{session_id}/complete
Cancel a Direct UploadDELETE /v1/drive/direct-uploads/{session_id}

Scheduled tasks: 6 endpoints

Task execution consumes quota. Pause or delete a task to stop it.
EndpointMethod and path
Create a Scheduled TaskPOST /v1/scheduler/tasks
List Scheduled TasksGET /v1/scheduler/tasks
Pause a Scheduled TaskPOST /v1/scheduler/tasks/{id}/pause
Resume a Scheduled TaskPOST /v1/scheduler/tasks/{id}/resume
Run a Scheduled Task OncePOST /v1/scheduler/tasks/{id}/run-once
Delete a Scheduled TaskDELETE /v1/scheduler/tasks/{id}

Sessions and execution: 15 endpoints

Sessions use the cloud by default. For endpoints that support remote control, pass session_type=remote and the target device_id. See each endpoint for details.
EndpointMethod and path
List Execution ModesGET /v1/session/session-modes
Create an App SessionPOST /v1/session/sessions
List SessionsGET /v1/session/sessions
Get Session StatusGET /v1/session/sessions/{session_id}
Send a PromptPOST /v1/session/sessions/{session_id}/prompt
Read Session EventsGET /v1/session/sessions/{session_id}/events
Subscribe to Session EventsGET /v1/session/sessions/{session_id}/events/stream
Answer a Pending QuestionPOST /v1/session/sessions/{session_id}/question-response
Cancel the Current TurnPOST /v1/session/sessions/{session_id}/cancel
Get Session OutputGET /v1/session/sessions/{session_id}/output
List TurnsGET /v1/session/sessions/{session_id}/turns
Get a TurnGET /v1/session/sessions/{session_id}/turns/{turn_id}
List Queued PromptsGET /v1/session/sessions/{session_id}/prompt-queue
Remove a Queued PromptDELETE /v1/session/sessions/{session_id}/prompt-queue/{prompt_id}
Delete a SessionDELETE /v1/session/sessions/{session_id}

Common failures and retries

StatusCheck first
401Token expiration, revocation, unsupported token type, or wrong environment
403App scopes, authorization mode, user permissions, resource access, and source IP
404Endpoint path and environment, resource existence and visibility, and endpoint availability
400 / 422Parameter location, type, range, unknown fields, and cross-field constraints
409Whether the resource state allows the operation, it was already processed, or a conflict exists
429Back off as directed by the service and check quota
5xx / timeoutRecord the request ID, error body, and time; check whether writes took effect first
Read session execution results through SSE events. See Subscribe to Session Events.

Complete public contracts

Each endpoint page describes parameters, responses, and errors. To import a contract into development tools, expand and copy the complete OpenAPI 3.1 JSON at the end of the page.