WASHINGTON — A pair of documentary film organizations sued the Trump administration on Thursday over its requirement that foreigners disclose their social media accounts — including pseudonymous ones — when they apply for visas.

The lawsuit, which raises novel issues about privacy and surveillance in the social-media era, challenged a rule the State Department put into effect this year. The requirement grew out of President Trump’s campaign promise of “extreme vetting” and his early executive orders that barred travel into the United States from several Muslim-majority nations.

In particular, the lawsuit argues, forcing people from authoritarian countries to disclose the pseudonyms they use to discuss politically sensitive matters could endanger them by creating a risk that the information gets back to their own governments. As a result, it said, they will be less likely either to express themselves on social media or to apply for visas.

“Many people use pseudonyms on social media so that they can speak anonymously about sensitive or controversial issues, and so that they can shield themselves or their families or associates from possible reprisals by state or private actors,” the plaintiffs wrote. “The registration requirement effectively conditions their eligibility for U.S. visas on their readiness to surrender their online anonymity.”