Set up product features through API

May be someone can help and tell how I can set through API some feature value or feature variant for existing product? Feature also already exists.

Also I can't understand how through API when adding new product at once set all features values/variants.



Thanks in advance for help!