Update associatedCompanyIds from the Deals API

Hi,

I’m facing an issue while trying to update the ‘associatedcompanyid’ using the Deals API, specifically the endpoint: https://api.hubapi.com/deals/v1/deal/{deal_id}.

When attempting to use the PUT method, I receive the following error:

{ “status”: “error”, “message”: “properties cannot be null” }

I would greatly appreciate any assistance in resolving this problem and successfully updating the ‘associatedCompanyIds’ using the CRM API for deals.

Thank you.

Hey @SKumar170 from the error it seems like you’re not sending a value for required properties for your deals. Have you verified you’re sending values for the mandatory properties that have been set within your CRM when creating deals?

Hi @TomM2 ,

I need to update a value in the “associations” field, not the “properties” field. It seems unnecessary to pass the “Property” field for this update.

Here is the API GET response:

I want to update the “associatedCompanyIds” field in this response. Could you please assist me with the correct approach?
Currenly, I am able to update the value present under ‘properties’.
Thank you.

I understand it might not make sense in your use case, but you’re using the “update a deal” api which has a required properties block, as you can see in the documentation:

https://legacydocs.hubspot.com/docs/methods/deals/update_deal

"The update a deal endpoint updates an existing deal in HubSpot using the dealId and JSON-specified properties in the request body. "

If you’re only looking to associate two objects with each other, then you should be using the associations endpoint

Hey, @TomM2! Just wanted to let you know that I’ve successfully resolved my situation by utilizing the Association API. Many thanks for your assistance!

Great to hear! Happy I could help :slightly_smiling_face: