# LAST_ENVIRONMENT_REQUIRED

- Surface: API
- HTTP status: 409
- Details: `{ appId: string }`

## Cause

The delete would leave an App with no Environment, and an App cannot serve without one.

## Fix

Create a replacement Environment before deleting this one, or delete the App itself if that is the intent.

## Related

- [RESOURCE_NOT_EMPTY](https://splitch.dev/docs/error/RESOURCE_NOT_EMPTY)
- [APP_NOT_FOUND](https://splitch.dev/docs/error/APP_NOT_FOUND)

Source: https://splitch.dev/docs/error/LAST_ENVIRONMENT_REQUIRED