
    Jerrid ALLEN, Plaintiff-Appellant, v. Kevin C. MILAS, Consul General, U.S. Consulate, Frankfurt, Germany; Charles J. Wintheiser, Consular Section Chief, U.S. Consulate, Frankfurt, Germany; Kirstjen M. Nielsen, Secretary, U.S. Department of Homeland Security; L. Francis Cissna, Director, U.S. Citizenship and Immigration Services; Mike Pompeo, U.S. Secretary of State, Defendants-Appellees.
    No. 16-15728
    United States Court of Appeals, Ninth Circuit.
    Argued and Submitted October 12, 2017 San Francisco, California Filed July 24, 2018
    Anna Benvenue (argued) and Robert Jobe, Law Office of Robert B. Jobe, San Francisco, California, for Plaintiff-Appellant.
    Audrey Hemesath (argued), Assistant United States Attorney; Phillip A. Talbert, United States Attorney; United States Attorney's Office, Sacramento, California; for Defendants-Appellees.
    Before: A. Wallace Tashima and Jay S. Bybee, Circuit Judges, and Matthew Frederick Leitman, District Judge.
    
      
      The Honorable Matthew Frederick Leitman, United States District Judge for the Eastern District of Michigan, sitting by designation.
    
   BYBEE, Circuit Judge:

Jerrid Allen petitions under the Administrative Procedure Act (APA), 5 U.S.C. § 551 et seq ., for review of a decision by the U.S. Consulate in Frankfurt, Germany to deny a visa to his wife. Allen claims that the consular officer committed legal error in denying Mrs. Allen a visa, and that the error was "arbitrary, capricious, ... or otherwise not in accordance with law." Id. § 706(2)(A). We hold that the APA provides no avenue for judicial review in this case. Rather, the only standard by which we can review the merits of a consular officer's denial of a visa is for constitutional error, where the visa application is denied without a "facially legitimate and bona fide reason." Kleindienst v. Mandel , 408 U.S. 753, 769, 92 S.Ct. 2576, 33 L.Ed.2d 683 (1972). We affirm the district court's denial of Allen's petition for a writ of mandamus.

I

Allen is a U.S. citizen and a Major in the United States Army. While stationed in Germany following deployment to Iraq, Allen married Dorothea Baer ("Mrs. Allen"), a German citizen. They now have three children. In 2013, the Army ordered Allen to return from Germany to the United States for restationing. Mrs. Allen applied for a visa so she and the children could join him. The U.S. Citizenship and Immigration Services ("USCIS") approved Allen's Petition for Alien Relative ("Form I-130"). But after hosting Mrs. Allen for an interview, an officer with the U.S. Consulate in Frankfurt denied her visa application, stating in relevant part:

This office regrets to inform you that your visa application is refused because you are ineligible to receive a visa under section 212(a)(2)(A)(i)(I) of the Immigration and Nationality Act. On July 16, 1998, you were convicted in a German court of theft pursuant to paragraphs 242 and 248a of the German criminal code. This crime constitutes behaviour reflecting moral turpitude. The maximum punishment is over one year in prison. You are eligible to seek a waiver of the grounds of ineligibility by filing an I-601 with USCIS in the United States.
....
Additionally your visa application is refused because you are ineligible to receive a visa under section 212(a)(2)(A)(i)(II) of the Immigration and Nationality Act. On March 20, 1997 you were convicted in a German court for illicit acquisition of narcotics pursuant to paragraphs 29, 25, 1 and 3 of the German criminal code. There is no waiver for this ineligibility.

The letter is signed "Consular Officer." The consular officer's decision rested on two statutory grounds of inadmissibility in the Immigration and Nationality Act ("INA"):

[A]ny alien convicted of, or who admits having committed, or who admits committing acts which constitute the essential elements of-
(I) a crime involving moral turpitude (other than a purely political offense) or an attempt or conspiracy to commit such a crime, or
(II) a violation of (or a conspiracy or attempt to violate) any law or regulation of a State, the United States, or a foreign country relating to a controlled substance (as defined in section 802 of Title 21),
is inadmissible.

8 U.S.C. § 1182(a)(2)(A)(i).

Allen brought this action in the Eastern District of California against the Consul General of the U.S. Consulate in Frankfurt, the Consular Section Chief of the same, the United States Secretary of Homeland Security, the Director of the United States Citizenship and Immigration Services, and the United States Secretary of State. Allen's one and only cause of action was under the APA: Allen argues that the consular decision was legal error, that he had a right to judicial review under the cause of action codified at 5 U.S.C. § 702, and that the district court should set aside the decision as "arbitrary, capricious, an abuse of discretion, or otherwise not in accordance with law," id. § 706(2)(A). Allen argues that the consular officer committed legal error when he identified Mrs. Allen's 1998 theft conviction as a "crime involving moral turpitude," because the German theft statute does not categorically require an intent to deprive a person of property permanently-which he alleges is an element of the generic offense under federal law in the United States. See Castillo-Cruz v. Holder , 581 F.3d 1154, 1159-61 (9th Cir. 2009). Similarly, Allen claims that the consular officer committed legal error when he identified Mrs. Allen's 1997 conviction for illegal acquisition of narcotics under the German Criminal Code as her disqualifying "violation of ... any law ... relating to a controlled substance," allegedly because those proceedings did not result in a "conviction," as the German court applied only the ameliorative, rehabilitative, diversionary provisions of German juvenile law in consideration of Mrs. Allen's youth. See Lujan-Armendariz v. INS , 222 F.3d 728, 742-43 (9th Cir. 2000).

