Delete a workspace sandbox¶
Delete a confirmed workspace hosted sandbox and clean up associated runtime resources. This interrupts sessions using the sandbox.
DELETE https://api.moi.matrixorigin.cn/v5/agent-sandboxes/{sandbox_id}
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 DELETE "https://api.moi.matrixorigin.cn/v5/agent-sandboxes/$SANDBOX_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
sandbox_id is a required path string; there is no request body. Deletion has irreversible runtime resource side effects. Confirm ID, workspace, and ownership first.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {}
}
HTTP 200 data has the following meaning; example values are not defaults.
Field |
Type |
Description |
|---|---|---|
|
string |
OK on success. |
|
string |
Response description. |
|
object |
Empty object on success. |
Confirm the result¶
200 means the deletion chain returned normally; subsequent details may return 404. A 404 or empty list alone does not establish complete external cleanup, because queries hide deleting objects. On failure, retain the original ID and request records. Do not delete other same-name objects as a cleanup substitute.
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.