APIs & Integrations

odowdbrendan
Participant

Sending a blank date through API

Hey, I am looking for a way to send a blank value for a date through an API Post call.  The POST will fail if there is no value given for the date field that I am updating.  I know how to convert my dates into unix millisecond form, however, I cannot pass a blank value when my date field is empty.  I am using a dummy value of JAN-1-1900 for now when my query doesnt have data for the date field, but would prefer to send a field. 

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

Sending a blank date through API

Hey @odowdbrendan,

 

As mentioned by my colleague Isaac on this community thread

 

You can clear date and datetime-type properties by passing a blank string: ""

POST https://api.hubapi.com/contacts/v1/contact/vid/123/profile

{
  "properties": [
    {
      "property": "custom_date_picker",
      "value": ""
    }
  ]
}

 

Does this work for you?

 

If not, could you share with me the exact endpoint that you're using and the POST body?

0 Upvotes