Delete custom environment variable. DELETE /api/openapi/v1/environment-variables/custom/{id}, scope admin.v1.environment-variables.manage.
- Scope:
admin.v1.environment-variables.manage - Permission: Manage environment variables
- Action: manage
- Endpoint: DELETE
/api/openapi/v1/environment-variables/custom/{id}
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 environment-variable service. revision applies to the whole configuration. Read the latest configuration after a successful write; a failed subsequent read does not roll back the write.
At most 100 custom variables, identifier keys up to 64 characters and values up to 4096 characters. System keys are reserved. Enabling QWENWORK_USER_SSO_TOKEN requires explicit risk_confirmed=true.
Deletion takes revision as a query parameter. The authenticated organization cannot be overridden in the request.
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
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
id | path | string · uuid | Yes | id; format="uuid" | - |
revision | query | integer · int64 | Yes | Current revision for concurrency control; format="int64", minimum=0 | - |
Response statuses
| HTTP status | Trigger | Response structure | Client action |
|---|---|---|---|
200 | 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 |
|---|---|---|---|---|
changed | boolean | Yes | changed | - |
revision | integer · int64 | Yes | Current revision for concurrency control; format="int64" | - |