The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights.How do I file a Writ of Habeas Corpus? Supreme Court - New York County - Criminal Term. 1. 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. This Chapter discusses how the writ of habeas corpus is applied in three states: Florida, New York, and Michigan. 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. New York State Unified Court System. 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. File the claim with the state court in a post-conviction appeal before you can file the claim in your federal.