# API "property\_doesnt\_exist" errors

**URL:** <https://community.hubspot.com/t/api-property-doesnt-exist-errors/20891>\
**Category:** APIs & Integrations\
**Tags:** companies\
**Created:** [May 14, 2020, 9:07pm UTC](https://community.hubspot.com/t/api-property-doesnt-exist-errors/20891 "2020-05-14T21:07:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathansimmons](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonathansimmons/32/68337_2.png) [@jonathansimmons](https://community.hubspot.com/u/jonathansimmons)\
**Post date:** [May 14, 2020, 9:07pm UTC](https://community.hubspot.com/t/api-property-doesnt-exist-errors/20891/1 "2020-05-14T21:07:35Z")

</div>

I’ve just started doing some lightweight testing with the API. To begin, I’m mostly just copy/pasting the ruby samples from the v3 docs.  
Here is a small snippet of what I’m doing:

```auto
agency = Agency.includes(:employees, :influencers, :submissions).find(8)
first_employee = agency.employees.first

body = {
 properties: {
 name: agency.name,
 industry: "INSURANCE",
 type: "SUBSCRIBER",
 domain: first_employee.email.split(/@/).last,
 application_identifier: agency.id,
 employee_count: agency.employees.count,
 influencer_count: 0,
 submission_count: 0,
 subscription_status: "none",
 }}

url = URI("https://api.hubapi.com/crm/v3/objects/companies?hapikey=#{ENV["HUBSPOT_API_KEY"]}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = body.to_json

response = http.request(request)
puts response.read_body

```

This fails, and the response is as follows:

```auto
 {"status":"error","message":"Property values were not valid: [
 {\"isValid\":false,\"message\":\"Property \\\"employee_count\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"employee_count\"},{\"isValid\":false,\"message\":\"Property \\\"influencer_count\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"influencer_count\"}
 ]","correlationId":"e600a92f-feea-45a8-958e-0eb293166473","category":"VALIDATION_ERROR"}

```

So the call failed because employee\_count and influencer\_count “do not exist”, the thing is, they do. See this screenshot for proof.

 ![26875iCEB07EA0356FF2CB.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/5/5193ed2b8bd6d670cac791e0a411b63469463d85.png)

In fact, 3 of the other attributes are custom attributes I created at the same time as employee\_count and influencer\_count and they all work fine.  
Anyone’s help in identifying this issue would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![jonathansimmons](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonathansimmons/32/68337_2.png) [@jonathansimmons](https://community.hubspot.com/u/jonathansimmons)\
**Post date:** [May 15, 2020, 7:24pm UTC](https://community.hubspot.com/t/api-property-doesnt-exist-errors/20891/2 "2020-05-15T19:24:03Z")

</div>

I resolved my own issue here by reailzing I had renamed the property.  
Hubspot does a poor job of pointing out that when renaming a property the API identify does not change from the origional name.  
To fix things I had to delete the two properties that had been renamed, and recreate them.  
Funnily enough, even this was difficult as Hubspot has a “recycle bin” for deleted items. So I wasn’t able to create the properly named attributes until I resotred the deleted items, gave them an unrelated name, then deleted them again.  
All in all, Hubspot support was absolutley no help figuring this out. I paid for an account just to talk to a support rep and still ended up solving it myself before anyone could tell me what was going on.
