How to File a Writ of Mandamus in Federal or State Court

To file a writ of mandamus, you submit a civil petition asking a court to order a government official or agency to perform a legal duty they have failed to carry out. In most cases involving a stalled federal application, that means filing in federal district court under 28 U.S.C. § 1361, usually paired with a claim under the Administrative Procedure Act.1Office of the Law Revision Counsel. 28 USC 1361 – Action to Compel an Officer of the United States to Perform His Duty2Office of the Law Revision Counsel. 5 USC 706 – Scope of Review Mandamus is treated as an extraordinary remedy, so courts grant it only when the legal requirements line up cleanly.3Cornell Law School. Writ of Mandate (Mandamus)

Confirm You Meet the Three Requirements

Before drafting anything, work through the three conditions a court will apply. You must have a clear legal right to what you’re asking for, meaning the law plainly entitles you to the action. The official or agency must owe you a non-discretionary duty — sometimes called a ministerial duty — where the law requires a specific action rather than a judgment call. And you must show there is no other adequate legal remedy available.4Legal Information Institute (LII) / Cornell Law School. Mandamus

The discretionary line is where many petitions fall apart. An agency may be legally required to process your application, but the outcome of that application is discretionary. A court can order the agency to decide. It cannot order the agency to decide in your favor.

The “no other adequate remedy” requirement generally means you need to have used available administrative channels first — inquiries, service requests, internal appeals. Keep copies of every one of them. If an established procedure exists that could resolve your issue, the court will send you back to use it.

The Most Common Filing: Unreasonable Agency Delay

Most mandamus petitions today come from applicants whose federal filings have sat with an agency for months or years past normal processing times. Immigration cases dominate this category: naturalization petitions, adjustment of status applications, family-based visa petitions, and employment authorization requests.

In delay cases, petitioners typically bring two claims together. The mandamus claim under 28 U.S.C. § 1361 asks the court to order a federal officer to perform a duty owed to you.1Office of the Law Revision Counsel. 28 USC 1361 – Action to Compel an Officer of the United States to Perform His Duty The APA claim asks the court to “compel agency action unlawfully withheld or unreasonably delayed.”2Office of the Law Revision Counsel. 5 USC 706 – Scope of Review They operate under slightly different standards, and courts often analyze them together, so pleading both strengthens your position.

Simply pointing to the calendar is not enough. Federal courts apply a six-factor test from a D.C. Circuit case commonly cited as TRAC to decide whether a delay has become unreasonable. The factors weigh the complexity of the action, any timeline Congress set, the effect on human health or welfare, competing agency priorities, actual prejudice to you, and any bad faith. No single factor decides the outcome, and bad faith is not required. What matters for your petition is that you can plead concrete facts — dates, published processing times, and real harm — that speak to each of these.

Choose the Right Court

Where you file depends on who you are trying to compel.

Federal District Court

If your target is a federal agency or officer, file in a federal district court under 28 U.S.C. § 1361. The petition is styled as a civil complaint: [Your Name] v. [Agency or Officer Name], and it follows the Federal Rules of Civil Procedure. Federal venue rules let you file where a defendant resides, where a substantial part of the events occurred, or, if no real property is involved, where you live.5Office of the Law Revision Counsel. 28 USC 1391 – Venue Generally For most agency delay cases, filing in the district where you live is the most practical option.

Federal Court of Appeals

If you are asking a higher court to override a federal district judge’s decision — a discovery ruling, for example, or a refusal to transfer — you file with the relevant circuit court under Federal Rule of Appellate Procedure 21. The style is In re [Your Name].6LII / Legal Information Institute. Federal Rules of Appellate Procedure Rule 21 – Writs of Mandamus and Prohibition, and Other Extraordinary Writs Appellate mandamus is rare, and the bar is higher than in district court.

State Court

If the official you want to compel is a state or local one — a county clerk, a state licensing agency — file in state court. A state court cannot order a federal officer to act, and a federal court cannot issue mandamus against a state officer.4Legal Information Institute (LII) / Cornell Law School. Mandamus State procedures vary, so check your state’s specific rules.

Draft the Petition

A district court mandamus petition is structured as a civil complaint. It must include the full legal names and addresses of the petitioner and each respondent. In an immigration delay case, respondents typically include the director of the office handling your case, the head of the agency, and the agency itself.

The core of the petition is a chronological statement of facts with specific dates: when you filed, what processing time the agency quoted, when and how you followed up, and what responses you received. Precision here is not optional — this timeline is what the judge reads first.

Identify the exact legal duty the respondent has failed to perform and cite the statute or regulation that creates it. Then explain how your situation meets the three mandamus conditions. If you are also pleading an APA claim, explain how the delay is unreasonable.

Exhibits to Attach

  • Copies of the application or petition you filed with the agency, plus any official receipt notices.
  • Every email, letter, and inquiry you sent to the agency, and any responses.
  • Published processing times from the agency’s website, or any written timeline the agency provided.
  • A signed declaration under penalty of perjury describing the facts and the concrete harm the delay has caused, plus any declarations from others with direct knowledge.

The declaration is where the delay becomes personal. Describe how the stalled application has affected your job, your family, your ability to travel, or your legal status. Courts want real prejudice, not general frustration.

File the Petition and Pay the Fee

File with the clerk of the appropriate federal district court in person, by mail, or through the court’s electronic filing system (CM/ECF). Most courts require or strongly prefer electronic filing, which means registering for a CM/ECF account if you don’t already have one.

The filing fee for a civil action in federal district court is $405 — a $350 statutory fee plus a $55 administrative fee set by the Judicial Conference.7Office of the Law Revision Counsel. 28 USC 1914 – District Court Filing and Miscellaneous Fees8United States Courts. District Court Miscellaneous Fee Schedule Confirm the current amount with your court before filing, since fees are adjusted periodically.

If You Cannot Afford the Fee

You can ask the court to let you proceed in forma pauperis (IFP), which waives the filing fee. This requires a motion with an affidavit listing your assets, income, and expenses and showing you cannot pay. The affidavit must also describe the nature of your case and state that you believe you are entitled to relief.9Office of the Law Revision Counsel. 28 USC 1915 – Proceedings in Forma Pauperis Courts have discretion to grant or deny IFP status, and they can dismiss the case at any time if the claim of poverty proves untrue or the action is frivolous.

Serve the Government

After filing, you must formally deliver copies of the petition and summons to the respondents. Service against the federal government is more involved than standard service, and getting it wrong is one of the fastest ways to lose the case.

When your case targets a federal agency or a federal officer sued in an official capacity, you must serve three separate parties: the U.S. Attorney for the district where you filed, the U.S. Attorney General in Washington, D.C., and the specific agency or officer you are suing.10Department of Justice Archives. Civil Resource Manual 44 – Service on Government Officers in Official Capacity, Agencies All three must be served by certified or registered mail. Miss one and the court may lack jurisdiction over your case.

After serving, file a proof of service confirming that each respondent was served, with dates and method. If you are filing electronically, some courts no longer require a separate proof of service for documents transmitted through CM/ECF, but service on the government itself still requires mail and still has to be documented.

What Happens Next

The case is assigned to a judge for initial review. The court can deny the petition at this stage if the legal requirements clearly aren’t met, and a summary denial can happen before the government even responds. Petitions that don’t establish the three conditions or adequately allege unreasonable delay often die here.

If the petition has facial merit, the court issues an order directing the government to respond, sometimes called an order to show cause. The government must either perform the action you requested or file a formal answer explaining why it isn’t legally required to do so. Federal agencies typically get 60 days to respond, compared to the 21-day deadline for private defendants.

After the response, the court may schedule oral argument or decide on the papers. A favorable ruling produces a peremptory writ ordering the agency to act. From filing to final decision commonly takes several months, and complex cases run longer.

If the Agency Acts Before the Court Rules

Filing the lawsuit frequently prompts the agency to move. Once government attorneys are involved, stalled applications often start advancing. If the agency performs the duty you requested before the judge rules, the case becomes moot, and federal courts must dismiss moot cases whether or not either party asks them to.11Legal Information Institute (LII) / Cornell Law School. Mootness Doctrine Overview For many petitioners, this is the desired result: you wanted the decision, and the lawsuit forced it. The downside is that recovering attorney fees becomes harder once the case is dismissed as moot.

Attorney Fees If You Win

If you prevail, the Equal Access to Justice Act can make the federal government liable for your attorney fees unless the court finds the government’s position was substantially justified or that special circumstances make an award unjust.12Department of Justice Archives. Civil Resource Manual 220 – Attorneys Fees Individuals must have a net worth under $2 million to qualify; businesses and organizations must have a net worth under $7 million and no more than 500 employees.13eCFR. Subpart K – Implementation of the Equal Access to Justice Act (EAJA) in Agency Proceedings The base rate is capped at $125 per hour, adjusted annually for cost of living; in recent years the adjusted rate has exceeded $250 per hour. The fee application must be filed within 30 days of a final judgment.

File Once You’re Ready — Don’t Sit on the Claim

There is no specific statute of limitations for mandamus petitions, but timing still matters. Courts apply the doctrine of laches, which asks whether you waited an unreasonably long time to file and whether that delay harmed the other side.14Legal Information Institute (LII) / Cornell Law School. Laches If you have known about an agency’s failure for years and only file after conditions change, the government can argue that your own delay defeats the petition.

Once you have exhausted your administrative options and the agency still has not acted within a reasonable time, document your efforts and file. A delay you can explain — waiting for an administrative appeal, or only recently learning of the agency’s obligation — reads very differently from silence followed by a sudden lawsuit.