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.What is a bail remission motion and how do I file one? 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. 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 judicial mandate to a prison official, usually the warden, ordering that an inmate be brought to the court. This Chapter discusses how the writ of habeas corpus is applied in three states: Florida, New York, and Michigan. A writ of habeas corpus may be served on any day. Generally, one cannot file a writ of habeas corpus unless they show the government has detained them.