# Delete

**Kind:** Constant

**Source:** [`packages/common/decorators/http/request-mapping.decorator.ts`](https://github.com/nestjs/nest/blob/master/packages/common/decorators/http/request-mapping.decorator.ts#L66)

**Part of:** [Common](subsystem-packages-common)

Route handler (method) Decorator. Routes HTTP DELETE requests to the specified path.

`Delete` is a route handler decorator that maps an HTTP `DELETE` request to a controller method. Use it to define endpoints responsible for removing resources or performing delete-oriented actions at a specified path.

## Definition

```ts
createMappingDecorator(RequestMethod.DELETE)
```

## Value

```ts
createMappingDecorator(RequestMethod.DELETE)
```

## Diagram

```mermaid
graph LR
  Client[HTTP Client] -->|DELETE /users/:id| Router[HTTP Router]
  Router -->|matches route| Controller[Controller Method]
  Controller -->|@Delete(':id')| Handler[Delete Handler]
  Handler --> Response[HTTP Response]
```

## Usage

```ts
import { Controller, Delete, Param } from '@nestjs/common';

@Controller('users')
export class UsersController {
  @Delete(':id')
  async remove(@Param('id') id: string) {
    await this.usersService.remove(id);

    return {
      message: `User ${id} deleted successfully`,
    };
  }
}
```

## AI Coding Instructions

- Apply `@Delete()` only to controller methods that handle HTTP `DELETE` requests.
- Provide a route path such as `':id'` when the handler deletes a specific resource.
- Use parameter decorators like `@Param()` to access path values required by the delete operation.
- Delegate deletion logic to a service layer rather than placing persistence logic directly in the controller.
- Return an appropriate response or configure the expected HTTP status code for successful deletion.

## Used by

7 references from 7 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (7)

- `DatabaseController` — `integration/inspector/src/database/database.controller.ts`:14
- `DogsController` — `integration/inspector/src/dogs/dogs.controller.ts`:14
- `UsersController` — `integration/inspector/src/users/users.controller.ts`:14
- `UsersController` — `integration/repl/src/users/users.controller.ts`:14
- `UsersController` — `sample/05-sql-typeorm/src/users/users.controller.ts`:14
- `CatsController` — `sample/06-mongoose/src/cats/cats.controller.ts`:7
- `UsersController` — `sample/07-sequelize/src/users/users.controller.ts`:6
