A petition for writ of habeas corpus is a legal action that allows individuals to challenge their unlawful imprisonment or restraint. What is a Federal Writ of Habeas Corpus?Ask the court for a writ of habeas corpus (a court order telling the facility director to bring you to the court and show a legal reason for holding you) The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully. A writ of habeas corpus is a legal proceeding designed to bring a party before a court to test whether they are being held lawfully. Generally speaking, the writ of habeas corpus is available in any case where the trial court has acted in excess of its jurisdiction. A habeas corpus petition in California allows you to challenge your conviction or sentencing. You can file it only after exhausting all criminal appeals. The most common claims in a federal Writ are 5th, 6th, and 14th Amendment right violations. Habeas petitions provide prisoners whose rights are being violated with a means of requesting assistance from a judge.