The two men rang the bell at the Resource Center Matamoros, a migrant aid group in the Mexican border city, and, speaking in broken Spanish, said they were looking for volunteer work.

Security footage shared with The New York Times shows the pair standing on the sidewalk in shorts and flip flops as they talked via speakerphone with Gaby Zavala, the center’s founder. After about half an hour, they left.

Ms. Zavala didn’t know it yet, but the men were not volunteers. They were provocateurs building an online following with hidden camera exposés and ambushes that claim to uncover abuse and election fraud in the American immigration system.

Ms. Zavala realized something was off a few hours later, when the Heritage Foundation, a conservative think tank, uploaded images of a flier with her group’s logo to social media, thrusting her organization into the center of a political firestorm.

The flier, written in Spanish and purportedly found hanging in portable toilets in the migrant camp across the street from the center, carried an explosive message to would-be immigrants: “reminder to vote for president Biden when you are in the united states. We need four more years of his administration in order to remain open.”

For many on the right, it was a smoking gun, confirming debunked theories about the left’s schemes to urge immigrants to vote illegally for Democrats. The post, uploaded on April 15, quickly racked up more than nine million views on X and was shared by multiple elected officials, including Tim Scott, the Republican senator from South Carolina and former presidential candidate.

The next morning, Representative Marjorie Taylor Greene, a Republican from Georgia, held up an oversized printout of the flier in a House Committee on Homeland Security hearing. “I would call it treason,” Ms. Greene said to Homeland Security Secretary Alejandro Mayorkas, who was sitting before the committee.

Ms. Zavala calls the document a crude fake, and part of a plot to propel false, anti-immigration narratives in an election year. The phone number listed on the flier is out of date, she noted. Some of the language is lifted directly from her group’s English language website, but appears to be translated by software.

But perhaps the strongest evidence, she said, was the presence of Anthony and Joshua Rubin, brothers from Long Island known online as the Muckrakers, at the building earlier that same day, trying to gain access under false pretenses.

“I would never encourage immigrants to vote, because they can’t,” said Ms. Zavala, 41, who started the organization in 2019 and manages it from Texas. No one contacted her to verify the document before it was posted, she said, and she has since received some 50 death threats and racist emails. “I feel violated.”

In an interview with The Times, Anthony Rubin acknowledged that he and his brother falsely identified themselves as volunteers that day. But he said they did not plant the flier. Mike Howell, executive director of the Oversight Project, an arm of the Heritage Foundation that first posted the document on X, said he stood behind their claims.

“Nothing that we put online has been proven in the least bit inaccurate,” he said.

The Oversight Project is something of a departure for the once-wonkish think tank. The project’s website describes its mission as “innovative investigations utilizing cutting-edge resources and contacts” in order to drive “accountability of the destructive work of the radical, progressive Left.” Mr. Howell, who calls himself a “deportation scientist” on X, said his group had worked closely with the Rubin brothers before.

The Rubin brothers have made a name for themselves by taking a page from the gotcha undercover methods of conservative investigative groups like Project Veritas. Their website promotes edited videos and articles focused on immigration, child trafficking and other hot-button topics on the right.

In their videos, they ask migrants — many who do not speak English and profess little knowledge of American politics — whether they prefer Mr. Biden or former President Donald J. Trump. The Rubin brothers accuse the U.S. government of abducting children at the border, repeatedly call immigrants “invaders,” and use the phrase “military-age men” to describe migrants.

Their work has been amplified by a number of prominent anti-immigration voices online, including Michael Yon, a former Green Beret who leads tours for right-wing influencers, including Anthony Rubin, to the Darién Gap, a crowded migrant crossing in Panama.

Mr. Rubin’s travels have raised his profile in conservative media, landing him appearances on web shows hosted by Ben Shapiro and Alex Jones, as well as on “Primetime,” Jesse Watters’s show on Fox News.

“You’re a very brave man and you’re getting some stuff no one’s getting, so bravo, keep it coming,” Mr. Watters told Mr. Rubin during an appearance on the network late last month.

Mr. Howell, a former lawyer for the Department of Homeland Security under President Trump, declined to say whether the Oversight Project was funding the Rubin brothers’ work, citing concerns about “very powerful people that wish to do harm to this country.”

Last month, the project released a hidden-camera video the Muckrakers made in the offices of a nonprofit in New York that offers food, education and legal aid to immigrants.

In the video, Anthony Rubin, speaking in a foreign accent, unsuccessfully tries to persuade employees of the nonprofit, La Jornada NY, to sell him “residency papers.” The next day, a Spanish speaker makes a similar request and is given a signed letter affirming his New York residency.