The Government moved to dismiss for lack of subject matter jurisdiction under Federal Rule of Civil Procedure 12(b)(1), which the district court construed as a motion to dismiss for failure to state a claim under Rule 12(b)(6), and granted. The district court assumed without deciding that Allen's constitutional rights were implicated, Bustamante v. Mukasey , 531 F.3d 1059, 1061 (9th Cir. 2008), and conducted a narrow inquiry to ensure the denial was based on "facially legitimate and bona fide" reasons. Kerry v. Din , --- U.S. ----, 135 S.Ct. 2128, 2140, 192 L.Ed.2d 183 (2015) (Kennedy, J., concurring) (quoting Mandel , 408 U.S. at 770, 92 S.Ct. 2576 ). The court characterized the consular officer's statutory citations and references to the convictions triggering Mrs. Allen's exclusion as precisely such legitimate and bona fide reasons, and dismissed Allen's petition for failure to state a claim on which relief can be granted.

Allen appeals. We have appellate jurisdiction under 28 U.S.C. § 1291 and we review this question of law de novo .

II

Section 1201(g)(3) of Title 8 provides that no visa shall be issued if "the consular officer knows or has reason to believe that such alien is ineligible to receive a visa or such other documentation under section 1182 of this title, or any other provision of law." In accord with this provision, the consular officer here advised Mrs. Allen of the two grounds on which he believed she was not eligible for a visa under § 1182. First, because she had been convicted of a theft offense, the consular officer determined that she was ineligible for a visa because theft is a crime involving moral turpitude. 8 U.S.C. § 1182(a)(2)(A)(i)(I). Second, the officer determined that because Mrs. Allen had been convicted of "illicit acquisition of narcotics" under German law, she was ineligible for a visa because she had been convicted of "a violation of ... any law or regulation of ... a foreign country relating to a controlled substance." Id. § 1182(a)(2)(A)(i)(II).

Allen, on his own behalf as Mrs. Allen's husband, seeks review of the consular officer's decision under the APA. The government contends that we lack subject matter jurisdiction to review the consular officer's decision. We will turn first to the government's claim. Finding that we have subject matter jurisdiction, we then turn to Allen's claim.

A

The government argues that the doctrine of consular nonreviewability means that "federal courts lack subject matter jurisdiction to review a consular officer's issuance or refusal of a visa." In the same breath, the government tells us that the doctrine "precludes the Court from reviewing the findings of a consular officer under the guise of the APA." The government's argument has conflated our power to hear "Cases" and "Controversies," U.S. Const. art. III, § 2, cl. 1, with the scope of our review over a case in which we are properly vested with jurisdiction.

In his petition, Allen asserted subject matter jurisdiction under the federal question statute, 28 U.S.C. § 1331, under the Declaratory Judgment Act, 28 U.S.C. §§ 2201 - 02, and under the APA, 5 U.S.C. § 702. The Declaratory Judgment Act does not confer subject matter jurisdiction. Medtronic , Inc. v. Mirowski Family Ventures, LLC , 571 U.S. 191, 134 S.Ct. 843, 848, 187 L.Ed.2d 703 (2014) ; see also Aetna Life Ins. Co. v. Haworth , 300 U.S. 227, 240, 57 S.Ct. 461, 81 L.Ed. 617 (1937). Nor does the APA. The APA provides that "[a]gency action made reviewable by statute and final agency action for which there is no other adequate remedy in a court are subject to judicial review." 5 U.S.C. § 704. Any person "suffering legal wrong" or "adversely affected or aggrieved by agency action" may bring an action in federal court for "relief other than money damages," id. § 702. These provisions of the APA waive the sovereign immunity of the United States, but such a waiver is on its terms neither coextensive with subject matter jurisdiction nor a guarantee of a federal forum. See United States v. Park Place Assoc., Ltd. , 563 F.3d 907, 923-24 (9th Cir. 2009). "It is beyond question ... that the APA does not provide an independent basis for subject matter jurisdiction in the district courts." Tucson Airport Auth. v. Gen. Dynamics Corp ., 136 F.3d 641, 645 (9th Cir. 1998) ; see Califano v. Sanders , 430 U.S. 99, 107, 97 S.Ct. 980, 51 L.Ed.2d 192 (1977) ("[T]he APA does not afford an implied grant of subject-matter jurisdiction permitting federal judicial review of agency action."). Although the Declaratory Judgment Act and the APA do not provide for subject matter jurisdiction in this case, unless some other provision deprives the district court of jurisdiction, § 1331 supplies ample basis for its subject matter jurisdiction.

The government cites no provision from Title 28, the INA, or the APA that would divest the district court of subject matter jurisdiction in this case. Instead, it cites four of our cases for the proposition that the doctrine of consular nonreviewability deprives courts of subject matter jurisdiction. Rivas v. Napolitano , 714 F.3d 1108, 1111 (9th Cir. 2013) ; Li Hing of Hong Kong., Inc. v. Levin , 800 F.2d 970, 971 (9th Cir. 1986) ; Ventura-Escamilla v. INS , 647 F.2d 28, 30 (9th Cir. 1981) ; Loza-Bedoya v. INS , 410 F.2d 343, 347 (9th Cir. 1969). We admit that some statements in these cases might be read to suggest the district courts lack subject matter jurisdiction over cases in which a plaintiff requests the court order a consular officer to issue a visa, but the cases cannot bear the weight the government places on them.

