Twitter sued the government in 2014, alleging that the restrictions, which are common to all Internet service providers, infringe its First Amendment right to free speech.
Earlier this year, the Department of Justice asked the federal district court in Oakland, California, to toss out the lawsuit. It argued that the Foreign Intelligence Surveillance Court (FISC) is a more suitable venue to hear the dispute, and that part of Twitter's argument didn't stand because the company isn't disputing document classification decisions made by the government.
On Monday, a judge agreed with the government's latter argument but denied its request to shift the case to FISC.
Judge Yvonne Gonzalez Rogers noted that the First Amendment does not allow someone subject to secrecy obligations to disclose classified information, so by failing to challenge the original classification, Twitter's First Amendment argument didn't stand up.
But she gave Twitter until May 24 to amend its lawsuit and make a case that the surveillance requests are not classified information.
The company, like other Internet service providers, is not allowed to disclose the number of national security letters and Foreign Intelligence Surveillance Act court orders received, even if that number is zero.
A longstanding ban was slightly relaxed in 2014 after the scope of U.S. government surveillance became clear though leaks by Edward Snowden. Companies are now allowed to report requests on a six-month delayed basis, in aggregate bands of 250 requests, but Twitter sued saying that wasn't enough.
The government's attempt to make FISC the venue for the argument failed because Twitter is not disputing an order or decision of the court. It's instead disputing the government's requirement to report the number of requests received in aggregate bands, the judge wrote.