# "Domain" property not being set via API

**URL:** <https://community.hubspot.com/t/domain-property-not-being-set-via-api/41002>\
**Category:** APIs & Integrations\
**Tags:** companies, starter\
**Created:** [July 20, 2021, 12:45pm UTC](https://community.hubspot.com/t/domain-property-not-being-set-via-api/41002 "2021-07-20T12:45:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RSDigital](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rsdigital/32/41549_2.png) [@RSDigital](https://community.hubspot.com/u/RSDigital)\
**Post date:** [July 20, 2021, 12:45pm UTC](https://community.hubspot.com/t/domain-property-not-being-set-via-api/41002/1 "2021-07-20T12:45:21Z")

</div>

Hello,

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

[https://api.hubapi.com/crm/v3/objects/companies](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](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/7/87b2c11c57c9ed33801548f06562f074dff5970a.jpeg)

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [July 20, 2021, 8:49pm UTC](https://community.hubspot.com/t/domain-property-not-being-set-via-api/41002/2 "2021-07-20T20:49:13Z")

</div>

@RSDigital ,

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

Something like this:

```lia-code-sample
{
 "properties": {
 "domain": "demo.net"
 }
}

```

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

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [July 21, 2021, 1:42pm UTC](https://community.hubspot.com/t/domain-property-not-being-set-via-api/41002/3 "2021-07-21T13:42:16Z")

</div>

Hi @RSDigital ,  
Have a look of this screenshot : [https://prnt.sc/1duuzhx](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](https://api.hubapi.com/companies/v2/companies/%3CcompanyID%3E?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.

---

<div class="post-metadata">

**Author:** ![RSDigital](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rsdigital/32/41549_2.png) [@RSDigital](https://community.hubspot.com/u/RSDigital)\
**Post date:** [July 22, 2021, 3:43am UTC](https://community.hubspot.com/t/domain-property-not-being-set-via-api/41002/4 "2021-07-22T03:43:25Z")

</div>

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](https://www.hubspot.com/product-updates/add-multiple-domains-to-companies-in-hubspot)) I believe this is moot, at least for my needs.
