There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API keys are no longer a supported authentication method for accessing HubSpot APIs. Instead, you should use a private app access token or OAuth to authenticate API calls. Learn more about this change and how to migrate an API key integration to use a private app instead.

Add Contact to Company

Last updated May 12, 2023

PUT /companies/v2/companies/:companyId/contacts/:vid

Note: This endpoint is deprecated. Use the CRM Associations API to manage company 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

Associate a given contact to a company. If a contact is already associated to a different company, the contact will be moved to the new company. A contact can only be associated to one company.

Required Parameters How to use Description
OAuth access token or private app access token Authorization: Bearer {token} header Used to authenticate the request. Please see this page for more details about authentication.
Company ID Used in the request URL (see above) The ID of a company to add a contact to
Contact VID Used in the request URL (see above) The ID of a contact to add a company
Optional Parameters How to use Description
None None No additional parameters for this endpoint.

If request is successful you'll receive a 200 response with the data for the company in the body of the response..

Returns a 404 response if either the company or contact is not found. The body of the response will indicate which object was not found.