One-to-many instead of many-to-many?

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:

  1. Is it possible to force a one-to-many relationship instead of a many-to-many relationship through the HubSpot app?
  2. 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.)

Hi @bgsueeid :waving_hand:

As far as I can tell, it’s not possible to manage the association cardinality (e.g. one-to-many, one-to-one) via the HubSpot web UI / app. Despite not being mentioned within the current version of HubSpot’s documentation, it is possible to specify association cardinality via the API.

However, while I was testing this, I found that these API-specified association cardinalities are no longer being respected within HubSpot’s web UI. For example, if I specify a “ONE_TO_ONE” association cardinality from my custom object to Deals

(for example)

, the HubSpot web UI allows me to associate multiple Deal records with a single record of my custom object type, despite the custom object schema returned by API showing a “ONE_TO_ONE” cardinality.

This definitely used to work as expected but, somewhere along the line, this HubSpot feature has stopped working. Maybe I can loop Community Manager, @Jaycee_Lewis in here to investigate further?

I hope this proves useful. Please let me know if you have any follow-up questions.

Update: You can absolutely do this now through the HubSpot UI: Associations API Enables Admins to Configure Association Limits