Because the purpose of the petition is to gain the release of an unlawfully detained person, the reasons that justify the writ are narrowly defined. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment.An application for a writ of habeas corpus may raise issues related to a person's conviction and demonstrate that they were wrongfully convicted. Petitioner, a state prisoner proceeding pro se, has filed a Petition for Writ of Habeas Corpus pursuant to 28 U.S.C. § 2254. The state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. The required application for a person currently incarcerated in TDCJ to file for a writ of habeas corpus under Texas Code of Criminal Procedure, Article 11.07. Defendant did not file the motion as part of, or in connection with, a petition for writ of habeas corpus or any other pending proceeding. Writ of Habeas Corpus Application Art. 11.07. This packet provides information that can help you as you litigate a habeas corpus petition. Writ of Habeas Corpus.