Petition for Writ of Habeas Corpus. If you want to challenge your immigration detention or other immigration related issues, you should use the form Petition for a Writ of Habeas Corpus under 28.First, a U.S.C. § 2254 allows us to file a petition for Habeas Corpus when the client is in custody under sentence of a state court and is in a state prison. Any defendant who has been convicted of a New York state crime in a proceeding should be aware of their right to file a petition for a Writ of Habeas Corpus. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. This online program from Family Legal Care guides you through filling out a Petition for a Writ of Habeas Corpus. A habeas petition proceeds as a civil action against the State agent (usually a warden) who holds the defendant in custody. The NhRP files a petition for a common law writ of habeas corpus in the New York Supreme Court, Orleans County. Intheblanks form authorizing a filing agent to efile documents on behalf of an individual attorney.