Update workspace sandbox quota¶
Update sandbox quotas and automatic temporary allocation policy for a workspace you may manage. Setting a limit does not delete existing resources.
PATCH https://api.moi.matrixorigin.cn/v5/agent-sandboxes/quota
Before you call this API¶
Prepare a personal access token and operation permissions for the target workspace. Keep environment, token, workspace, and sandbox ID consistent. Common objects and result confirmation describes resource identity, fields, and states. Replace example resource values with actual values.
Request¶
curl -X PATCH "https://api.moi.matrixorigin.cn/v5/agent-sandboxes/quota" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary '{"max_managed_count":0,"auto_ephemeral":"inherit"}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
0–100. 0 can stop further hosted sandbox allocation. |
|
integer |
No |
0–100; temporary sandbox allocation limit. |
|
string |
No |
inherit, enabled, or disabled: inherit deployment settings, enable automatic temporary allocation, or disable it. |
Submit at least one valid field. Omission/null retains values; explicit 0 must be preserved. Request string policy and response numeric override use different representations; see the field table. Limits affect subsequent admission, without terminating or deleting current sandboxes.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"workspace_id": "workspace-example",
"max_managed_count": 0,
"max_ephemeral_count": 10,
"auto_ephemeral_override": 0,
"updated_by": "user-example",
"updated_at": "2026-11-11T08:00:00Z"
}
}
HTTP 200 data has the following meaning; example values are not defaults.
Field |
Type |
Description |
|---|---|---|
|
string |
OK on success. |
|
string |
Response description. |
|
string |
Current Workspace ID. |
|
integer |
Saved hosted limit. |
|
integer |
Saved temporary limit. |
|
integer |
0 inherit, 1 explicitly enabled, 2 explicitly disabled. |
|
string |
Last updater ID. |
|
string |
Update time in RFC 3339 format. |
Confirm the result¶
Check returned configuration and current hosted usage. override:0 only means inheritance and does not establish the deployment’s effective default automatic policy.
Error handling¶
Use HTTP status and response code. Common errors and recovery distinguishes parameters, permissions, quotas, providers, and unknown outcomes. An error does not prove no resource was created or that retries/cleanup have completed.