In the earliest of these cases, Loza-Bedoya , we stated that a consular officer's "determination is not subject to either administrative or judicial review." Id . Loza-Bedoya had been excluded because of a conviction of assisting unlawful entry into the United States, but Loza-Bedoya claimed this was error. We stated that "a correction of the record would not in any manner affect the deportation [Loza] seeks to avoid." Id. We then stated, infelicitously, that "[t]hough erroneous this Court is without jurisdiction to order an American consular official to issue a visa to any alien whether excludable or not." Id. (emphasis added). By "jurisdiction" we could not have meant subject matter jurisdiction because, in the end, we found there was "no abuse [of discretion] and affirm[ed] the final order of deportation." Id. Had we been convinced that we lacked subject matter jurisdiction, we could not have reviewed the officer's exercise of discretion, and we would have dismissed the action rather than affirm the judgment.

In Ventura-Escamilla , we stated that "review of the Consul's decision denying [an] application for a visa" was "beyond the jurisdiction of the Immigration Judge, the BIA, and this court." 647 F.2d at 30. However, we were not discussing subject matter jurisdiction, but rather the origins and context of the doctrine of consular nonreviewability. Affirming the decision of the BIA, we concluded we were "without power to substitute [our] judgment for that a Consul ... on the issue of whether a visa should be granted or denied." Id. at 32. Our passing reference to "jurisdiction" went to our remedial power-our power to "substitute [our] judgment"-not our adjudicatory power. Id. at 33.

In Li Hing , the U.S. Consulate in Hong Kong denied a visa to a noncitizen employee who was to be transferred by his U.S. employer from Hong Kong to California. We affirmed dismissal of the suit because "[e]xercising jurisdiction over this case would ... violate the long-recognized judicial nonreviewability of a consul's decision to grant or deny a visa." 800 F.2d at 971. Our choice of language was unfortunate, because elsewhere in the opinion we stated the rule of consular nonreviewability thusly: "the consular official's decision to issue or withhold a visa is not subject either to administrative or judicial review." Id. (citing, inter alia , Mandel ). Thus, we were "without power to substitute [our] judgment for that of a Consul." Id. (citation omitted). That was not to say that the district court lacked subject matter jurisdiction over the case. Rather, by "jurisdiction" we meant that the district courts lack the power to grant the relief requested-"substitut[ing] [our] judgment for that of a Consul"-and thus evaluation of the merits of Li Hing's case was foreclosed by "judicial nonreviewability." Id. (quoting Ventura-Escamilla , 647 F.2d at 32 ).

Most recently, in Rivas , we reviewed two claims brought by Mr. Rivas and his daughter, noncitizens, arising out of the consulate's denial of their visas. 714 F.3d at 1110. The district court found that "the doctrine of consular nonreviewability deprived the court of subject matter jurisdiction to review the consular official's discretionary decisions." Id. at 1110. Citing Li Hing , we observed that "[f]ederal courts are generally without power to review the actions of consular officials." We noted two exceptions to this "without power" rule: First, where the official has failed to act at all. Id. (citing Patel v. Reno , 134 F.3d 929, 931-32 (9th Cir. 1997) ). Second, where " 'a U.S. citizen's constitutional rights are alleged to have been violated by the denial of a visa to a foreigner' without a 'facially legitimate and bona fide reason' for the denial." Id. (quoting Bustamante , 531 F.3d at 1060 ). Finding that "neither of the exceptions to the doctrine of consular nonreviewability apply," we simply "affirm[ed] the district court's denial of Riva's claims ... for lack of subject matter jurisdiction." Id. at 1110, 1111. The two brief references to subject matter jurisdiction-one a description of what the district court did, and the second our affirming what the district court did-are the beginning and the end of our analysis of subject matter jurisdiction. As with Li Hing , Ventura-Escamilla , and Loza-Bedoya , we should not read too much into such passing references. We were undoubtedly correct when we wrote that we are generally "without power" to review a consular official's decision, but we may lack the power to do many things in cases in which we are fully vested with subject matter jurisdiction. That we considered in Rivas several "exceptions" to the "doctrine of consular nonreviewability" shows that we could not have been referring to district court's power to hear the case in the first place.

That power-the federal courts' subject matter jurisdiction, including our appellate jurisdiction-is conferred by Article III of the Constitution, subject to "such Exceptions, and under such Regulations as the Congress shall make." U.S. Const. art. II, § 2, cls. 1, 2. See Bowles v. Russell , 551 U.S. 205, 212, 127 S.Ct. 2360, 168 L.Ed.2d 96 (2007) ("Within constitutional bounds, Congress decides what cases the federal courts have jurisdiction to consider."). No statute purports to strip us of jurisdiction over consular decisions; nor does any statute purport to confer subject matter jurisdiction over the two exceptions we described in Rivas . See Trump v. Hawaii , --- U.S. ----, ----, 138 S.Ct. 2392, --- L.Ed.2d ---- (2018) ("The Government does not argue that the doctrine of consular nonreviewability goes to the Court's jurisdiction, nor does it point to any provision of the INA that expressly strips the Court of jurisdiction over plaintiffs' claims.") (citations omitted). The doctrine of consular nonreviewability, which is judicial in origin, is surely informed by our respect for the separation of powers, but it is not, for that reason, a constraint on subject matter jurisdiction; our deference goes to our willingness , not our power , to hear these cases. Understandably, we have sometimes treated the doctrine of consular nonreviewability as though it were a constraint on our subject matter jurisdiction because it appears to function in the same way as such constraints. But a rule of decision is different from a constraint on subject matter jurisdiction, even if the result is roughly the same for the parties. See Steel Co. v. Citizens for Better Environment , 523 U.S. 83, 89, 118 S.Ct. 1003, 140 L.Ed.2d 210 (1998) ("[T]he absence of a valid ... cause of action does not implicate subject-matter jurisdiction, i.e. , the courts' statutory or constitutional power to adjudicate the case.") (emphasis in original).

