A habeas corpus petition is used to argue that a person is being unlawfully held in custody, and should be released. 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.Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. The writ of habeas corpus is a legal order requiring a person holding another person to produce that individual before a court or judge. In the field shown, click on Petition for Writ of Habeas Corpus, then click on Next. 22. The case number should appear. In United States law, habeas corpus is a recourse challenging the reasons or conditions of a person's confinement under color of law. This Chapter explains an important right—the writ of habeas corpus. Habeas corpus is the right to go before a court or judge and challenge whether the state has lawful grounds to detain the petitioning person. The U.S. Supreme Court interprets the Constitution, which means it defines constitutional rights and violations in the cases it decides.