The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. Petition for Relief From a Conviction or Sentence By a Person in State Custody (Petition Under 28 U. S. C. § 2254 for a Writ of Habeas Corpus).The first is that you must file your petition within one year of exhausting your direct appeal. A writ of habeas corpus may be served on any day. 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. This Chapter discusses how the writ of habeas corpus is applied in three states: Florida, New York, and Michigan. A person illegally imprisoned or otherwise restrained in his liberty within the state, or one acting on his behalf or a party in a child abuse proceeding. A Habeas Corpus Writ is filed with a federal court once the defendant's state appellate remedies have been exhausted. Such petitions can be filed if a defendant has been convicted in a New York state court as well as for defendants convicted in a federal court. Petitioner filed near-identical petitions for common law writs of habeas corpus in the New York.