The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation.What Is Habeas Corpus? In both federal and Texas law, Writs of Habeas Corpus allow convicted individuals to introduce new evidence that wasn't at trial. In Texas, the state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. A Writ of Habeas Corpus (Latin for "that you have the body") may be filed on behalf of a person who is unlawfully imprisoned. Fill out the Petition for Writ of Habeas Corpus to Return Child. A writ of habeas corpus is a legal order that commands an individual or entity to produce a person who is allegedly being detained unlawfully. In a writ of habeas corpus, a defendant seeks to establish that his or her prison sentence is illegal. This can be done in two ways.