EDITOR’S NOTE (Dec. 14, 2017, 4 p.m.):

After this article from the Thomson Reuters Foundation was published on Dec. 12, NBC News was notified by City & State New York, a news website covering New York government, that the article contained multiple passages similar to those in a City & State article by Frank G. Runyeon that was published on Oct. 29.

After a review, NBC News felt that the article contained too many similarities to be a coincidence, and notified the foundation that the article did not meet NBC News standards for original material. The Thomson Reuters Foundation conducted its own review and issued a statement saying it has withdrawn the article.

“While we stand by the majority of the reporting, we acknowledge that attribution of those phrases fell short of our editorial standards,” the foundation’s statement said, adding that a formal investigation is underway.

As a result of this incident, NBC News is severing its editorial relationship with the Thomson Reuters Foundation.

-----

This article and accompanying video was produced in cooperation with the Thomson Reuters Foundation, the charitable arm of Thomson Reuters, which covers humanitarian news, women's rights, trafficking, property rights, climate change and resilience.

As President Donald Trump fights to deliver on his pledge to rapidly deport 2 to 3 million people living in the country without visas, there’s a pile of almost a million documents with details of many of New York City’s undocumented people — information they themselves willingly handed over that today risk leading federal immigration forces right to their front doors.

More than a million of the country's estimated 11.1 million undocumented immigrants live in the city and its suburbs, many having worked there for decades and built families.

The documents were the underpinning of an ambitious city identity card system — IDNYC — set up by the mayor in 2015 with the express aim of helping those who have fallen under the radar.

Now that data might come back to bite.

Document stash

The program had launched with the aim of helping those it might now ensnare.

People like Bianey Garcia, a 27-year-old transgender woman originally from Mexico who struggled to get a formal ID, and who could use New York City Mayor Bill de Blasio’s parallel identity card system to get a foothold in the city.

For the first time, immigrants without visas could use IDNYC to open bank accounts, sign leases and access city services.

New York City duly photocopied and scanned some 900,000 documents in the enrollment process, according to City Hall.

On a server in an undisclosed location in New York, the city's administration collected digital copies of 387,000 foreign passports, 346,000 driving licences and thousands of birth certificates, visas, military photo ID cards, consular documents and work permits.

New York's ID card program is part of a global wave of documenting the world's undocumented, as millions of people like Garcia entered the sort of digital databases that could now expose them in ways they had never anticipated.

One in eight city residents own an IDNYC — from de Blasio to the army of homeless veterans on its streets. Immigrants make up more than half of the now 1.2 million cardholders, according to an official survey in 2016.

Official figures show immigration arrests have already risen more than 40 percent nationwide under Trump — with raids hitting homes, schools, hospitals and court houses.

Federal data show 2,600 people have been arrested in New York City in the last year (seven each day) amid crackdowns that focus on "sanctuary cities," immigrant-friendly, liberal hubs such as New York that rely on incomers to prosper and grow.

Of those arrested, a quarter had no criminal record, marking a break from previous policy and spreading fear in a city where 37 percent are foreign born.

Advocates of civil liberties say the cache of documents amounts to a "deportation directory," vulnerable to hacks and open to seizure by agents of the Trump government.

Safe with us

De Blasio has repeatedly vowed to protect the city’s estimated 500,000 undocumented immigrants and said the city will not turn over the information if requested.

"We did not know Donald Trump would be elected president," de Blasio told the Thomson Reuters Foundation at City Hall in recent weeks

"We worked under the world we knew then, which there was no such prospect of any such problem, based on what we knew. We worked very closely with the New York Police Department to figure out a secure card, and figure out what would be the right, secure steps to take."

De Blasio’s team had from the get-go built in an option to delete all records by the end of 2016, but a duo of Trump-allied Republicans were one step ahead and, just after Trump won office, filed a lawsuit to stop the records from being erased.

Now cardholders fear their data could undo them.

"After the Trump election, there's not many people who want to have the card," said Garcia, a community organizer for Make the Road, which helped design the IDNYC program. "The only thing we can do is destroy that information and protect our community."

Mayor Bill de Blasio launches IDNYC at Queens Library on January 11, 2015. William Alatriste / New York City Council

No card, no life

