# Delete

Launch stage: GA

`POST /api/2.0/workspace/delete`

Deletes an object or a directory (and optionally recursively deletes all objects in the directory).
 * If `path` does not exist, this call returns an error `RESOURCE_DOES_NOT_EXIST`.
 * If `path` is a non-empty directory and `recursive` is set to `false`, this call returns an error `DIRECTORY_NOT_EMPTY`.

 Object deletion cannot be undone and deleting a directory recursively is not atomic.

API scopes: workspace

## Request body

- `path` (string, optional)
  The absolute path of the notebook or directory.
- `recursive` (boolean, optional)
  The flag that specifies whether to delete the object recursively. It is `false` by default.
   Please note this deleting directory is not atomic. If it fails in the middle, some of objects
   under this directory may be deleted and cannot be undone.
  Default: `false`

## Response

```json
{}
```

