Need of DTOs when working with APIs

Image Description In Short: We use DTOs to ensure our entity data won’t be affected directly, promoting data encapsulation, security, and cleaner API design.

Extra Info DTO is a design pattern.