“Anyone, from someone seeking unauthorized employment to spies, saboteurs or even terrorists, could obtain a government-issued ID by visiting La Jornada and acquiring fraudulent papers,” Anthony Rubin said in the video, which was viewed over a million times on X and amplified by Elon Musk.

Soon after it was posted, the Heritage Foundation sent a letter to Attorney General Letitia James of New York requesting an investigation.

La Jornada’s executive director, Pedro Rodriguez, called Mr. Rubin’s characterization misleading. He noted that the residency letter was only one of four requirements for procuring a New York City ID card, which itself does not entitle immigrants to work or give them legal status of any kind.

“All it gives you is an address where you can receive mail,” he said of the letter.“They accused us of doing all those things, which are lies.”

Mr. Rodriguez said he had not heard from the attorney general’s office. But he said a barrage of hateful phone calls and emails since the Project Oversight post went viral convinced him to stop giving out the letters. “We don’t want to invite more problems,” he said.

Mr. Howell defended the investigation. “We’re going to sound the alarm,” he said. “We’re not going to wait till the day after the election when illegals vote in it.”

Accusations about immigrants voting illegally have exploded since the 2020 election, set off by Mr. Trump’s false claims of fraud and spread by a series of debunked films.

Nonprofit groups that aid migrants also have become a target for right-wing activists, who often claim the organizations profit from their work. The assertion may explain why Resource Center Matamoros, a tiny entity with just three staff members including Ms. Zavala, ended up entangled with the Heritage Foundation, a Washington power center with a nearly $100 million budget.

According to Ms. Zavala, when the Rubin brothers knocked on the center’s door, they said they were employees of HIAS, a U.S.-based group formerly known as the Hebrew Immigrant Aid Society.

The charity is frequently singled out by immigration opponents, who note that Mr. Mayorkas briefly served on its board. In October, the Rubin brothers published an article entitled “Hebrew Immigration Aid Society Exposed,” focusing on its activities in Panama.

HIAS had previously rented space from the Resource Center Matamoros. It gave up its lease in early 2021, but the center’s website was never updated. It still says that its office is “the home for HIAS” — language that appears on the flier.

Anthony Rubin told The Times he could not recall identifying himself as a HIAS employee. A spokeswoman for HIAS said that the Rubin brothers had never worked for the group.

After the flier was posted online, immigration experts and others familiar with migrant camps quickly expressed skepticism about its authenticity. The Associated Press, which first reported on the flier, noted the poor translation and grammatical errors. Bill Melugin, a Fox News reporter who covers immigration, wrote on X that the document seemed “fake or doctored.”

The Oversight Project and the Rubin brothers have stood by their account of the episode, even as details have shifted.

In their initial posts, they said the fliers were “discovered” throughout the migrant camp across the street from the Resource Center Matamoros, and the Rubin brothers said they were “tipped off” to travel to Matamoros by a source in New York.

But last Thursday, Mr. Howell’s group posted on X portions of a “sworn statement” by an unnamed person who appears to live in the Matamoros area and describes taking a flier from inside the center’s office, sending a photo of it to the Muckrakers and then shooting video of the fliers hung in portable toilets in the camp.

Mr. Howell declined to share the full statement or identify who signed it, citing concerns about “Mexican cartels, affiliated gangs inside the U.S., weaponized agencies of the Biden Administration, and lawfare.”

The Oversight Project also posted a nine-second clip of audio of the conversation between Anthony Rubin and Ms. Zavala. “In all honesty,” Mr. Rubin can be heard saying, “we’re just trying to help as many people as possible before Trump gets re-elected.”

Ms. Zavala replies, with a laugh, “Believe me, we’re in the same boat.”

In its post online, the Oversight Project said the quote indicated Ms. Zavala wanted to “help as many illegals as possible.” She said she had been speaking about volunteer opportunities in the area helping migrant children who had suffered trauma.

Several other charities working in and around Matamoros declined requests for interviews about whether they had ever seen the flier, or others like it, in the camp. Jennifer Harbury, an immigration lawyer and a member of Angry Tias & Abuelas, a group that provides essential items and legal aid to migrant families on the Mexican side of the border, said she understood their fears.

“As if we don’t already have enough trouble just trying to keep people safe down here,” said Ms. Harbury, who said she had interviewed hundreds of migrants seeking asylum over the years, many of them victims of violence and rape.

She said she instantly recognized the flier as phony, but worried what impact it would have on voters.

“There’s exaggeration and puffery and then there’s outright fabrication,” Ms. Harbury said. “And that’s not fair to Americans or immigrants.”