Association Label between Custom Objects and Notes

I am using a webhook in Zapier that based on a trigger, makes a put request that creates a note and associates it to a deal. I also want to associate that note with a custom object but am finding a difficult time doing so. For creating the note and associating it to the deal, I used Accounts Dashboard | HubSpot to find the association type id of 12 for deals but was wondering if there was a way I could do something similar to associate it with a custom object, or if there are any workarounds that people know of. Not sure if it makes any difference, but we do not have Operations Hub.

Any help/guidance would be greatly appreciated,

Thanks!

Also - I meant “post” request, not put.

Hey @RLeonard

First check your custom object’s schema using:

GET
/crm/v3/schemas/{objectType}

If the association to notes is present, it will list the association direction ids.

If not you’ll want to update the schema to include the NOTES associtaion by patching the schema:

POST
/crm/v3/schemas/{objectType}/associations

Hope this gets you moving!

A note: You’ll want to do the above using a tool like Postman not Zapier

Hi Kevin - thank you for the feedback and guidance. I did the get request for my custom object and was given the following:

{

“fromObjectTypeId”: “2-13328406”,

“toObjectTypeId”: “0-46”,

“name”: “flip_projects_to_note”,

“cardinality”: “ONE_TO_MANY”,

“inverseCardinality”: “ONE_TO_MANY”,

“id”: “79”,

“createdAt”: null,

“updatedAt”: null

},

{

“fromObjectTypeId”: “0-46”,

“toObjectTypeId”: “2-13328406”,

“name”: “flip_projects_to_note”,

“cardinality”: “ONE_TO_MANY”,

“inverseCardinality”: “ONE_TO_MANY”,

“id”: “80”,

“createdAt”: null,

“updatedAt”: null

}

My objective is to post a note to my custom object. I tried the following post request:

{

“properties”: {

“hs_timestamp”: “2023-04-17T15:48:22Z”,

“hs_note_body”: “Here’s my sample note. This is just a test.”,

“hubspot_owner_id”: “349248903”

},

“associations”: [

{

“to”: {

“id”:13042541752

},

“types”: [

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 12

}

]

},

{

“from”: {

“objectTypeId”: “0-46”

},

“to”: {

“objectTypeId”:“2-13328406”,

“id”: 6018585414

},

“types”: [

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 80

}

]

}

]

}

Whether I use the association type ID of 79 or 80, I always get a resposne similiar to this (here is my response using the association type ID of 80):

{

“status”: “error”,

“message”: “invalid from object type 0-46 for associations to be created. expected: 0-15”,

“correlationId”: “f59d5055-d8f7-42b1-90f5-0fb80573033a”,

“category”: “VALIDATION_ERROR”

}

I’m by no means proficient in this space as I am recently self-taught, so I’m sure I have a handful of errors. Any help would be greatly appreciated. Thanks!


@Kevin-C wrote:

Hey @RLeonard

First check your custom object’s schema using:

GET
/crm/v3/schemas/{objectType}

If the association to notes is present, it will list the association direction ids.

If not you’ll want to update the schema to include the NOTES associtaion by patching the schema:

POST
/crm/v3/schemas/{objectType}/associations

Hope this gets you moving!


Hi Kevin - thank you for the feedback and guidance. I did the get request for my custom object and was given the following:

{

“fromObjectTypeId”: “2-13328406”,

“toObjectTypeId”: “0-46”,

“name”: “flip_projects_to_note”,

“cardinality”: “ONE_TO_MANY”,

“inverseCardinality”: “ONE_TO_MANY”,

“id”: “79”,

“createdAt”: null,

“updatedAt”: null

},

{

“fromObjectTypeId”: “0-46”,

“toObjectTypeId”: “2-13328406”,

“name”: “flip_projects_to_note”,

“cardinality”: “ONE_TO_MANY”,

“inverseCardinality”: “ONE_TO_MANY”,

“id”: “80”,

“createdAt”: null,

“updatedAt”: null

}

My objective is to post a note to my custom object. I tried the following post request:

{

“properties”: {

“hs_timestamp”: “2023-04-17T15:48:22Z”,

“hs_note_body”: “Here’s my sample note. This is just a test.”,

“hubspot_owner_id”: “349248903”

},

“associations”: [

{

“to”: {

“id”:13042541752

},

“types”: [

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 12

}

]

},

{

“from”: {

“objectTypeId”: “0-46”

},

“to”: {

“objectTypeId”:“2-13328406”,

“id”: 6018585414

},

“types”: [

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 80

}

]

}

]

}

Whether I use the association type ID of 79 or 80, I always get a resposne similiar to this (here is my response using the association type ID of 80):

{

“status”: “error”,

“message”: “invalid from object type 0-46 for associations to be created. expected: 0-15”,

“correlationId”: “f59d5055-d8f7-42b1-90f5-0fb80573033a”,

“category”: “VALIDATION_ERROR”

}