Hi Harry,
Thank you for reaching out. You could use the CriterionUserInterest targeting type via AdWords API to apply audiences to an ad group. Please see here to find the Criterion ID you would like to use. Similarly, you can see refer to the targeting criteria and perform a mutate on AdGroupCriterionService in a similar fashion if you are using Google Ads API. Please refer to this example for how to add an audience to an ad group. You need to modify this code to reflect the shared information. Let us know if this clarifies your concern.
Regards,
Nikisha Patel, Google Ads API Team