Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment.To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. A federal writ of habeas corpus is a legal remedy available to state and federal prisoners who object to their detention or imprisonment. The writ of habeas corpus primarily acts as a writ of inquiry, issued to test the reasons or grounds for restraint and detention. Introduction. This pamphlet is intended as a general guide to assist a person in prosecuting a civil matter in the Appellate Division, Second Department. Learn how a writ of habeas corpus can challenge unlawful detention, potentially reducing or overturning convictions even after appeals fail. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment. If you want to challenge your immigration detention or other immigration related issues, you should use the form Petition for a Writ of Habeas Corpus under 28. Habeas corpus is a legal instrument that allows you to contest your incarceration, conviction, or sentencing conditions.