The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. First, a U.S.C. § 2254 allows us to file a petition for Habeas Corpus when the client is in custody under sentence of a state court and is in a state prison.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. A seasoned New York habeas corpus lawyer can guide and represent you in the filing and litigation of a motion for a writ of habeas corpus. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. You must file a petition for federal habeas corpus. See JLM, Chapter 13, "Federal Habeas Corpus" for more information about federal habeas corpus. Any defendant who has been convicted of a New York state crime in a proceeding should be aware of their right to file a petition for a Writ of Habeas Corpus. In the summer of 2020, New York City made national headlines when it suspended habeas corpus in several counties. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment.