You should use this form if. The Habeas Corpus petition claims the arrest, sentence, or trial violated constitutional law, making imprisonment unlawful.Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. Habeas corpus is a kind of petition that you can file in federal court to claim that your imprisonment violates federal law. To file a habeas corpus petition, you must prepare a written request to a court or judge, known as a writ of habeas corpus. A habeas corpus petition attacking a criminal conviction or sentence shall be filed within two years from the date of final judgment in the trial court. The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. Any prisoner, or another person acting on their behalf, may petition the court, or a judge, for a writ of habeas corpus.