"Domain" property not being set via API

Hello,

I’m using the HubSpot API to create/update companies from our website (

https://api.hubapi.com/crm/v3/objects/companies endpoint, either POST or PATCH depending on need). All my standard and custom properties are working as expected, with the excetion of domain, which I cannot seem to set. My understanding is the API only supports accessing the primary domain, which is fine, however I’m not able to set anything unless I do it through the web interface.

Sample JSON sent in the request is shown below. Data has been obscured, obviously.

@RSDigital ,

Is it possible to show how the json looks when it is submitted?

Something like this:

{
 "properties": {
 "domain": "demo.net"
 }
}

I was able to successfully patch a company’s domain property with the above.

Hi @RSDigital ,
Have a look of this screenshot : https://prnt.sc/1duuzhx
Use below json code for update company with “put” method request
https://api.hubapi.com/companies/v2/companies/<companyID>?hapikey=demo
Example PUT JSON:
{
“properties”: [
{
“name”: “domain”,
“value”: “<domain_name>”
}
]
}

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.

Thanks for the tips; I’m still unable to programmatically set this, but I think it’s HubSpot trying to outsmart itself. In an case, since I can’t set multiple domains via API (see

https://www.hubspot.com/product-updates/add-multiple-domains-to-companies-in-hubspot) I believe this is moot, at least for my needs.