There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. Your API Keys could be deactivated at any time after Nov. 30th, and we recommend that you migrate to Private Apps as soon as possible so you do not lose business-critical functionality.

Associate CRM objects

Last updated June 17, 2020

PUT /crm-associations/v1/associations

Method Details

HTTP Methods:

PUT

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing & CRM

Required Scope:

crm.objects.companies.write
crm.objects.contacts.write
crm.objects.deals.write
tickets
e-commerce

This endpoint is used to associate two CRM objects.

Use case for this endpoint: You can use this endpoint to associate a ticket with a contact or to associate a line item with a deal.

See all possible associations on the CRM Associations Overview.

If you need to make multiple associations (either to the same object or across multiple objects) you can use the batch associations endpoint.

Response details

If the request is successful, returns a 204 No Content response.

Required parameters How to use Description
OAuth access token or API key Authorization: Bearer {token} header or hapikey={key} query parameter. Used to authenticate the request. Please see this page for more details about authentication.
From object "fromObjectId":
Used in the request JSON
The ID of the object being associated.
To object "toObjectId":
Used in the request JSON
The ID of the object the from object is being associated with.
Category "category":
Used in the request JSON
The category of the association. Currently this must be "HUBSPOT_DEFINED"
Association definition "definitionId":
Used in the request JSON
The ID of the association definition. See the table on the overview page for a list of these IDs.

These code samples use a demo API key. Using this key for anything but GET requests will result in an error. For all other requests (such as POST or PUT), you'll need to use your own API key or OAuth. For more details, please see here