2

I haven't seen this question asked yet - I want to "Clear" a date (see screenshot for a visual representation).

Every time I make a PATCH request to update a Page object, I receive an error because date isn't formatted properly. From what I can tell, there isn't a way to set an empty date via the API. Does anyone have any suggestions or know more?

  • I've tried empty string, null, undefined, true, and TRUE, all returned errors.
  • I don't really want to set the date to a date in the past, as my goal is to take more actions on the card, that require the date to be empty, before later deleting the page.
curl -sL -X PATCH "https://api.notion.com/v1/pages/PAGE_ID" -H 'Content-Type: application/json' -H 'Notion-Version: 2021-08-16' -H "Authorization: Bearer ${NOTION_API_KEY}"   --data '{
    "properties": {
        "Status": {
                "select": {
                        "name": "Journey Finished"
                }
        },
        "Next Checkin": {
                "date": {
                        "start": ""
                }
        }
    }
}'
{"object":"error","status":400,"code":"validation_error","message":"body failed validation: body.properties.Next Checkin.date.start should be a valid ISO 8601 date string, instead was `\"\"`."}%
  • Screenshot where the "Clear" button is at on Date property in GUI

date property clear notion

dasbuilder
  • 43
  • 7

1 Answers1

1

Set the date value to null

"Next Checkin": {
            "date": null
        }
adlopez15
  • 3,449
  • 2
  • 14
  • 19