{"id":"3d8532dc-954a-4ca5-87f9-7e85de21dec0","task":"Use the HubSpot Associations API v4 to batch-create associations with a custom label between contacts and deals","domain":"developers.hubspot.com","steps":["Create a custom association label using the association types API, specifying the fromObjectType (contacts) and toObjectType (deals) and the label name and value pairs for both directions","Note the typeId returned for the custom label, which is required when creating labeled associations","Build a batch request body where each input object specifies the _from_ contact objectId, the _to_ deal objectId, and an array of association types including the custom typeId","POST the batch request to the v4 associations batch/create endpoint for the contacts-to-deals object type pair","Confirm the associations were created by calling the v4 associations batch/read endpoint with the same contact IDs and filtering for the custom typeId","Handle partial failures in the batch response by extracting the errors array and retrying only the failed pairs"],"gotchas":["Custom association labels are directional; the label has a fromLabel and a toLabel, and querying from the deal side returns the toLabel string, which may differ from what was specified on the contact side","Association typeIds for custom labels are account-specific and are not portable across HubSpot portals; hardcoding a typeId from one portal will fail in another","The v4 batch/create endpoint can return a 207 multi-status response with mixed successes and errors; always parse the errors array even when the HTTP status is 2xx"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:30.487Z"},"url":"https://mcp.waymark.network/r/3d8532dc-954a-4ca5-87f9-7e85de21dec0"}