A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. A writ of habeas corpus is a judicial mandate to a prison official, usually the warden, ordering that an inmate be brought to the court.Another useful way to use a writ of Habeas Corpus is when trying to litigate issues that were not preserved at trial. In New York, habeas petitions may also be used to challenge the legality of parole violations. This article addresses a defendant's right to file a federal petition for a writ of habeas corpus from a conviction in a state court. When you file a petition for a writ of habeas corpus, you are asking a judge for a hearing to determine whether your imprisonment is lawful. In New York, the Writ of Habeas Corpus plays a crucial role in protecting the rights of individuals who are unlawfully detained or imprisoned. § 6.3 Writ of habeas corpus. Application for a writ of habeas corpus) only the column entitled "Appellate Division Status" need be completed. The Writ of Habeas Corpus is a procedural and extraordinary remedy and it is mainly used as a post-conviction relief for State or Federal detainees.