Company datetime property


#1

Hi, first post here:

I currently have a custom Company property that is of type "date". I want to change it to "datetime". I understand this has to be done using the API, but the docs specifically talk about Contact properties for datetime so I'm not sure if it's supported, or if I'm doing something incorrectly.

Based on a combination of these documentation pages:



I have attempted to change the property type like this:

URL: https://api.hubapi.com/properties/v1/companies/properties/named/sign_up_date?hapikey=XXXXXX
Method: PUT
Body:
{
"label": "Sign-up Date",
"type": "datetime",
"groupName": "custom_data",
}

Response:
HTTP/1.1 415 Unsupported Media Type

The response also had a bunch of cloudflare stuff that I omitted from the above as I believe it is not relevant.

This is the first time I have attempted to change a company property, and the documentation is not as clear as for a Contact property.

Questions:

  1. Am I formatting my request body and URL correctly?
  2. Does the Company Property API support "datetime" as a type?

In addition, I just tried creating a new property, but received the same response. My POST body to create the new property was this:
{
"name": "sign_up_datetime",
"label": "Sign up Datetime",
"description": "The date the company signed up",
"groupName": "custom_data",
"type": "datetime",
"fieldType": "datetime"
}

Any help is appreciated.

Thanks,
Dave


#2

My bad, was missing the content-type header on my request. This is working properly now with content-type:appdlication/json.