"Domain" property not being set via API

SOLVE
RSDigital
Member

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.
 
2021-07-20_8-43-41.jpg
0 Upvotes
1 Accepted solution

Accepted Solutions
RSDigital
Solution
Member

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 

View solution in original post

3 Replies 3
dennisedson
Community Manager

@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.

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
webdew
Top Contributor | Diamond Partner

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. 

0 Upvotes
RSDigital
Solution
Member

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 

View solution in original post