We are not the only court to have had such looseness in our language. "Courts-including this Court-have sometimes mischaracterized claim-processing rules or elements of a cause of action as jurisdictional limitations, particularly when that characterization was not central to the case, and thus did not require close analysis." Reed Elsevier, Inc. v. Muchnick , 559 U.S. 154, 161, 130 S.Ct. 1237, 176 L.Ed.2d 18 (2010). The Court has thus admonished that "the word 'jurisdiction' has been used by courts ... to convey 'many, too many, meanings,' " and has cautioned "against profligate use of the term." Union Pac. R.R. Co. v. Bhd. of Locomotive Eng'rs & Trainmen Gen. Comm. of Adjustment, Cent. Region , 558 U.S. 67, 81, 130 S.Ct. 584, 175 L.Ed.2d 428 (2009) (quoting Steel Co. , 523 U.S. at 90, 118 S.Ct. 1003 ). The Court later explained that because " '[j]urisdiction' refers to 'a court's adjudicatory authority,' the term "properly applies only to 'prescriptions delineating the classes of cases (subject-matter jurisdiction) and the persons (personal jurisdiction)' implicating [the court's adjudicatory] authority." Reed Elsevier , 559 U.S. at 160-61, 130 S.Ct. 1237 (quoting Kontrick v. Ryan , 540 U.S. 443, 455, 124 S.Ct. 906, 157 L.Ed.2d 867 (2004) ). Over time, we have all "miss[ed]

the 'critical difference[s]' between true jurisdictional conditions and nonjurisdictional limitations on causes of action." Id. at 161, 130 S.Ct. 1237 (quoting Kontrick , 540 U.S. at 456, 124 S.Ct. 906 ).

We conclude that the district court had subject matter jurisdiction in this case under 28 U.S.C. § 1331 and the doctrine of consular nonreviewability did not strip the district court of that jurisdiction. Subject matter jurisdiction over this class of claims, otherwise amply provided here by the federal question statute, is constrained only if we identify and apply some "prescripti[ve] delineati[on]" on our "adjudicatory authority." Id. at 160-61, 130 S.Ct. 1237 (quoting Kontrick , 540 U.S. at 455, 124 S.Ct. 906 ); see Sebelius v. Auburn Reg'l Med. Ctr. , 568 U.S. 145, 153, 133 S.Ct. 817, 184 L.Ed.2d 627 (2013) (requiring a "clear statement" from Congress that "the rule is jurisdictional"). We know of no such "prescriptive delineation," and the government has not pointed to any. The rule at issue here, that is, the rule of consular nonreviewability, supplies a rule of decision, not a constraint on the subject matter jurisdiction of the federal courts. See Fiallo v. Bell , 430 U.S. 787, 795-96 n.6, 97 S.Ct. 1473, 52 L.Ed.2d 50 (1977) (denying that "the Government's power in this area [of immigration] is never subject to judicial review," but "only to limited judicial review"); Mathews v. Diaz , 426 U.S. 67, 81-82, 96 S.Ct. 1883, 48 L.Ed.2d 478 (1976) ("The reasons that preclude judicial review of political questions also dictate a narrow standard of review of decisions made by the Congress or the President in the area of immigration and naturalization."); Matushkina v. Nielsen , 877 F.3d 289, 294 n.2 (7th Cir. 2017) ("We treat the doctrine of consular nonreviewability as a matter of a case's merits rather than the federal courts' subject matter jurisdiction."). We discuss consular nonreviewability and Mandel in greater detail below, but it suffices at present to observe that the Court's "facially legitimate and bona fide" standard is not the language of subject matter jurisdiction, but the language of the discretion courts afford consular officers. It is a scope of review, the contours of which we turn to now. The district court was correct to treat the government's Rule 12(b)(1) motion as a motion under Rule 12(b)(6).

B

The core of Allen's petition is that he was entitled to judicial review of the non-issuance of his wife's visa under the "scope of review" provisions of the APA found in § 706. More particularly, Allen contends that the consular officer failed to apply the appropriate legal standards to Mrs. Allen's German convictions, and that this legal error renders the consular officer's decision "arbitrary, capricious, and otherwise not in accordance with law."

We start with some first principles. The APA provides the fundamental framework for how executive agencies are expected to conduct business. It prescribes the rules by which agencies may promulgate regulations, 5 U.S.C. § 553, and conduct adjudications, id. §§ 554-58. The APA provides for judicial review of agency decisionmaking, id. §§ 701-06. "Agency" is defined by the statute as "each authority of the Government of the United States, whether or not it is within or subject to review by another agency." Id. § 701(b). Congress may exempt an agency altogether from the APA, id. § 551(1), or from its judicial review provisions, id . § 701(b)(1). Congress may also preempt application of some or all of the APA, such as by expressly providing for an otherwise inconsistent procedure or standard for judicial review. See id . §§ 701(a)(1)-(2), 702(1)-(2); Marcello v. Bonds , 349 U.S. 302, 305-10, 75 S.Ct. 757, 99 L.Ed. 1107 (1955). It is undisputed here that the Department of State is an agency for purposes of the APA. See ASSE Int'l, Inc. v. Kerry , 803 F.3d 1059, 1068 (9th Cir. 2015).

