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 a deal with a contact or company

Last updated June 17, 2020

PUT deals/v1/deal/:dealId/associations/:OBJECTTYPE?id=:objectId&id=:objectId

Note: This endpoint is deprecated. Use the CRM Associations API to manage deal associations.

Method Details

HTTP Methods:

PUT

Content Type:

application/json

Response Format:

N/A

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

CRM

Required Scope:

crm.objects.companies.write
crm.objects.contacts.write
crm.objects.deals.write

This endpoint updates the association between an existing deal and a contact or company. The deal can be associated with either contacts or companies with each request. This endpoint supports associating more than one object ID of a particular object type at once.

Note: You only need to use this endpoint when updating existing deal records. If you are creating new deals, you can make these associations when creating the record by including the associations data as documented on the create deal page.

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.
 Deal Id  Used in the request URL (see above) Unique identifier for a particular deal. This id is available in the URL of a deal in the HubSpot CRM. 
 Object Type  Specify whether you would like to associate the deal with a contact or a company. Must be all caps (CONTACT or COMPANY). The type of object that you are associating the deal with.
Contact or company IDs Specify a contact or company ID (&id=X)  Unique identifier for a particular contact or company. These IDs are available in the URL of a contact or company in HubSpot CRM.  
     

Optional ParametersHow to useDescription
Additional contact or company IDs You can specify more than one contact or company id in each request (&id=X) Unique identifier for a particular contact or company. These IDs are available in the URL of a contact or company in HubSpot CRM.