32-22-04. By what court application granted
The writ of habeas corpus must be granted, issued, and made returnable as hereinafter
stated:
1. The writ must be granted by the supreme court, or any judge thereof, upon petition by
or on behalf of any person restrained of the person's liberty within this state. When
granted by the court, it, in all cases, shall be issued out of and under the seal of the
supreme court, and may be made returnable, either before the supreme court, or
before the district court or any judge of the district court; or
2. The writ may be granted, issued, and determined by the district courts and the judges
thereof upon petition by or on behalf of any person restrained of the person's liberty in
their respective districts.
When application is made to the supreme court, or to a judge thereof, proof by the oath of the
person applying or other sufficient evidence shall be required that the judge of the district court
having jurisdiction by the provisions of subsection 2 is absent from the judge's district or has
refused to grant such writ, or for some cause to be specially set forth, is incapable of acting, and
if such proof is not produced the application shall be denied.