# Error with datetime property

**URL:** <https://community.hubspot.com/t/error-with-datetime-property/104504>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [April 10, 2024, 2:46pm UTC](https://community.hubspot.com/t/error-with-datetime-property/104504 "2024-04-10T14:46:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ael31](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Ael31](https://community.hubspot.com/u/Ael31)\
**Post date:** [April 10, 2024, 2:46pm UTC](https://community.hubspot.com/t/error-with-datetime-property/104504/1 "2024-04-10T14:46:05Z")

</div>

Hello Developer Community!

I’m trying to create a field that includes date and time using the HubSpot API documentation. I’m using the following endpoint:

 ![Ael31_0-1712759956497.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/6/563d9a8837103b4e0178303b84f89b3639ae362e.png)

I’ve set up all the necessary parameters and added the token from our private app, which is receiving API calls correctly.

 ![Ael31_1-1712759975317.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/d/3dd4c248856639f84922abafba95d7b077e871ae.png)

The generated payload is as follows:

curl --request POST \

--url [https://api.hubapi.com/crm/v3/properties/contact](https://api.hubapi.com/crm/v3/properties/contact) \

--header ‘authorization: Bearer YOUR\_ACCESS\_TOKEN’ \

--header ‘content-type: application/json’ \

--data '{

“hidden”: false,

“displayOrder”: 2,

“description”: “Recuperar fecha y hora del showroom”,

“label”: “TestDateTime”,

“type”: “datetime”,

“groupName”: “contactinformation”,

“name”: “createdatetime”,

“fieldType”: “date”,

“formField”: true,

“referencedObjectType”: “string”,

“calculationFormula”: “string”,

“hasUniqueValue”: false,

“externalOptions”: true

}’

The error message we’re receiving is as follows:

HTTP 400

{

“status”: “error”,

“message”: “Property failed validation.”,

“correlationId”: “6db07f03-1611-4fbd-a15c-4b454fad7fd9”,

“category”: “VALIDATION\_ERROR”,

“subCategory”: “Properties.PROPERTY\_CREATE\_FAILED\_VALIDATION”

}  
I’ve carefully checked all the input parameters and everything seems to be in order. Can anyone help me understand why it’s not working or what I might be doing wrong?

---

<div class="post-metadata">

**Author:** ![Anze\_Koprivec](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anze_koprivec/32/96168_2.png) [@Anze\_Koprivec](https://community.hubspot.com/u/Anze_Koprivec)\
**Post date:** [April 11, 2024, 5:53am UTC](https://community.hubspot.com/t/error-with-datetime-property/104504/2 "2024-04-11T05:53:21Z")

</div>

Hey @Ael31 ,  
I’m guessing you’ve removed the token here from the payload even though you’ve mentioned its the outputed payload but first thing would be to just make sure you have that placed in there correctly, 2nd thing would be to check if the token/private app has the requiered permissions all though that doesn’t seem to be the outputted error.  
Can you try making an API call with just these parameters and removing the rest. Its possible you’re trying to set a property that shouldnt be set on datetime properties.

```lia-code-sample
groupName: "groupname"
label: "label"
name: "name"
type: datetime
fieldType: "date"
description: "description"
formField: true

```

---

<div class="post-metadata">

**Author:** ![HSchaefer9](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@HSchaefer9](https://community.hubspot.com/u/HSchaefer9)\
**Post date:** [April 19, 2024, 8:12am UTC](https://community.hubspot.com/t/error-with-datetime-property/104504/3 "2024-04-19T08:12:07Z")

</div>

Hello @Ael31  
I currently have the same problem, did you find a solution ?

---

<div class="post-metadata">

**Author:** ![AnzeKoprivec](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anzekoprivec/32/228791_2.png) [@AnzeKoprivec](https://community.hubspot.com/u/AnzeKoprivec)\
**Post date:** [April 19, 2024, 8:16am UTC](https://community.hubspot.com/t/error-with-datetime-property/104504/4 "2024-04-19T08:16:29Z")

</div>

Hi @HSchaefer9 , @Ael31  
I saw that this thread hasn’t gotten any further attention so I just wanted to quickly bring up that theres an app (made by us hah) that solves for this.  
You can use UI extensions in the record view to create datetime properties via a form without needing to mess with the API.  
If you’d like to take a look at app you can find it [here.](https://docs.scopiousdigital.com/docs/timemaster/intro)  
The UI extensions come unlocked at the proffesional tier of the app so if you’re looking to extend your use with datetime properties (creating, editing, workflows) then this is the app for it.  
If not and just want to stick with the API approach I’ve outlined a potential fix below, if that doesn’t work for you could you share what error your getting so I could help investigate further.  
Thanks,  
Anze