The immigration laws provide a good example of these principles. Shortly after the APA was adopted in 1946, the Supreme Court held that the APA's provisions relating to adjudicatory hearings governed deportation hearings. Wong Yang Sung. v. McGrath , 339 U.S. 33, 48-51, 70 S.Ct. 445, 94 L.Ed. 616 (1950). Just months later, Congress exempted such hearings from the APA. Supplemental Appropriation Act, Pub. L. 81-843, 64 Stat. 1044, 1048 (1951) ("Proceedings under law relating to the exclusion or expulsion of aliens shall hereafter be without regard to the provisions of sections 5, 7, and 8 of the Administrative Procedure Act."). Following Congress's adoption of comprehensive immigration reform, see Immigration and Nationality Act of 1952, Pub. L. 82-414, 66 Stat. 163 (1952) (INA), the Court held in Marcello that the Congress had not reinstated the APA as the framework for immigration hearings. 349 U.S. at 305-10, 75 S.Ct. 757. The Court observed that in the INA "Congress was setting up a specialized administrative procedure ..., drawing liberally on the analogous provisions of the Administrative Procedure Act and adapting them to the particular needs of the deportation process." Id. at 308, 75 S.Ct. 757. But where Congress "depart[ed] from the Administrative Procedure Act ... it was the intention of the Congress to have the deviation apply and not the general model." Id. at 309, 75 S.Ct. 757. Congress confirmed this when it provided that "[t]he procedure (herein prescribed) shall be the sole and exclusive procedure for determining the deportability of an alien under this section." Id. (quoting 8 U.S.C. § 1252(b) (1952) ). The INA thus gave a "clear and categorical direction ... meant to exclude the application of the Administrative Procedure Act." Id. ; see also Ardestani v. INS , 502 U.S. 129, 112 S.Ct. 515, 116 L.Ed.2d 496 (1991) (applying Marcello , and noting that the attorneys fees provisions of the Equal Access to Justice Act, 5 U.S.C. § 504, do not apply to removal proceedings); Heikkila v. Barber , 345 U.S. 229, 235-36, 73 S.Ct. 603, 97 L.Ed. 972 (1953) (finding the APA inapplicable in light of the finality provisions of the predecessor statute to the INA).

We recognize that the APA's judicial review provisions supply a "strong presumption that Congress intends judicial review of administrative action." Bowen v. Mich. Acad. of Family Physicians , 476 U.S. 667, 670, 106 S.Ct. 2133, 90 L.Ed.2d 623 (1986). Sections 701-06 of the APA supply a "default rule ... that agency actions are reviewable under federal question jurisdiction ... even if no statute specifically authorizes judicial review." ANA Int'l, Inc. v. Way , 393 F.3d 886, 890 (9th Cir. 2004). The presumption of judicial reviewability is so strong that "only upon a showing of 'clear and convincing evidence' of a contrary legislative intent should the courts restrict access to judicial review." Abbott Labs. v. Gardner , 387 U.S. 136, 140-41, 87 S.Ct. 1507, 18 L.Ed.2d 681 (1967) (quoting Rusk v. Cort , 369 U.S. 367, 379-80, 82 S.Ct. 787, 7 L.Ed.2d 809 (1962) ); see also Dickinson v. Zurko , 527 U.S. 150, 154, 155, 119 S.Ct. 1816, 144 L.Ed.2d 143 (1999) (because of "the importance of maintaining a uniform approach to judicial review of administrative action," any "departure from the norm must be clear"). Even in the immigration context, that is, the context of adjudicating matters affecting claims brought by those wishing to acquire constitutional rights, we have never abrogated our "[j]udicial supremacy" to order relief if, in any individual case, "fundamentals were violated":

Judicial supremacy has been maintained upon the ground that our government is founded upon law. It is incumbent upon the executive, whether elective or by divine right as a Stuart king, to act according to rules of law. There is no doctrine of omnipotence of Parliament here as there is in England. Therefore, even final action of an administrative agency, although declared unappealable by legislation, has always been subject to attack in court if fundamentals were violated.

Bustos-Ovalle v. Landon , 225 F.2d 878, 880 (9th Cir. 1955).

