Petition for a Writ of Habeas Corpus under 28 USC 2241. Category Representing Yourself (Pro Se).A writ of habeas corpus is a limited remedy in New York compared to other states and the federal statute authorizing the writ. 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. The first is that you must file your petition within one year of exhausting your direct appeal. This means that you can only file a federal habeas petition if you have already lost your state direct appeal and your state post-conviction proceedings. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. Though subject to different rules, incarcerated people in both state or federal custody may petition for a federal writ of habeas corpus. What Is Habeas Corpus? The court must rule on a petition for writ of habeas corpus within 60 days after the petition is filed.