Rideshare company Uber and on-demand order delivery service Postmates sued Monday to block a new California law that could fundamentally alter how tech giants engage with workers.

The law, set to take effect on Wednesday, changes the way businesses classify employees and dramatically expands protections for gig workers. It creates the nation’s strictest test by which workers must be considered employees and it could start a precedent for other states.

In a lawsuit filed in US court in Los Angeles on Monday, Uber and Postmates argued however that the law violates federal and state constitutional guarantees of equal protection and due process.

Uber said it will try to link the lawsuit to another legal challenge filed by associations representing freelance writers and photographers. In mid-December, the two groups argued the new law would unconstitutionally affect free speech by limiting how many stories they can produce.

Q&A What is the gig economy? Show The gig economy is based on temporary or freelance jobs. Often these are offered by app-based services like Uber or Deliveroo, where instead of a regular wage, workers get paid for the 'gigs' they do. If they aren't out working, they aren't getting paid. Companies offering this kind of work argue that it provides people with a flexible way to be employed, whether that means doing some extra work on the side to fund studying, or to work around childcare demands. A major drawback for workers though is the lack of protection and paid benefits such as holiday or sick pay. There are also suggestions that by the time some companies have taken a cut of payments for a service, workers aren't making the minimum wage.

And the roles aren't always as flexible as they first appear, with gig workers incentivised and put under pressure to work at times when a service is busier. In 2018 the US Bureau of Labor Statistics reported that 55 million people in the US workforce were 'gig workers' – more than 35% of the market. In the UK the gig economy more than doubled in size in the three years leading up to 2019, when it accounted for 4.7 million workers. Up to one in seven working-age adults in the UK – about 7.5 million people – have worked via a gig economy platform at some point.

The California Trucking Association filed the first challenge to the law in November on behalf of independent truckers.

The latest challenge includes two independent workers who wrote about their concerns with the new law.

“This has thrown my life and the lives of more than a hundred thousand drivers into uncertainty,” ride-share driver Lydia Olson wrote in a Facebook post cited by Uber.

Postmates driver Miguel Perez called on-demand work “a blessing” in a letter distributed by Uber. He said he used to drive a truck for 14 hours at a time, often overnight.

“Sometimes, when I was behind the wheel, with an endless shift stretching out ahead of me like the open road, I daydreamed about a different kind of job – a job where I could choose when, where and how much I worked and still make enough money to feed my family,” he wrote.

The lawsuit contends that the law exempts some industries but includes ride-share and delivery companies without a rational basis for distinguishing between them. It alleges that the law also infringes on workers’ rights to choose how they make a living and could void their existing contracts.

Democratic assemblywoman Lorena Gonzalez of San Diego countered that she wrote the law to extend employee rights to more than a million California workers who lack benefits, including a minimum wage, mileage reimbursements, paid sick leave, medical coverage, and disability pay for on-the-job injuries.

She noted that Uber had previously sought an exemption when lawmakers were crafting the law, then said it would defend its existing labor model from legal challenges. It joined Lyft and DoorDash in a vow to each spend $30m(£23m) to overturn the law at the ballot box in 2020 if they don’t win concessions from lawmakers next year.

“The one clear thing we know about Uber is they will do anything to try to exempt themselves from state regulations that make us all safer and their driver employees self-sufficient,” Gonzalez said in a statement. “In the meantime, Uber chief executives will continue to become billionaires while too many of their drivers are forced to sleep in their cars.”