Skip to content

Delete Environment

DELETE/v1/environments/{environment_id}

Permanently delete an environment by ID. Returns a confirmation of the deletion.

Path Parameters

ParameterTypeRequiredDescription
environment_idstringThe environment ID (env_...)

Request Examples

python
from anthropic import Anthropic

client = Anthropic(
    api_key="sk-sb-YOUR_KEY",
    base_url="https://api.sandbase.ai"
)

result = client.beta.environments.delete(
    environment_id="env_011CZkZ9X2dpNyB7HsEFoRfW"
)
print(result.id)    # "env_011CZkZ9X2dpNyB7HsEFoRfW"
print(result.type)  # "environment_deleted"
bash
curl -X DELETE https://api.sandbase.ai/v1/environments/env_011CZkZ9X2dpNyB7HsEFoRfW \
  -H "Authorization: Bearer sk-sb-YOUR_KEY"

Response

json
{
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "type": "environment_deleted"
}
FieldTypeDescription
idstringThe deleted environment ID
typestringAlways "environment_deleted"

Errors

StatusTypeDescription
401authentication_errorInvalid or missing API key
404not_foundEnvironment not found
409conflictEnvironment is in use by active sessions