Delete Code Context
DELETE
/v1/sandbox/{sandbox_id}/code/contexts/{context_id}DELETE
/v1/sandbox/{'{sandbox_id}'}/code/contexts/{'{context_id}'}Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Description
Deletes a specific code execution context from a sandbox by its context ID. Once deleted, the context and any variables or state associated with it are permanently removed.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sandbox_id | string | Yes | Sandbox ID or name |
context_id | string | Yes | The ID of the code context to delete |
Responses
200 Success
| Property | Type | Description |
|---|---|---|
status | string | Always "deleted" on success |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X DELETE "https://your-instance.example.com/v1/sandbox/sb_abc123/code/contexts/ctx_xyz789" \
-H "Authorization: Bearer <token>"const response = await fetch(
"https://your-instance.example.com/v1/sandbox/sb_abc123/code/contexts/ctx_xyz789",
{
method: "DELETE",
headers: {
Authorization: "Bearer <token>",
},
}
);
const data = await response.json();
console.log(data); // { status: "deleted" }import requests
response = requests.delete(
"https://your-instance.example.com/v1/sandbox/sb_abc123/code/contexts/ctx_xyz789",
headers={"Authorization": "Bearer <token>"},
)
print(response.json()) # {"status": "deleted"}Response
{"status": "deleted"}{"code": 0, "message": "string", "details": [{"@type": "string"}]}
