Mayor de Blasio says he is prepared to go to court to defend City Hall's decision to withhold e-mails between him and his outside advisors, known as "agents of the city."

NY1 News and the New York Post filed suit against the mayor Thursday over the administration's refusal to release messages exchanged between de Blasio, his top aides, and an outside consultant, Jonathan Rosen.

Rosen is one of five outside advisors to de Blasio whom City Hall has given special status. His consulting firm represents many clients with business before the city.

The de Blasio administration is insisting that even though Rosen and the others are not paid by City Hall they should effectively be treated like city employees and protected from certain Freedom of Information Act requests.

Speaking on his radio program Friday morning, de Blasio 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," he said. "We would have no problem with that. But not ongoing discussions where I'm seeking advice from a private advisor. That's something we believe was appropriate by the legal guidance we received, and of course we'll defend that in court."

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

City Hall did not comment on the lawsuit.