Nevertheless, the APA itself anticipates that, on occasion, Congress might itself abrogate the presumption of judicial review. First, the APA recognizes that a statute may preclude judicial review. 5 U.S.C. § 701(a)(1). Second, the APA provides that its judicial review provisions do not apply where "agency action is committed to agency discretion by law," id. § 701(a)(2), a "rare instance[ ] where statutes are drawn in such broad terms that in a given case there is no law to apply." Webster v. Doe , 486 U.S. 592, 599, 108 S.Ct. 2047, 100 L.Ed.2d 632 (1988) (quoting Citizens to Preserve Overton Park, Inc. v. Volpe , 401 U.S. 402, 410, 91 S.Ct. 814, 28 L.Ed.2d 136 (1971) ); see also , e.g. , Ekimian v. INS , 303 F.3d 1153, 1157-58 (9th Cir. 2002) (finding no judicially reviewable standard to examine BIA decision's not to reopen a case). The government does not contend that either of these exceptions to judicial review applies.

The APA recognizes two other instances in which at least some provisions of §§ 701-06 might not apply. Section 702 confers the broad right to judicial review and sets out the cause of action, but then concludes in limiting fashion:

Nothing herein (1) affects other limitations on judicial review or the power or duty of the court to dismiss any action or deny relief on any other appropriate legal or equitable ground; or (2) confers authority to grant relief if any other statute that grants consent to suit expressly or impliedly forbids the relief which is sought.

This narrows our focus: Is the doctrine of consular nonreviewability either (1) a "limitation[ ] on judicial review" or (2) based on statutes that "impliedly forbid[ ] the relief which is sought"? In other words, is Allen entitled to APA review of the consular official's decision not to issue his wife a visa, or is the standard set forth in Mandel his only avenue for judicial relief? The D.C. Circuit has addressed this precise question, and it concluded that Mandel supplies the only standard by which the federal courts can review a consular officer's decision on the merits. Saavedra Bruno v. Albright , 197 F.3d 1153, 1162-63 (D.C. Cir. 1999). We start with Mandel and the rule of consular nonreviewability, and we then turn to Saavedra Bruno .

We have long recognized that "ordinarily, a consular official's decision to deny a visa to a foreigner is not subject to judicial review." Bustamante , 531 F.3d at 1060 ; see also Li Hing , 800 F.2d at 970-71 ; Ventura-Escamilla , 647 F.2d at 30-31. The rule is based on "the recognition that the power to exclude or expel aliens, as a matter affecting international relations and national security, is vested in the Executive and Legislative branches of government." Ventura-Escamilla , 647 F.2d at 30 ; see also Shaughnessy v. United States ex rel. Mezei , 345 U.S. 206, 210, 73 S.Ct. 625, 97 L.Ed. 956 (1953) ; United States ex rel. Knauff v. Shaughnessy , 338 U.S. 537, 542-43, 70 S.Ct. 309, 94 L.Ed. 317 (1950) ; Kaoru Yamataya v. Fisher , 189 U.S. 86, 97-98, 23 S.Ct. 611, 47 L.Ed. 721 (1903). Unless we are otherwise "authorized by treaty or by statute," or where we are "required by the paramount law of the constitution[ ] to intervene," Hampton v. Mow Sun Wong , 426 U.S. 88, 101 n.21, 96 S.Ct. 1895, 48 L.Ed.2d 495 (1976) (quoting Fong Yue Ting v. United States , 149 U.S. 698, 712, 13 S.Ct. 1016, 37 L.Ed. 905 (1893) ), Congress may "prescribe the terms and conditions upon which [noncitizens] may come to this country, and to have its declared policy in that regard enforced exclusively through executive officers, without judicial intervention." Lem Moon Sing v. United States , 158 U.S. 538, 547, 15 S.Ct. 967, 39 L.Ed. 1082 (1895) ; see also Fok Yung Yo v. United States , 185 U.S. 296, 305, 22 S.Ct. 686, 46 L.Ed. 917 (1902) ("Congressional action has placed the final determination of the right of admission in executive officers, without judicial intervention, and this has been for many years the recognized and declared policy of the country."). If our review is not required by some other provision of law, such as the Constitution, the APA, or the INA, the long-standing rule foreclosing review of the merits of consular visa decisions is precisely the kind of "limitation[ ] on judicial review" or "implied" prohibition on relief that forms an exception to the APA's cause of action and review provisions. 5 U.S.C. § 702(1), (2).

In Mandel , the Court reaffirmed that where Congress entrusts discretionary visa-processing and ineligibility-waiver authority in a consular officer or the Attorney General, the courts cannot substitute their judgments for those of the Executive. 408 U.S. at 769-70, 92 S.Ct. 2576. But the Court also recognized a narrow exception for review of constitutional claims. Belgian Marxist Ernest Mandel was denied a visa to visit the United States for academic activities. Id. at 756-57, 92 S.Ct. 2576. He and six American professors brought suit challenging the Attorney General's failure to waive Mandel's ineligibility, claiming injury to the professor plaintiffs' First Amendment rights. Id. at 760, 92 S.Ct. 2576. A divided three-judge district court held that the professor-plaintiffs had a First Amendment right to hear Mandel's views, and that plaintiffs' were entitled to an order enjoining the Attorney General from denying Mandel admission to the United States. Mandel v. Mitchell , 325 F.Supp. 620, 632-33 (E.D.N.Y. 1971). Reversing, the Supreme Court began with the proposition that Mandel had no right of entry and thus no personal right to judicial review. 408 U.S. at 762, 92 S.Ct. 2576. The Court assumed the professor plaintiffs had First Amendment rights to hear Mandel speak, and sought a means to balance their rights against Congress's grant of discretionary waiver authority to the Attorney General. It did so against the presumption of consular nonreviewability that had embedded itself as a rule of decision, the provenance of which the Court was "not inclined in the present context to reconsider." Id. at 767, 92 S.Ct. 2576. Rejecting Mandel's request for an "arbitrary and capricious" standard of review, id. at 760, 92 S.Ct. 2576, the Court recognized an exception to the rule of consular nonreviewability for review of constitutional claims. The exception itself is quite narrow, requiring deference to the consular officer's decision so long as "that reason was facially legitimate and bona fide." Id. at 769, 92 S.Ct. 2576. The Court concluded:

We hold that when the Executive exercises this power [of exclusion] negatively on the basis of a facially legitimate and bona fide reason, the courts will neither look behind the exercise of that discretion, not test it by balancing its justification against the First Amendment interests of those who seek personal communication with the applicant.

Id. at 770, 92 S.Ct. 2576.

The Court returned to Mandel in Fiallo v. Bell , 430 U.S. 787, 97 S.Ct. 1473, 52 L.Ed.2d 50 (1977). There, three sets of fathers and sons challenged immigration laws giving preference to natural mothers of "illegitimate" children, thereby alleging constitutional injury through " 'double-barreled' discrimination based on sex and illegitimacy." Id. at 788, 794, 97 S.Ct. 1473.

The government argued that these claims were not subject to judicial review at all, a claim the Court rejected. But the Court also rejected any review beyond that set out in Mandel : "We can see no reason to review the broad congressional policy choice at issue here under a more exacting standard than was applied in Kleindienst v. Mandel ." Id. at 795, 97 S.Ct. 1473.

The Mandel rule was again upheld in Din . 135 S.Ct. at 2141. Din, a U.S. citizen, challenged a consular officer's decision to deny an entry visa to her husband, and sought a writ of mandamus and a declaratory judgment to remedy her alleged constitutional injury arising out of the visa denial. Id. at 2131-32 (plurality opinion of Scalia, J.). Justice Scalia, joined by Chief Justice Roberts and Justice Thomas, found in a plurality opinion that Din had no such constitutional right and so received the process due. Id. at 2138-40. But Justice Kennedy, joined by Justice Alito, concurred in the judgment alone, in the narrowest and thus controlling opinion in that case. See Cardenas v. United States , 826 F.3d 1164, 1171 (9th Cir. 2016). Justice Kennedy found it unnecessary to answer whether Din had a protected constitutional interest, because even assuming she did "[t]he reasoning and the holding in Mandel control here." Din , 135 S.Ct. at 2139, 2140 (Kennedy, J., concurring in the judgment). Moreover, Mandel "extends to determinations of how much information the Government is obliged to disclose about a consular officer's denial of a visa to an alien abroad." Id. at 2141. In Din , the consular officer offered no explanation other than a citation to 8 U.S.C. § 1182(a)(3)(B), prohibiting visas to persons engaged in or otherwise related to statutorily defined "terrorist activity." See 8 U.S.C. § 1182(a)(3)(B)(iii). For Justice Kennedy, "the Government satisfied any obligation it might have had to provide Din with a facially legitimate and bona fide reason for its action." Din , 135 S.Ct. at 2141 (Kennedy, J., concurring in the judgment).

Mandel , Fiallo , and Din all involved constitutional claims. We have applied the Mandel rule in a variety of circumstances involving visa denials and claimed violations of constitutional rights. E.g. , Cardenas , 826 F.3d at 1171 ; Bustamante , 531 F.3d at 1061 (describing Mandel as "a limited exception to the doctrine [of consular nonreviewability] where the denial of a visa implicates the constitutional rights of American citizens"). Most recently, in Trump v. Hawaii , the Court observed that its "opinions have reaffirmed and applied [ Mandel 's] deferential standard of review across different contexts and constitutional claims." --- U.S. ----, ----, 138 S.Ct. 2392, --- L.Ed.2d ---- (2018). Allen concedes Mandel 's limited scope of review as to constitutional challenges to visa denials. He argues nonetheless that he is entitled to APA review of his claims, which he characterizes as a nonconstitutional statutory challenge to the consular officer's allegedly nondiscretionary duty.

The D.C. Circuit rejected this argument in Saavedra Bruno . When a consular officer in Bolivia refused to issue a visa to Saavedra Bruno, he brought suit under the APA, arguing that he was entitled to review for the purpose of challenging factual errors on which the official ostensibly made his decision. 197 F.3d at 1155-56. After a careful review of the historical origins of the consular nonreviewability rule, the court wrote:

[W]e may infer that the immigration laws preclude judicial review of consular visa decisions. There was no reason for Congress to say as much expressly. Given the historical background against which it has legislated over the years, ... Congress could safely assume that aliens residing abroad were barred from challenging consular visa decisions in federal court unless legislation specifically permitted such actions. The presumption, in other words, is the opposite of what the APA normally supposes.

Id. at 1162. From this the court deduced that "[i]n terms of APA § 702(1), the doctrine of consular nonreviewability-the origin of which predates passage of the APA," constitutes precisely such a "limitation[ ] on judicial review" unaffected by § 702's otherwise glad-handing statutory cause of action and right of review to those suffering " 'legal wrong' from agency action." Id. at 1160 (quoting 5 U.S.C. § 702 ). In sum, "the immigration laws preclude judicial review of consular visa decisions." Id. at 1162 ; see also Morfin v. Tillerson , 851 F.3d 710, 714 (7th Cir. 2017) (rejecting a claim brought under the APA that a consular decision was arbitrary and capricious and not supported by substantial evidence, and concluding that "the denial of a visa application is not a question open to review by the judiciary").

We agree with the D.C. Circuit's analysis and conclusion in Saavedra Bruno . If Allen were correct, then constitutional claims would be reviewable under the limited Mandel standard, and nonconstitutional claims would be reviewable under the APA; in other words, all claims would be reviewable under some standard. Allen's theory converts consular nonreviewability into consular reviewability. The conclusion flies in the face of more than a century of decisions limiting our review of consular visa decisions. Allen attempts to narrow our focus to legal error, which he argues is within the province of the judiciary. We reject his argument for several reasons. First, the burden the INA places on consular officers-who may or may not have any formal legal training-is not to make legal determinations in a way that an administrative agency (such as the BIA) or a court might do. Rather the officer is charged with adjudicating visas under rules prescribed by law, and the officer is instructed not to issue a visa if the officer "knows or has reason to believe that such alien is ineligible to receive a visa" under any provision of law. 8 U.S.C. § 1201(g)(3).

Second, the distinction Allen presses for would eclipse the Mandel exception itself. The claims in Mandel , Fiallo , and Din were all legal claims. To be sure, they were legal claims based on the law of the Constitution, as opposed to statutory law, but we fail to see why legal claims based on statute should receive greater protection than legal claims based on the Constitution. Indeed, we think the Court has already rejected such an argument in Webster , 486 U.S. at 594, 108 S.Ct. 2047. There the Court addressed whether a statute giving the Director of the CIA blanket authority to terminate any officer or employee when deemed "necessary or advisable in the interests of the United States," rendered the Director's decisions unreviewable under § 701(a)(2). Id. at 594, 601, 108 S.Ct. 2047 (quoting 50 U.S.C. § 403(c) ). Although the Court found that Doe's claims could not be reviewed under the APA, it did find that Doe could nonetheless otherwise raise constitutional claims arising out of his termination, namely that his termination deprived him of liberty and property interests, denied him equal protection under the law, and impaired his right to privacy. Webster , 486 U.S. at 601-05, 108 S.Ct. 2047. After Webster , we have assumed that the courts will be open to review of constitutional claims, even if they are closed to other claims. See , e.g. , Am. Fed'n of Gov't Employees Local 1 v. Stone , 502 F.3d 1027, 1034-39 (9th Cir. 2007). Allen's argument would flip Webster on its head: Statutory arguments would be subject to full APA review even if constitutional arguments, per Mandel , are not. We find no support for Allen's position.

Allen also argues that we have previously applied APA review to consular decisions. The cases cited by Allen do not help him. We subjected a State Department decision to APA review in ASSE Int'l Inc. , 803 F.3d at 1064-68. But it was not a consular visa decision that we reviewed, but rather a State Department decision to disqualify a U.S.-based third-party sponsor participating in the Exchange Visitor Program. Id. Similarly, Singh v. Clinton , 618 F.3d 1085 (9th Cir. 2010), also did not concern a challenge to a consular officer's adjudication of the noncitizen's visa application, but rather was a suit against the State Department for failure to follow the INA and its own regulations. Singh does not guide us here. Patel v. Reno , 134 F.3d 929 (9th Cir. 1997), likewise does not aid Allen's argument. Patel did involve the non-issuance of a visa. But what we faced was the State Department's failure to issue any decision on a visa application at all, a clear violation of a nondiscretionary duty, as "[a] consular office is required by law to act on visa applications," because "[i]ssuance or refusal [is] mandatory." Id. at 932 (quoting 22 C.F.R. § 42.81 ). In other words, a visa application must be adjudicated one way or the other. We acknowledged the consular nonreviewability principle, but distinguished the case as one that "challenges the authority of the consul to take or fail to take an action as opposed to a decision taken within the consul's discretion." Id. at 931-32. We remanded with instructions "to order the consulate to either grant or deny the visa applications." Id. at 933.

We join the D.C. Circuit in holding that the APA provides no avenue for review of a consular officer's adjudication of a visa on the merits. Whether considered under § 702(1) or (2), the doctrine of consular nonreviewability is a limitation on the scope of our judicial review and thus precludes our review under § 706. Allen raises no claim to review under Mandel , and regardless, we agree with the district court that the consular officer's citations to the INA and identification of Mrs. Allen's criminal history constituted facially legitimate and bona fide reasons for rejecting her visa application.

III

We are sympathetic to Major Allen's efforts to unite his family in the United States during his next military assignment. Section 706 of the APA, however, provides no avenue for our review of the consular officer's decision.

The judgment of the district court is AFFIRMED . 
      
      As an excluded noncitizen, Mrs. Allen has no personal right to entry, nor a right to judicial review absent a personal detention by the United States. In that case she could challenge her detention by writ of habeas corpus. See 28 U.S.C. § 2241 ; INS v. St. Cyr , 533 U.S. 289, 301-04, 121 S.Ct. 2271, 150 L.Ed.2d 347 (2001).
     
      
      In addressing a series of challenges to an executive order affecting the issuing of entry visas to foreign nationals from eight countries, the Court stated that "[a] conventional application of Mandel , asking only whether the policy is facially legitimate and bona fide, would put an end to our review." --- U.S. at ----, 138 S.Ct. 2392. The Court, however, did not end its analysis with Mandel , but "assume[d]" "[f]or our purposes today" that it could look behind the executive order and apply rational basis review. Id.
      In this case, we do not have broad constitutional challenges to an executive policy. Indeed, Allen does not raise a constitutional challenge at all, only a statutory challenge. We will confine our focus to the only relief Allen seeks-review under the APA.
     
      
      During oral argument, Allen's counsel acknowledged that the phrase "knows or has reason to believe," when used elsewhere in the INA, see , e.g. , 8 U.S.C. § 1182(a)(2)(C), does confer discretion to deny visa applications. We do not see how Allen can reconcile that position with his insistence that a consular officer makes a purely legal decision when, acting under 8 U.S.C. § 1201(g)(3), the officer denies a visa on the basis of the officer's "reason to believe" that the applicant has been convicted of an offense rendering the applicant inadmissible.
     
      
      We are not persuaded by Allen's references to Wong v. Department of State , 789 F.2d 1380 (9th Cir. 1986), or Braude v. Wirtz , 350 F.2d 702 (9th Cir. 1965). In Wong , the State Department revoked the nonimmigrant visas of Mr. Wong's wife and children after the family had arrived in the United States from Hong Kong. Id. at 1381-82. We held that the consular officer's grounds for such revocation-that Mrs. Wong and the children had failed to attend the visa interview in Pago Pago-fell outside the limited "authorized grounds for visa revocation." Id. at 1386. As such, like Patel , Wong found that "[t]he consular officer had no authority" to conduct the act complained of. Id . In Braude , California growers sought review under what is now § 706 of visa denials to Mexican laborers. We never reached the § 706 question because we held the growers lacked standing. 350 F.2d at 708.
     