Upload dependency file. POST /api/openapi/v1/environment-packages/uploads, scope admin.v1.environment-packages.manage.
- Scope:
admin.v1.environment-packages.manage - Permission: Manage dependencies
- Action: manage
- Endpoint: POST
/api/openapi/v1/environment-packages/uploads
Authorization: Bearer \<API_KEY\>. The application must have subject_scope={"mode":"all"}; restricted scopes return 403. Scopes are independently granted. Do not cache responses.
Reuses the UI dependency service. First upload one file to uploads as multipart/form-data, then create or replace with JSON metadata and upload_id. Files must be nonempty and at most 1 GiB.
Receipts are bound to the organization and uploader, expire in one hour and can be consumed once. Replacement requires expected_revision and retains dependency/platform/arch and enabled.
The service calculates size and SHA-256; it does not inspect executable compatibility. Listing preserves UI filters and pagination. Writes and long-running uploads recheck current application authorization.
Common request headers
Apply the “Authentication and headers” section in “Configure the QwenWork console through APIs”: Authorization is required and X-Request-Id is optional. See this page for the required scope.
Whether Idempotency-Key applies and is required is specified in this page’s request parameters; a tracing identifier does not replace an idempotency key.
Request parameters
Request body: optional; Content-Type: multipart/form-data.
Runtime requirement: send a multipart/form-data body with a file part. The current generated contract marks the body optional, which differs from runtime validation; this does not permit omitting the file.
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
file | body | string · binary | Yes | file; format="binary" Part Content-Type: application/octet-stream | - |
Response statuses
| HTTP status | Trigger | Response structure | Client action |
|---|---|---|---|
201 | Request succeeded | See “Response” on this page | Read the response. |
default | Other authentication, authorization, validation or dependency errors | See “General error” in “Configure the QwenWork console through APIs” | Handle the status and code; verify the result and idempotency requirements before retrying writes. |
Response
Content-Type: application/json
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
checksum_sha256 | string | Yes | checksum sha256 | - |
expires_at | string · date-time | Yes | expires at; format="date-time" | - |
file_name | string | Yes | file name | - |
size_bytes | integer · int64 | Yes | size bytes; format="int64" | - |
upload_id | string | Yes | upload id | - |