Mayor Bill de Blasio says he is prepared to go to court to fight a Freedom of Information lawsuit filed by NY1 and the New York Post.

The battle centers on the mayor’s refusal to release emails with five outside advisers known as "agents of the city."

One of the advisers, Jonathan Rosen, has a consulting firm that represents many clients with business before the city. 

De Blasio says the advisers should effectively be treated like city employees and protected from certain Freedom of Information Act requests, even though they are not paid by City Hall. 

Speaking on his radio program Friday morning, the mayor says he is doing everything above board.

"In the case of anyone who also happens to have clients, any specific request around the work they did for their clients, and if in any way that interacted with City Hall, that we would release right now. We have no problem with that. But not ongoing discussions where I'm seeking advice from a private adviser. That's something we believe was appropriate by the legal guidance that we received, and of course we'll defend that in court," de Blasio said.

The arrangement has come under fire from government watchdog groups, who say the mayor should be more transparent about his interactions with outside consultants.