Can't edit or update or create any of the date property of a contact through api

contacts

#1

I am creating a contact through api and i am passing the value for create date also , but i am getting 400 bad request error, same thing is happening for update contact while passing last modified date.
" "properties": [" +
" {" +
" "property": "firstname"," +
" "value": "testingvaradan "" +
" }," +
" {" +
" "property": "lastname"," +
" "value": "test"" +
" }," +
" {" +
" "property": "mobile_number"," +
" "value": "8568568568"" +
" }," +
" {" +
" "property": "createdate"," +
" "value": "1537423650000"" +
" }," +
" {" +
" "property": "lastmodifieddate"," +
" "value": "1537423650000"" +
" }," +
" {" +
" "property": "address"," +
" "value": "300/13 venkatapura"" +
" }," +
" {" +
" "property": "hubspot_owner_id"," +
" "value": "30752288"" +
" }" +
" ]" +


#3

Hi @varadan,

Many of the HubSpot "date" properties, including createdate and lastmodifieddate, are calculated by the system and cannot be set or updated directly via an API. HubSpot will automatically fill these properties when a contact record is created. For additional insight, this article lists the definitions of all default contact properties.

If you wish to sync historical date values to new contact records, you must use custom object properties.


#4

It's worth noting that my explanation above applies to contacts. As @Connor_Barley found in your other topic, some properties like a deal's hs_lastmodifieddate property can be updated via the API.

If you try to do the same for contact properties, you will get the following response:

{
    "status": "error",
    "message": "Property values were not valid",
    "correlationId": "372c5906-ea67-4fc1-be08-eac27f1ceb11",
    "validationResults": [
        {
            "isValid": false,
            "message": "\"lastmodifieddate\" is a read only property; its value cannot be set.",
            "error": "READ_ONLY_VALUE",
            "name": "lastmodifieddate"
        },
        {
            "isValid": false,
            "message": "\"createdate\" is a read only property; its value cannot be set.",
            "error": "READ_ONLY_VALUE",
            "name": "createdate"
        }
    ],
    "requestId": "632a3aa2312ed5853e604ecf47706656"
}

#5

Hey @varadan, Working with Isaac here, this actually seemed to be a temporary glitch where I was able to update the deal record's last modified date, but can no longer do so, and get the same error as Isaac does. I would not expect this field to be modified, since it's a default HubSpot property that gets set by the system.

This property can not be altered via API

I apologize for giving conflicting information, but the hs_lastmodifieddate for deals and lastmodifieddate are not editable fields, and they get set whenever there's an update to a deal, contact, or company by the system.


Getting a “400 Bad Request” when trying to pass the "Last modified date" through API
#6