Amazon will have to pay more than $30 million in consumer refunds and fines for violating the privacy of customers who own Alexa and Ring devices under settlement agreements filed Wednesday.

In one complaint, the Federal Trade Commission alleged that Amazon not only failed to delete the voice data of children at the request of their parents, but also kept the recordings indefinitely in order to refine its algorithm.

In another, the FTC accuses Ring ‒ now owned by Amazon – of allowing its employees to access customers’ private videos and exposing them to hackers.

In the first instance, Amazon violated federal protection laws, the FTC said. In the second, Ring’s actions committed “egregious violations of users’ privacy.”