Choose one: Check (1) if you are claiming superior rights under a court order. The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty.Include all of your grounds for relief and all of the facts that support each ground for relief in this petition. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. Writ proceedings begin when the convicted defendant files an application for writ of habeas corpus and serves the state with a copy. An application for a Writ of Habeas Corpus is filed when a person seeks relief from unlawful detention or imprisonment. Fill out the Petition for Writ of Habeas Corpus to Return Child. A writ of habeas corpus is filed in the court that convicted the applicant. Please carefully read through all the steps listed below before you begin. In Texas, a writ of habeas corpus is a court order in which the judge demands a law enforcement agency to produce a detainee for a court hearing.