Facebook is locked in a bitter legal dispute with New York prosecutors that could ultimately decide if government investigators are allowed to indiscriminately search certain users’ accounts and retain that data indefinitely. The court battle is also poised to determine how much, if any, power Facebook (NASDAQ:FB) and other social media companies have to contest broad warrants seeking information on hundreds of users at a time.

Chris Sonderby, deputy general counsel at Facebook, revealed in a blog post Thursday that last summer the Manhattan District Attorney’s Office demanded the nearly complete account data on 381 users, including information on the pages they liked, their photos, and the contents of their private conversations. Facebook, having no choice but to provide the relevant data, argued that the warrant constituted an unreasonable search, thus violating the constitutional rights of its users. The judge even forbade the company to inform its users that they were the subjects of an investigation, eliminating the possibility that the individuals themselves would be able to appeal the data requests.

Citing these grounds, the social media company filed a brief Friday asking the judge to quash the search warrants.

“Of the 381 people whose accounts were the subject of these warrants, 62 were later charged in a disability fraud case,” Sonderby wrote. “This means that no charges will be brought against more than 300 people whose data was sought by the government without prior notice to the people affected. …We fought forcefully against these 381 requests and were told by a lower court that as an online service provider we didn’t even have the legal standing to contest the legal warrants.”

The blog post also explained that the Manhattan request is “by far the largest we’ve ever received – by a magnitude of more than 10,” an indication that bulk search warrants that have made headlines in recent months have never exceeded 38 users. Federal laws stipulate that in transparency reports Facebook is only allowed to disclose the number of content requests it received in increments of one thousand. From January to June 2013, for example, the company said it had received 1,000 surveillance requests affecting between 5,000 and 5,999 users.

The case in question began with an investigation into more than 130 civil servants indicted on charges of filing fraudulent Social Security claims to receive disability checks. A spokeswoman for Manhattan DA Cyrus R. Vance Jr. told the New York Times that Facebook pictures proved the accused police officers and firefighters were in fact practicing martial arts, going deep sea fishing, and engaging in other physically demanding activity.

“This was a massive scheme involving as many as 1,000 people who defrauded the federal government of more than $400 million in benefits,” spokeswoman Joan Vollero said. “The defendants in this case repeatedly lied to the government about their mental, physical and social capabilities. Their Facebook accounts told a different story. A judge found there was probable cause to execute search warrants, and two courts have already found Facebook’s claims without merit.”  

Prosecutors have consistently maintained that more indictments are coming in the future. Sonderby claimed that at one point when Facebook made it clear it would be challenging the warrants, an attorney at the district attorney’s office called to threaten Facebook executives with criminal contempt of court charges and put them behind bars.

Manhattan DAs subpoenaed Twitter in a similar case in 2012, demanding that they be given the contents of a message sent by an Occupy Wall Street activist. Twitter attempted to fight the request before being ordered to hand over the relevant information. The judge in that case also ruled that the individual user has no standing to appeal the prosecution’s request.

Orin S. Kerr, a George Washington University law professor and recognized authority on digital seizure, told the Times that Facebook is trying something new in its attempt to challenge a warrant on behalf of its users.

“The real question is, ‘Can they challenge warrants for their customers?’ And I think the answer is probably not, under current law,” he said.