How to duplicate flows with different device ID

I'm using /flow API to import a flow with few nodes.

I'm looping this API in for loop by which I'm trying to duplicate the flow with few different parameters. But I'm always getting error as {"code":"unexpected_error","message":"duplicate id"}

Please advise.