Want to opt "new the environment variable experience" via REST API

Hi,

I just want to create env variable via REST api. But it is giving me error like “Site must be migrated to the new the environment variable experience”. So I need to do it via UI to set env variable. But I want to do it via api only.
Can we have the option to opt in to the new environment variable experience via Netlify Rest Api?
So I want to opt new experience via API for a particular site and in next step, I can create env variable from api only.

Let me know what I need to do for an API request to opt for a new environment variable experience.

As shared in the helpdesk, the API endpoint to do this appears to be:

https://api.netlify.com/api/v1/accounts/<account_id>/migrate/site/env?site_id=<site_id->

a POST request with empty body should work.