Create dependency. POST /api/openapi/v1/environment-packages, scope admin.v1.environment-packages.manage.
- Scope:
admin.v1.environment-packages.manage - Permission: Manage dependencies
- Action: manage
- Endpoint: POST
/api/openapi/v1/environment-packages
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: required; Content-Type: application/json.
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
arch | body | string | Yes | arch; enum=["x64", "arm64"] Values: "arm64", "x64" | - |
dependency | body | string | Yes | dependency; maxLength=64, pattern="^[a-z0-9][a-z0-9._-]{0,63}$" | - |
enabled | body | boolean | No | enabled | - |
expected_revision | body | integer · int64 | No | Revision from the latest read; format="int64", minimum=1 | - |
platform | body | string | Yes | platform; enum=["windows", "macos", "linux"] Values: "linux", "macos", "windows" | - |
upload_id | body | string | Yes | upload id | - |
version | body | string | Yes | version; maxLength=64 | - |
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 |
|---|---|---|---|---|
arch | string | Yes | arch; enum=["x64", "arm64"] Values: "arm64", "x64" | - |
checksum_sha256 | string | Yes | checksum sha256 | - |
created_at | string · date-time | Yes | created at; format="date-time" | - |
dependency | string | Yes | dependency; maxLength=64, pattern="^[a-z0-9][a-z0-9._-]{0,63}$" | - |
enabled | boolean | Yes | enabled | - |
file_name | string | Yes | file name | - |
id | string | Yes | id | - |
platform | string | Yes | platform; enum=["windows", "macos", "linux"] Values: "linux", "macos", "windows" | - |
revision | integer · int64 | Yes | Current revision for concurrency control; format="int64" | - |
size_bytes | integer · int64 | Yes | size bytes; format="int64" | - |
updated_at | string · date-time | Yes | updated at; format="date-time" | - |
version | string | Yes | version | - |