NY1's lawsuit against Mayor Bill de Blasio is heading to appeals court.

A judge ruled the city must turn over the emails Mayor de Blasio exchanged with an outside advisor, Jonathan Rosen, after NY1 and the New York Post sued for their release.

The mayor's legal team is now appealing the decision. They argue Rosen's messages with the mayor should be protected as though he were a city employee, even though he was never hired by the city of New York as a consultant.

A court date has not been set in the case.