API "property_doesnt_exist" errors

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:

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:

 {"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.

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.

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.