An identity card is key to daily life in the United States, if not a legal requirement. Without one, many illegal immigrants do not use city services or access benefits for fear of stirring attention, according to the New York Civil Liberties Union (NYCLU).

They also experience more crime, but many do not report it out of fear of being questioned by police about their legal status, said Betsey Plum, of the New York Immigration Coalition charity.

Garcia wanted an IDNYC card to better belong in a city that she has made her home.

“I decided to emigrate to the United States when I was 15 because, back in my country, I was a gay boy and I was dreaming of being a trans person," said Garcia, whose Mexican passport listed her gender as male.

Garcia was trafficked into the country by an American who forced her to have sex with men for money, she said. When she refused, he threatened to report her for deportation.

After seven months, she escaped slavery, to live in Queens, an epicenter for New York’s Hispanic community.

Yet, Garcia lacked both a legal visa that would allow her to work and a recognized ID card that would let her legally lease an apartment, open a bank account or access public hospitals.

She also knew that minor infractions — drinking in public or riding a bike on the sidewalk — that would likely earn only a small fine for someone who could proffer a recognized ID card could lead to her arrest. So day by day, she avoided police.

But her worst fears were confirmed when, at 19, she was attacked by a man calling her "a f---ing f----t, a f---ing whore, a f---ing undocumented (immigrant)."

When she flagged down a police car for help, a second onslaught began as Garcia spoke little English and had no ID. Suspicions were raised and questions were asked.

"I didn’t have the opportunity to defend myself,” she said.

She spent 18 months in New York's Rikers Island prison, in an all-male facility, where she was threatened with deportation and twice attempted suicide.

Out of the shadows

Before IDNYC was invented, undocumented immigrants had a range of other cards available but they lacked a common, widely accepted identity document that did not single them out as foreign.

When IDNYC launched in 2015, more than three times the predicted number signed up, according to the mayor's office.

Cardholders could use 12 banks and credit unions, access hospitals and libraries, and avoid a host of daily document struggles, such as when meeting teachers at their children's school.

Its popularity among native New Yorkers — keen on advertised perks such as free zoo and museum entry — also ensured that the card was widely held and carried no stamp of shame, according to the Mayor's Office of Immigrant Affairs (MOIA).

"One of the ways we've looked at this card is: How do you make the life of every New Yorker much easier? How can you create one key to all the different ways you need to access the city?" said acting MOIA Commissioner Bitta Mostofi.

Garcia, who runs a support group for transgender women, said that for many, it is also the first ID that lets them decide their gender.

"The first day that it came and I used it, I felt more safe," she said. "As ‘Bianey Garcia, New Yorker’ it means that I am here. I am a part of this big city. I'm a trans woman. I'm so proud of it."

'Nightmare scenario'

More than a dozen U.S. cities — including Philadelphia, Chicago, Dallas and Boston — are considering their own municipal identity cards, and are looking for guidance from New York.

Some continue to propose databases to rival the one New York is desperate to delete, and privacy campaigners say it is time to learn lessons.

De Blasio has been frustrated in his desire to erase the records by the Republican lawsuit filed a year ago.

New York City mayoral candidate Nicole Malliotakis exits a polling station in the Staten Island borough of New York, Nov. 7, 2017. Stephanie Keith / Reuters file

The state lawmakers who filed it, Nicole Malliotakis and Ron Castorina Jr., both Assembly members, argue that destroying the data would break the city's public records laws and hinder law enforcement.

Both said in interviews their aim was not to hand records over in bulk to immigration officials, but that data should be accessible in the event of terrorism, crime or fraud.

This includes making the records available to the U.S. Immigration and Customs Enforcement agency, or ICE, which polices immigration, Malliotakis said.

"We can never forget what occurred on Sept. 11," said Malliotakis, who lost to de Blasio in November's mayoral election. "We need to be proactive and not reactive."

De Blasio, a liberal who has positioned himself as one of the most vocal critics of Trump, has made the IDNYC a signature pro-immigrant policy.

He told the Thomson Reuters Foundation that, if the city wins the case, he would delete the records as soon as possible. As of this year, IDNYC has stopped storing the records of new applicants.

"People learn from experiences," he said. "We learned that we did not need to keep them as backup."

But New York-based migrant charities said de Blasio's team should have listened earlier, that it acted arrogantly in rolling out an ambitious plan when few understood the risks.

