“The agency had collected the data from a system it created under the USA Freedom Act. Congress enacted that law in 2015 to end and replace a once-secret program that had systematically collected Americans’ domestic calling records in bulk.”
Read more: https://www.nytimes.com/2018/06/29/us/politics/nsa-call-records-purged.html