If you want to challenge your immigration detention, you may use the form Petition for a Writ of Habeas Corpus under 28 U.S.C. § 2241 (For Immigration Matters). Forms Find a national federal court form that can be used in all federal courts.Habeas corpus is a kind of petition that you can file in federal court to claim that your imprisonment violates federal law. Federal prisoners may file two different kinds of motions for post-conviction relief: "Section 2255 motions" and "Section 2241 habeas corpus petitions." Habeas is a centuriesold avenue for challenging unlawful confinement, used to seek outright release or a conditional release order. § 2255(f)(1), a defendant has one year from the date a judgment becomes final to file a 28 U.S.C. § 2255 motion. 1983)(Probation is a sufficient restraint on liberty to support a habeas corpus action under §2255). (880) Defendant sought to appeal the district court's denial of his motion for an extension of time to file a notice of appeal under Fed. Before you can file a motion under §2255, you must be in custody under federal law.