Copy flag settings from the production environment to the test environment.

constdata={"projKey":"default","flagKey":"new-checkout-flow","envKey":"production","source":{"key":"production",},"target":{"key":"test",},"includedActions":["updateRules","updateOffVariation"]}fetch("https://app.launchdarkly.com/api/v2/flags/app/new-checkout-flow/copy",{method:"POST",headers:{"Authorization":"YOUR API ACCESS TOKEN","Content-Type":"application/json",},body:JSON.stringify(data)}).then(response=>response.json()).then(flag=>{// Do something with the newly created flag
})