A trove of nearly 7,000 pages of confidential internal Facebook documents has been leaked to the public despite the social media giant's desperate efforts to keep them under wraps.

The documents, included in sealed California court filings and leaked by an anonymous source to a journalist who published them publicly on Wednesday, revealed Facebook's apparent attempt to squash potential rivals by cutting off app developer's access to user data - a change it passed off as a boon for privacy.

They describe how the company encouraged hundreds of thousands of developers to build mobile applications on the networking platform up until 2012, when it began withholding the data those applications needed to function.

Executives announced the move to limit access three years later in 2015, championing it as an effort to protect its one billion users, when in reality it was meant to thwart competitors.

In internal emails, some Facebook executives appeared to refer to the strategy of promoting a privacy-focused explanation for the change as the 'Switcharoo Plan'.

Facebook launched a so-called 'Switcheroo Plan' to squash potential rivals by cutting off user data to app developers in 2012 before publicly presenting the move as tighter data controls

The emergence of the new documents, which date back to 2010, comes as Facebook faces multiple investigations into possible antitrust violations by regulators around the world.

The emails could supply valuable evidence to investigators, including a US House of Representatives panel that sought company records in September on Facebook's decisions to bar apps from its social graph, which maps out relations between users.

British journalist Duncan Campbell provided the new documents to several media outlets on Wednesday after submitting them to Congressman David Cicilline (D-Rhode Island), chairman of the US Congress House Judiciary Subcommittee on Antitrust, Commercial and Administrative Law.

Facebook ignored the subcommittee's request for the documents last month.

The documents come from a lawsuit filed in 2015 by Six4Three, the developer of a now-shuttered bikini photo app that lost access to Facebook user data as a result of the changes, which were announced in 2014 and implemented the following year.

Six4Three alleges that Facebook's data policies were anticompetitive and that the company misrepresented those policies both to developers and the public.

Facebook has described the case as baseless. A company spokeswoman told Reuters the documents were 'taken out of context by someone with an agenda against Facebook' and made public 'with a total disregard for US law'.

Facebook announced the move to limit third-party data access in 2015, championing it as an effort to protect the site's one billion users, when in reality it was meant to thwart competitors

Portions of the material have been released over the course of the past year, after a British lawmaker, MP Damian Collins, pressured Six4Three founder Ted Kramer to hand them over and then published 250 pages last December.

However, Collins' disclosure provided an incomplete picture of the period between 2012 and 2014 when policy changes were debated within the company.

The new documents feature exchanges between executives discussing cutting off access to user data for developers seen as potential competitors at a time when the company said publicly that it provided an open and neutral platform.

The changes, which were first implemented in 2012, according to the emails, involved limiting the amount of data that certain apps could extract from the Facebook friends of their users.

The ThisIsYourDigitalLife app exploited this feature to get information from millions of Facebook profiles despite only having around 300,000 direct users, which it later sold to political consulting firm Cambridge Analytica.

Where did the Six4Three Facebook emails come from? Ted Kramer, who owns the app developer Six4Three, filed a lawsuit against Facebook after the tech company restricted to data that one of his apps - Pinkini - could access. The app was designed to identify bikini photos among albums posted by friends on Facebook, and the restrictions effectively killed it. In the lawsuit, Kramer accuses Facebook of encouraging developers to build apps based around access to data that it then withdrew. He also alleges that Zuckerberg sold expensive ads to developers in return for long-term access to the data. This form of access was later exploited by Cambridge Analytica in an attempt to affect elections. As part of his case, Kramer got his hands on documents - said to include confidential emails between senior executives, and correspondence with Zuckerberg - apparently showing they knew about issues around the privacy of user data. UK-based journalist Duncan Campbell received the 7,000 pages of documents spread across 428 court exhibits from an anonymous source in February 2019. Campbell said he did not know the identity of the source and had not communicated with them before receiving the documents through a secure electronic communications method. Read Campbell's description of the documents here. Advertisement

In emails sent ahead of the changes being implemented, Facebook senior staff discussed 'whitelisting' several apps - including Lyft, Tinder, and AirBnB - meaning they would keep full access to friend data.

The emails made it clear that access to such data would depend on how much the companies were paying Facebook.

In one particularly blunt email sent by Konstantinos Papamiltidas, Facebook's director of platform partnerships, he said: 'Communicate in one-go to all apps that don't spend that those permission[s] will be revoked.

'Communicate to the rest that they need to spend on NEKO [a platform that Facebook uses to sell advertising] $250k a year to maintain access to the data.'

In another email from Mark Zuckerberg himself, sent in 2012, he laid out his vision for how Facebook will generate money in the future, including leveraging developers for access to data.

He wrote: 'I'm getting more on board with locking down some parts of platform, including friends data and potentially email addresses for mobile apps.

'Without limiting distribution or access to friends who use this app, I don't think we have any way to get developers to pay us at all...'

In another email, sent around the same time, he discussed charging developers a fee for accessing user data - which he said should 'cost a lot of money' - that they can repay to Facebook by buying their advertising or using their payments service.

He wrote: 'A basic model could be: Login with Facebook is always free, pushing content to Facebook is always free, reading anything, including friends, costs a lot of money. Perhaps on the order of $0.10/user each year.

'For the money that you owe, you can cover it in any of the following ways: Buy[ing] ads from us in neko or another system.

'Run our ads in your app or website (canvas apps already do this). Use our payments. Sell your items in our Karma store.

'Or if the revenue we get from those doesn't add up to more that the fees you owe us, then you just pay us the fee directly.'

In a 2013 email, one executive described dividing apps into 'three buckets: existing competitors, possible future competitors, developers that we have alignment with on business models' as part of the project to restrict access to user data, dubbed 'PS12N'.

Those in the last category were able to regain access by agreeing to make mobile advertising purchases or provide reciprocal user data to Facebook under 'Private Extended API Agreements', according to the emails.

As thousands of developers lost access to user data, the executives decided to announce the changes publicly.

They elected to link what they referred to as the '"bad stuff" of PS12N' to an unrelated update of the Facebook login system which gave people greater control over their privacy.

The 'narrative' for the announcement 'will focus on quality and the user experience which will potentially provide a good umbrella to fold in some of the API deprecations,' one executive wrote in an email.

Another invited colleagues in a February 2014 email to review the 'Switcharoo Plan', calling it 'a good compromise' that will enable them 'to tell a story that makes sense'.

The month prior, the same executive wrote: 'My concern is around the perception that we can't hold our story together.'

When Facebook enacted the changes in 2015, executives told journalists the company had conducted research on user sentiment about Facebook apps and decided on policies that would help build confidence in data privacy, according to a report by tech publication TechCrunch.