APIs & Integrations

Ruben_BAP
Member

API POST createdate on company

Hello Hubspot!

I would like to create a company with the API and properly set the creation date. So far I tried :

(end point https://api.hubapi.com/companies/v2/companies?hapikey=XXX)

array(2) { ["properties"]=> array(1) { [0]=> array(2) { ["name"]=> string(4) "name" ["value"]=> string(7) "APIVITA" } } ["createdate"]=> int(1474973366000) }

-> No error but createdate come back to 1484583294281 (which is the moment I did the API call).

array(1) { ["properties"]=> array(2) { [0]=> array(2) { ["name"]=> string(4) "name" ["value"]=> string(7) "APIVITA" }, [1]=> array(2) { ["name"]=> string(10) "createdate" ["value"]=> int(1474973366000) } } }
-> Error : Property values were not valid

(Note that I also tried both calls with createdate value as a string instead of int, same result)

Any help is welcomed !

Thanks!

0 Upvotes
1 Reply 1
Dadams
HubSpot Employee
HubSpot Employee

API POST createdate on company

Hi @Ruben_BAP

The createdate property is a system property and cannot be manually set, as it will always be set to the time the record was created in HubSpot. If you want to store the time the company was originally created in your system, you’d need to create a custom property to store that.