The CRM Associations endpoints are used to manage associations between tickets, products, line items, and their related contacts, companies, and deals.
PUT
request to
/crm/v4/objects/{fromObjectType}/{fromObjectId}/associations/default/{toObjectType}/{toObjectId}
In the request URL, include:
fromObjectType
: the ID of the object you’re associating. To find the ID values, refer to this list of object type IDs, or for contacts, companies, deals, tickets, and notes, you can use the object name (e.g., contact
, company
).fromObjectId
: the ID of the record to associate.toObjectType
: the ID of the object you’re associating the record to. To find the ID values, refer to this list of object type IDs, or for contacts, companies, deals, tickets, and notes, you can use the object name (e.g., contact
, company
).toObjectId
: the ID of the record to associate to.67891
, your request URL would be: /crm/v4/objects/contact/12345/associations/default/company/67891
.
To associate records without a label in bulk, make a POST
request to crm/v4/associations/{fromObjectType}/{toObjectType}/batch/associate/default
. In the request body, include objectId
values for the records you want to associate.
PUT
request to /crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}
. In the request URL, include the id
values of the two records you’re associating.POST
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create
. In the request body, include the id
values of records to associate in addition to the required parameters below.associationCategory
: either HUBSPOT_DEFINED
(default label) or USER_DEFINED
(custom label).associationTypeId
: the numerical ID value for the label. If using a default label (e.g., Primary company), refer to this list of default type IDs. If you’re using a custom label, you’ll need to retrieve the labels between those objects.typeId
that refers to the correct direction (e.g., Contact to Company vs. Company to Contact, Employee to Manager vs. Manager to Employee).GET
request to /crm/v4/associations/contact/deal/labels
.
2. In the response, look at the typeId
and category
values for the label. The ID will be a number (e.g., 36
), and the category will always be USER_DEFINED
for custom labels.
3. Make a PUT
request to /crm/v4/objects/contact/{objectId}/associations/deal/{toObjectId}
with the following example request body:
id
values of the two associated records along with the label
for the association. For the example above, the response would look like:
GET
request to /crm/v4/objects/{fromObjectType}/{objectId}/associations/{toObjectType}
. In the request URL, include the record’s object as the fromObjectType and its record ID as the objectId.POST
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/read
. In the request body, include up to 1,000 id
values of records whose associated records you want to retrieve.POST
request to /crm/v4/associations/contacts/companies/batch/read
. Your request would look like the following:
label
, category
, and typeId
. For the example batch request above, the response would be:
typeId
of 30
, to keep that label while adding another label, your request would look like:
DELETE
request to /crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}
.POST
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/archive
. In the request body, include the id
values of records for which you want to remove all of their associations.POST
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/labels/archive
. In the request body, include an array with id
values of the associated records and the associationTypeId
and category
values of label(s) to remove.
For example, to remove a custom label from an association, but keep the unlabeled association, your request would look like:
POST
request to crm/v4/associations/usage/high-usage-report/{userID}
. The file includes records using 80% or more of their association limit. For example, if a company can be associated with up to 50,000 contacts, the company will be included in the file if it has 40,000 or more associated contacts. The file will be sent to the email of the user whose ID was included in the request URL. Learn how to retrieve user IDs with the users API.
label
value of null
. When a record has a primary association or a custom association label, those types will be listed alongside the unlabeled association type.inverseLabel
field in your request to name the second label in the pair.POST
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels
and include the following in your request:
category
and unique typeId
will be returned, which you can use to retrieve, update, or delete the label moving forward. For paired labels, there’ll be a value for each direction of the association (e.g., 550
for contact to company and 551
for company to contact). For example, for the paired label request above, the response would look like:
GET
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels
.
You’ll receive an array, each item containing:
category
: whether the association type was created by HubSpot (HUBSPOT_DEFINED
) or by a user (USER_DEFINED
).typeId
: the numeric ID for that association type. This is used to set a label when associating records. Refer to this list for all the HubSpot defined typeId
values.label
: the alphanumeric label. This will be null
for the unlabeled association type.GET
request to /crm/v4/associations/contacts/companies/labels
. Your response would look similar to the following:
label
field for association types, which updates the name as it appears in HubSpot in your settings and on records. You cannot change the internal name
or typeId
.
To update a label, make a PUT
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels
. In the request body, including the associationTypeId
and a new value for label
. If editing a paired label, you can also include a new value for inverseLabel
.
Using the example in the section above, to update the label Contractor to Contract worker, your request would look like:
DELETE
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels/{associationTypeId}
. You’ll no longer be able to use this label when associating records.
POST
request to crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/create
.POST
request to crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/update
.inputs
with the following:
Parameter | Description |
---|---|
category | The category of the association you’re setting a limit for, either HUBSPOT_DEFINED or USER_DEFINED . |
typeId | The numeric ID for the association type you want to set a limit for. Refer to this list of default typeId values or retrieve the value for custom labels. |
maxToObjectIds | The maximum number of associations allowed for the association type. |
GET
request to /crm/v4/associations/definitions/configurations/all
. This will return custom association limits defined across all objects.GET
request to /crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}
.category
, typeId
, maxToObjectIds
, and label
. For example, if retrieving limits between deals and contacts, the response would look similar to:
POST
request to /crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/purge
. In the request body, include the category
and typeId
values of the association types for which you want to remove limits.
For example, to remove the Point of contact limit between deals and contacts, the request would look like:
associationTypeId
values that specify the type of association. Association types vary depending on the included objects and the direction of the association (e.g., Contact to Company is different from Company to Contact). If you create custom objects or custom association labels, the related association types will have unique typeId
values that you’ll need to retrieve or locate in your association settings in HubSpot.
TYPE ID | Association type |
---|---|
450 | Company to company |
14 | Child to parent company |
13 | Parent to child company |
280 | Company to contact |
2 | Company to contact (Primary) |
342 | Company to deal |
6 | Company to deal (Primary) |
340 | Company to ticket |
25 | Company to ticket (Primary) |
181 | Company to call |
185 | Company to email |
187 | Company to meeting |
189 | Company to note |
191 | Company to task |
88 | Company to communication (SMS, WhatsApp, or LinkedIn message) |
460 | Company to postal mail |
180 | Company to invoice |
510 | Company to order |
390 | Company to payment |
472 | Company to payment link |
298 | Company to subscription |
909 | Company to appointment |
939 | Company to course |
885 | Company to listing |
793 | Company to service |
929 | Company to feedback submission |
TYPE ID | Association type |
---|---|
449 | Contact to contact |
279 | Contact to company |
1 | Contact to company (Primary) |
4 | Contact to deal |
15 | Contact to ticket |
193 | Contact to call |
197 | Contact to email |
199 | Contact to meeting |
201 | Contact to note |
203 | Contact to task |
82 | Contact to communication (SMS, WhatsApp, or LinkedIn message) |
454 | Contact to postal mail |
587 | Contact to cart |
508 | Contact to order |
178 | Contact to invoice |
388 | Contact to payment |
470 | Contact to payment link |
296 | Contact to subscription |
907 | Contact to appointment |
861 | Contact to course |
883 | Contact to listing |
799 | Contact to service |
97 | Contact to feedback submission |
TYPE ID | Association type |
---|---|
451 | Deal to deal |
3 | Deal to contact |
341 | Deal to company |
5 | Deal to company (Primary) |
27 | Deal to ticket |
205 | Deal to call |
209 | Deal to email |
211 | Deal to meeting |
213 | Deal to note |
215 | Deal to task |
86 | Deal to communication (SMS, WhatsApp, or LinkedIn message) |
458 | Deal to postal mail |
313 | Deal to deal split |
19 | Deal to line item |
176 | Deal to invoice |
511 | Deal to order |
392 | Deal to payment |
474 | Deal to payment link |
63 | Deal to quote |
300 | Deal to subscription |
945 | Deal to appointment |
863 | Deal to course |
887 | Deal to listing |
795 | Deal to service |
985 | Deal to feedback submission |
TYPE ID | Association type |
---|---|
452 | Ticket to ticket |
16 | Ticket to contact |
339 | Ticket to company |
26 | Ticket to company (Primary) |
28 | Ticket to deal |
219 | Ticket to call |
223 | Ticket to email |
225 | Ticket to meeting |
227 | Ticket to note |
229 | Ticket to task |
84 | Ticket to communication (SMS, WhatsApp, or LinkedIn message) |
456 | Ticket to postal mail |
32 | Ticket to thread |
278 | Ticket to conversation |
526 | Ticket to order |
947 | Ticket to appointment |
941 | Ticket to course |
943 | Ticket to listing |
797 | Ticket to service |
1122 | Ticket to subscription |
99 | Ticket to feedback submission |
TYPE ID | Association type |
---|---|
578 | Lead to primary contact |
608 | Lead to contact |
610 | Lead to company |
596 | Lead to call |
598 | Lead to email |
600 | Lead to meeting |
854 | Lead to note |
646 | Lead to task |
602 | Lead to communication (SMS, WhatsApp, or LinkedIn message) |
1162 | Lead to feedback submission |
TYPE ID | Association type |
---|---|
906 | Appointment to contact |
908 | Appointment to company |
944 | Appointment to deal |
946 | Appointment to ticket |
912 | Appointment to call |
916 | Appointment to email |
918 | Appointment to meeting |
920 | Appointment to note |
922 | Appointment to task |
924 | Appointment to communication (SMS, WhatsApp, or LinkedIn message) |
926 | Appointment to postal mail |
TYPE ID | Association type |
---|---|
860 | Course to contact |
938 | Course to company |
862 | Course to deal |
940 | Course to ticket |
866 | Course to call |
870 | Course to email |
872 | Course to meeting |
874 | Course to note |
876 | Course to task |
878 | Course to communication (SMS, WhatsApp, or LinkedIn message) |
880 | Course to postal mail |
TYPE ID | Association type |
---|---|
882 | Listing to contact |
884 | Listing to company |
886 | Listing to deal |
942 | Listing to ticket |
890 | Listing to call |
894 | Listing to email |
896 | Listing to meeting |
898 | Listing to note |
900 | Listing to task |
902 | Listing to communication (SMS, WhatsApp, or LinkedIn message) |
904 | Listing to postal mail |
TYPE ID | Association type |
---|---|
798 | Service to contact |
792 | Service to company |
794 | Service to deal |
796 | Service to ticket |
840 | Service to call |
842 | Service to email |
838 | Service to meeting |
836 | Service to note |
852 | Service to task |
846 | Service to communication (SMS, WhatsApp, or LinkedIn message) |
848 | Service to postal mail |
TYPE ID | Association type |
---|---|
194 | Call to contact |
182 | Call to company |
206 | Call to deal |
220 | Call to ticket |
913 | Call to appointment |
867 | Call to course |
891 | Call to listing |
841 | Call to service |
1156 | Call to feedback submission |
TYPE ID | Association type |
---|---|
198 | Email to contact |
186 | Email to company |
210 | Email to deal |
224 | Email to ticket |
917 | Email to appointment |
871 | Email to course |
895 | Email to listing |
843 | Email to service |
TYPE ID | Association type |
---|---|
98 | Feedback submission to contact |
928 | Feedback submission to company |
984 | Feedback submission to deal |
100 | Feedback submission to ticket |
1155 | Feedback submission to call |
1157 | Feedback submission to cart |
1173 | Feedback submission to subscription |
1159 | Feedback submission to invoice |
1161 | Feedback submission to lead |
1167 | Feedback submission to order |
1171 | Feedback submission to quote |
1169 | Feedback submission to payment |
TYPE ID | Association type |
---|---|
200 | Meeting to contact |
188 | Meeting to company |
212 | Meeting to deal |
226 | Meeting to ticket |
919 | Meeting to appointment |
873 | Meeting to course |
897 | Meeting to listing |
839 | Meeting to service |
TYPE ID | Association type |
---|---|
202 | Note to contact |
190 | Note to company |
214 | Note to deal |
228 | Note to ticket |
921 | Note to appointment |
875 | Note to course |
899 | Note to listing |
837 | Note to service |
TYPE ID | Association type |
---|---|
453 | Postal mail to contact |
459 | Postal mail to company |
457 | Postal mail to deal |
455 | Postal mail to ticket |
927 | Postal mail to appointment |
881 | Postal mail to course |
905 | Postal mail to listing |
849 | Postal mail to service |
TYPE ID | Association type |
---|---|
204 | Task to contact |
192 | Task to company |
216 | Task to deal |
230 | Task to ticket |
923 | Task to appointment |
877 | Task to course |
901 | Task to listing |
853 | Task to service |
TYPE ID | Association type |
---|---|
81 | Communication (SMS, WhatsApp, or LinkedIn Message) to contact |
87 | Communication (SMS, WhatsApp, or LinkedIn Message) to company |
85 | Communication (SMS, WhatsApp, or LinkedIn Message) to deal |
83 | Communication (SMS, WhatsApp, or LinkedIn Message) to ticket |
925 | Communication (SMS, WhatsApp, or LinkedIn Message) to appointment |
879 | Communication (SMS, WhatsApp, or LinkedIn Message) to course |
903 | Communication (SMS, WhatsApp, or LinkedIn Message) to listing |
847 | Communication (SMS, WhatsApp, or LinkedIn Message) to service |
TYPE ID | Association type |
---|---|
177 | Invoice to contact |
179 | Invoice to company |
175 | Invoice to deal |
407 | Invoice to quote |
622 | Invoice to subscription |
815 | Invoice to payment link |
517 | Invoice to order |
986 | Invoice to ticket |
409 | Invoice to line item |
411 | Invoice to discount |
413 | Invoice to fee |
415 | Invoice to tax |
541 | Invoice to payment |
691 | Invoice to payment schedule installment |
679 | Invoice to data sync state |
1160 | Invoice to feedback submission |
TYPE ID | Association type |
---|---|
389 | Payment to company |
387 | Payment to contact |
391 | Payment to deal |
428 | Payment to discount |
1170 | Payment to feedback submission |
542 | Payment to invoice |
395 | Payment to line item |
524 | Payment to order |
476 | Payment to payment link |
397 | Payment to quote |
393 | Payment to subscription |
TYPE ID | Association type |
---|---|
475 | Payment link to payment |
469 | Payment link to contact |
471 | Payment link to company |
473 | Payment link to deal |
682 | Payment link to discount |
686 | Payment link to fee |
814 | Payment link to invoice |
758 | Payment link to line item |
477 | Payment link to subscription |
684 | Payment link to tax |
TYPE ID | Association type |
---|---|
69 | Quote to contact |
71 | Quote to company |
64 | Quote to deal |
67 | Quote to line item |
286 | Quote to quote template |
362 | Quote to discount |
364 | Quote to fee |
366 | Quote to tax |
702 | Contact signer (for e-signatures) |
733 | Quote to cart |
408 | Quote to invoice |
731 | Quote to order |
398 | Quote to payment |
304 | Quote to subscription |
1172 | Quote to feedback submission |
TYPE ID | Association type |
---|---|
571 | Line item to abandoned cart |
591 | Line item to cart |
396 | Line item to payment |
20 | Line item to deal |
368 | Line item to discount |
410 | Line item to invoice |
514 | Line item to order |
759 | Line item to payment link |
68 | Line item to quote |
302 | Line item to subscription |
565 | Upcoming line item to subscription |
TYPE ID | Association type |
---|---|
593 | Order to cart |
507 | Order to contact |
509 | Order to company |
512 | Order to deal |
519 | Order to discount |
521 | Order to discount code |
518 | Order to invoice |
513 | Order to line item |
523 | Order to payment |
730 | Order to quote |
516 | Order to subscription |
726 | Order to task |
525 | Order to ticket |
1168 | Order to feedback submission |
TYPE ID | Association type |
---|---|
586 | Cart to contact |
588 | Cart to discount |
590 | Cart to line item |
592 | Cart to order |
732 | Cart to quote |
728 | Cart to task |
594 | Cart to ticket |
594 | Cart to feedback submission |
TYPE ID | Association type |
---|---|
369 | Discount to deal |
361 | Discount to quote |
412 | Discount to invoice |
683 | Discount to payment link |
520 | Discount to order |
589 | Discount to cart |
367 | Discount to line item |
TYPE ID | Association type |
---|---|
687 | Fee to payment link |
363 | Fee to quote |
414 | Fee to invoice |
TYPE ID | Association type |
---|---|
295 | Subscription to contact |
297 | Subscription to company |
299 | Subscription to deal |
1121 | Subscription to ticket |
623 | Subscription to invoice |
301 | Subscription to line item |
303 | Subscription to quote |
478 | Subscription to payment link |
515 | Subscription to order |
1174 | Subscription to feedback submission |
TYPE ID | Association type |
---|---|
685 | Tax to payment link |
365 | Tax to quote |
416 | Tax to invoice |
Association type | ID |
---|---|
Contact to company | 1 |
Company to contact (default) | 2 |
Company to contact (all labels) | 280 |
Deal to contact | 3 |
Contact to deal | 4 |
Deal to company | 5 |
Company to deal | 6 |
Company to engagement | 7 |
Engagement to company | 8 |
Contact to engagement | 9 |
Engagement to contact | 10 |
Deal to engagement | 11 |
Engagement to deal | 12 |
Parent company to child company | 13 |
Child company to parent company | 14 |
Contact to ticket | 15 |
Ticket to contact | 16 |
Ticket to engagement | 17 |
Engagement to ticket | 18 |
Deal to line item | 19 |
Line item to deal | 20 |
Company to ticket | 25 |
Ticket to company | 26 |
Deal to ticket | 27 |
Ticket to deal | 28 |