REST API you can do. My only concern is your use case of 3M+ documents, the parameter size can be 20M+ bytes. Mutating may take long time, may get errors, timeouts. Don’t want to try already mutated documents.
Keep in all these approach suggested in other post will be reasonable.