A habeas corpus petition is used to argue that a person is being unlawfully held in custody, and should be released. Habeas corpus is a collateral attack on a judgment of imprisonment and is not a substitute for appeal.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. In United States law, habeas corpus is a recourse challenging the reasons or conditions of a person's confinement under color of law. In the field shown, click on Petition for Writ of Habeas Corpus, then click on Next. 22. The case number should appear. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. The purpose of this order is to ensure that the detainee is not being held unlawfully or without sufficient cause. The Latin phrase habeas corpus translates to "you have the body. The privilege of the writ of habeas corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it.