5
{
    "object": "error",
    "status": 400,
    "code": "validation_error",
    "message": "{Bal has an invalid date value."
}

I tried many types and always failed.Why not just write it in the document.

2021/05/14
2021/14/05
2021/5/14
2021/05/14 00:00:00
ser163
  • 61
  • 1
  • 3

3 Answers3

3

Notion API is using the ISO 8601 standard for date. https://en.wikipedia.org/wiki/ISO_8601

3

You can see the documentation here

https://developers.notion.com/reference/property-value-object

The example itself is an object property.

as a request body example

...
{
    "Created Date": {
         "date": {
            "start": "2022-02-14",
            "end": "2022-02-18"
         }
    }
}
...

as a request body for notion client JS SDK

...
{
    'Created Date': {
         date: {
            start: 2022-02-14,
            end: 2022-02-18,
         },
    },
}
...

Date format can be 'yyyy-mm-dd' or 'yyyy-mm-dd hh:mm:ss' or using ISO8601 format

Hopefully can answer your question.

1
            "date": {
                "start": "2021-05-17T12:00:00Z",
                "end": "2021-05-17T12:00:00Z"
            }

"end" value If null, this property's date value is not a range. date type link

ser163
  • 61
  • 1
  • 3