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.
The base URL is
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.
A successful call requires all of the following:
All require organization authorization. See each endpoint for member, team, seat, audit, and usage permissions.
Task execution consumes quota. Pause or delete a task to stop it.
Sessions use the cloud by default. For endpoints that support remote control, pass
Read session execution results through SSE events. See Subscribe to Session Events.
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.
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:
Access requirements
A successful call requires all of the following:
- The app is published and available, and the source IP meets its restrictions.
- The platform has enabled the required scopes and authorization mode for the app.
- The user has granted the permissions, and the token is valid.
- 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-IDandX-Trace-IDfrom 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.
| Endpoint | Method and path |
|---|---|
| Get Enterprise Seat Statistics | GET /v1/biz/seats/stats |
| List Enterprise Members | GET /v1/biz/members |
| Create an Enterprise Member | POST /v1/biz/members |
| Resolve an Enterprise Member | POST /v1/biz/members:resolve |
| Get Enterprise Member Details | GET /v1/biz/members/{user_id} |
| Approve a Member Join Request | POST /v1/biz/member-join-requests/{request_id}:approve |
| Assign a Member Seat | POST /v1/biz/members/{user_id}:assign-seat |
| Revoke a Member Seat | POST /v1/biz/members/{user_id}:revoke-seat |
| List Enterprise Operation Audit Logs | GET /v1/biz/operation-logs |
| Get Usage Data Version | GET /v1/biz/usage/meta |
| List Member Usage | GET /v1/biz/usage/members |
| Get Member Quota | GET /v1/biz/members/{user_id}/quota |
| Set Member Quota | POST /v1/biz/members/{user_id}/quota |
Files and uploads: 5 endpoints
| Endpoint | Method and path |
|---|---|
| Get File Information and Download URL | GET /v1/drive/files |
| Create or Resume a Direct Upload | POST /v1/drive/direct-uploads |
| Get an Upload Session | GET /v1/drive/direct-uploads |
| Complete a Direct Upload | POST /v1/drive/direct-uploads/{session_id}/complete |
| Cancel a Direct Upload | DELETE /v1/drive/direct-uploads/{session_id} |
Scheduled tasks: 6 endpoints
Task execution consumes quota. Pause or delete a task to stop it.
| Endpoint | Method and path |
|---|---|
| Create a Scheduled Task | POST /v1/scheduler/tasks |
| List Scheduled Tasks | GET /v1/scheduler/tasks |
| Pause a Scheduled Task | POST /v1/scheduler/tasks/{id}/pause |
| Resume a Scheduled Task | POST /v1/scheduler/tasks/{id}/resume |
| Run a Scheduled Task Once | POST /v1/scheduler/tasks/{id}/run-once |
| Delete a Scheduled Task | DELETE /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.
| Endpoint | Method and path |
|---|---|
| List Execution Modes | GET /v1/session/session-modes |
| Create an App Session | POST /v1/session/sessions |
| List Sessions | GET /v1/session/sessions |
| Get Session Status | GET /v1/session/sessions/{session_id} |
| Send a Prompt | POST /v1/session/sessions/{session_id}/prompt |
| Read Session Events | GET /v1/session/sessions/{session_id}/events |
| Subscribe to Session Events | GET /v1/session/sessions/{session_id}/events/stream |
| Answer a Pending Question | POST /v1/session/sessions/{session_id}/question-response |
| Cancel the Current Turn | POST /v1/session/sessions/{session_id}/cancel |
| Get Session Output | GET /v1/session/sessions/{session_id}/output |
| List Turns | GET /v1/session/sessions/{session_id}/turns |
| Get a Turn | GET /v1/session/sessions/{session_id}/turns/{turn_id} |
| List Queued Prompts | GET /v1/session/sessions/{session_id}/prompt-queue |
| Remove a Queued Prompt | DELETE /v1/session/sessions/{session_id}/prompt-queue/{prompt_id} |
| Delete a Session | DELETE /v1/session/sessions/{session_id} |
Common failures and retries
| Status | Check first |
|---|---|
| 401 | Token expiration, revocation, unsupported token type, or wrong environment |
| 403 | App scopes, authorization mode, user permissions, resource access, and source IP |
| 404 | Endpoint path and environment, resource existence and visibility, and endpoint availability |
| 400 / 422 | Parameter location, type, range, unknown fields, and cross-field constraints |
| 409 | Whether the resource state allows the operation, it was already processed, or a conflict exists |
| 429 | Back off as directed by the service and check quota |
| 5xx / timeout | Record the request ID, error body, and time; check whether writes took effect first |