The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. Essentially, a writ of habeas corpus is a legal means for any person who is restrained in his liberty to challenge an unlawful restraint.The state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. A habeas corpus writ is solely based on the constitution and whether or not a sentence is constitutional. The parent who files the writ is asking the court to order the other parent to return the child. The Meaning of Habeas Corpus in a Custody Case Please carefully read through all the steps listed below before you begin. A writ of habeas corpus is a powerful legal tool that allows individuals to challenge a criminal conviction or sentence. It gives judges the power to require law enforcement to justify an arrest.