Hi,
Thank you for reaching out. For your first question, it is unfortunately not possible to set goals using the API.
For your second question, if you are using AdWords API, you can target
Device Type by implementing the
CampaignCriterionService with criterion type
Platform. The criterion IDs you shared are correct. Please see
here for an example of how to add targeting criteria to a campaign.
Similarly, if you are using Google Ads API, you will mutate the
CampaignCriterionService with CriterionType
Device.
Here is an example using Google Ads API.
Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5001UOCctg:ref