From what I’ve been able to tell, creating an association between contacts and a custom object automatically results in a many-to-many relationship, implemented as one-to-many relationships in both directions. For instance, I have a custom object named “Term Enrollment” associated with contacts. The schemas API (https://api.hubspot.com/crm/v3/schemas) reports the following:
{
"fromObjectTypeId": "2-17613424",
"toObjectTypeId": "0-1",
"name": "term_enrollment_to_contact",
"cardinality": "ONE_TO_MANY",
"inverseCardinality": "ONE_TO_MANY",
"id": "223",
"createdAt": null,
"updatedAt": null
},
{
"fromObjectTypeId": "0-1",
"toObjectTypeId": "2-17613424",
"name": "term_enrollment_to_contact",
"cardinality": "ONE_TO_MANY",
"inverseCardinality": "ONE_TO_MANY",
"id": "224",
"createdAt": null,
"updatedAt": null
},
This doesn’t match up with the actual usage of these objects. For us, a contact can be enrolled in one or more terms (with associated number of hours, etc.). Because of the additional properties on the Term Enrollment object, an instance of such an object would belong only to a single contact. There shouldn’t be a one-to-many relationship from Term Enrollment to Contact; it’s truly a parent-child relationship.
My questions are these:
- Is it possible to force a one-to-many relationship instead of a many-to-many relationship through the HubSpot app?
- If not, is it possible to change the cardinality of the relationships through the API? (For the example above, Contact to Term Enrollment should be one-to-many, but Term Enrollment to Contact should be one-to-one.)