N.D. Cent. Code § 32-22-01 (2025)
32-22-01. Persons restrained may prosecute the writ.
Every person imprisoned or restrained of the person's liberty under any pretense whatever may prosecute a writ of habeas corpus to inquire into the cause of such imprisonment or restraint and thereby, except in the cases specified in section 32-22-02, obtain relief from such imprisonment or restraint if it is unlawful.