Immigrant rights groups, city politicians and the NYCLU had all cautioned in 2014 that retaining data risked fuelling an immigration crackdown, should a nativist administration come to power.

"We are seeing the nightmare scenario ... that someone would file a lawsuit or create some kind of barrier to the city deleting these records," Johanna Miller, advocacy director at the NYCLU, told the Thomson Reuters Foundation.

Miller said the only way to keep records safe was not collect them in the first place. Some documents are riskier than others. Long expired passports ring instant alarm bells as they may single out immigrants likely to have overstayed their visas.

NYCLU, the World Privacy Forum, immigrant charity Families for Freedom, and New York City Councilman Alan Maisel - all say they had raised fears that an anti-immigration regime could be elected and thereby make those records vulnerable.

President Donald Trump waves on stage at a rally in Harrisburg, Pa., April 29, 2017. Carlo Allegri / Reuters file

New York was alone in 10 U.S. ID card programs — including San Francisco and neighboring Newark, New Jersey — in storing applicants' personal data, according to a report by the charity the Center for Popular Democracy in 2015.

Alvaro Bedoya, executive director of the Center on Privacy and Technology at Georgetown Law, said cities can protect their databases from hacks but have less defense against ICE's "very expansive" powers to subpoena documents.

Pam Dixon of the World Privacy Forum, a research group on privacy and technology, said they "warned and warned” the city.

“I remember cautioning against the collection of these records and warned that the data would eventually be misused politically," she said. “We were told this ‘kill switch’ was going to be put in and this would save everything. But we have to understand that politics change."

Fear and 'misinformation'

The city included a kill switch — a clause saying data would be automatically erased on Dec. 31, 2016, and could be deleted any time before — specifically anticipating that a conservative Republican could win the 2016 presidential election, a city councilman told Reuters in 2015.

In the window between Trump’s election on Nov. 8, 2016, and the Republican lawsuit, filed on Dec. 5, City Hall said it held a security review before receiving the sign-off needed from the city's human resources team, which stored the records.

That permission arrived on Dec. 7, two days after the lawsuit was filed, according to court documents.

Records have now been trapped in legal limbo for a year — a judge ruled in favor of the mayor in April, only for the Republicans to file a new lawsuit that month.

The program states applicant information will not be shared with other government agencies or third parties except in response to a subpoena or warrant granted by a judge.

Since the card program began, the city has given law enforcement agents personal IDNYC data for 13 people, according to MOIA. The city said it has received no such requests from federal immigration enforcement.

After Trump won the election, de Blasio stressed he wanted to make undocumented people feel at home in his city.

He had already scaled back cooperation between police and immigration authorities, joining dozens of locales, including Los Angeles and Chicago, in a growing “sanctuary” movement.

This has set it on a collision course with Trump, who has issued an executive order slashing funding to jurisdictions that refuse to share information with U.S. immigration authorities. Chicago and San Francisco have challenged its legality.

And in September, immigration authorities unleashed Operation Safe Cities — the first of a raft of raids explicitly targeting cities that frustrate immigration officers.

In New York, that four-day raid netted 45 arrests, with ICE thereafter issuing almost weekly "Enforcement and Removal" statements, each listing dozens of arrests in the city.

Unlike raids of old, such as mass busts on factories employing undocumented workers, the arrests are "intelligence driven," said ICE, using analysis of government records and personal data to pinpoint individuals.

"We know exactly who we’re going to arrest and where we’re going to arrest them," said Thomas Homan, the ICE deputy director, at a briefing in December, adding the agency primarily targets criminals who pose a threat to public safety.

U.S. Immigration and Customs Enforcement (ICE) acting director Thomas Homan addresses the daily briefing at the White House in Washington, July 27, 2017. Jonathan Ernst / Reuters file

Amid the confusion of a fast-moving political world, Garcia said she would still urge her shaken friends to sign up for a card that can help them become part of their new home. After all, what other option is there?

"There is a lot of people saying I want this card but I'm afraid. What can we do? We have no other choice but to have an ID."

For more stories from the Thomson Reuters Foundation on the cities, property rights, and digital identity, visit thisisplace.org, follow @thisisplace on twitter, and 'like' facebook.com/thisisplace.