Contact an award-winning Writ of Habeas Corpus lawyer today. It tests the legality of a detention or a restraint and the goal is to use it really almost i guess it's an emergency basis.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. A writ of habeas corpus requires that a person who is in custody be brought before a judge or court and that they be able to challenge that custody. Explain the grounds for the petition: You will need to explain why you are seeking 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 do not need a Virginia order to file a habeas case in New York, but normally habeas cases are filed where the child is located. To obtain a writ of habeas corpus, you must show the court that you are in custody in violation of the Constitution or laws of the United States.