Customers can now create Campaign goals through the CRM Goals API.
Customers can create campaigns and goals independently through API. However, it was never possible to directly tie a goal to campaigns through API resulting in extra steps needed inside the HubSpot app to complete the end-to-end workflow.
Now, any user can build a campaign and create a goal for that campaign in one workflow through the HubSpot APIs.
When creating a goal, include your Campaign GUID in the request body under campaignAssociation to tie the goal to the selected campaign.
See the Goals docs here for additional details.
Marketing Hub Professional, Marketing Hub Enterprise