@Javier_Martinez the Yoast API can not be used for setting a meta title or meta description. What could be used is a custom field option via ACF I.e.
Within the Yoast setting on wordpress you can set a ‘custom snippet variable’. Which you have to link to the custom field. In that way you can automate the metadescription and meta title field for a post or taxanomy etc.