Back in 2008, Yahoo reportedly mounted a legal challenge to a request by the NSA for the company to hand over data as part of the agency's PRISM program, but was eventually overruled by judges sitting on the secret FISA court that authorizes domestic surveillance programs. Yahoo was ordered to turn over its information, and complied.
The New York Times reports:
The Yahoo ruling, from 2008, shows the company argued that the order violated its users’ Fourth Amendment rights against unreasonable searches and seizures. The court called that worry “overblown.”
“Notwithstanding the parade of horribles trotted out by the petitioner, it has presented no evidence of any actual harm, any egregious risk of error, or any broad potential for abuse,” the court said, adding that the government’s “efforts to protect national security should not be frustrated by the courts.”