I’m trying to remove the value from a date property using the Notion API but can’t figure out the right approach.
When I send a PATCH request to modify a page, I keep getting validation errors because the API doesn’t accept my attempts to clear the date field. I’ve tested several different values like empty strings, null, undefined, true, and TRUE but none of them work.
I don’t want to just set it to some random past date because I need the field to be actually empty for other operations I’m planning to do later.
Here’s what I’m trying:
curl -X PATCH "https://api.notion.com/v1/pages/MY_PAGE_ID" \
-H 'Content-Type: application/json' \
-H 'Notion-Version: 2021-08-16' \
-H "Authorization: Bearer $TOKEN" \
--data '{
"properties": {
"Stage": {
"select": {
"name": "Completed"
}
},
"Due Date": {
"date": {
"start": ""
}
}
}
}'
This gives me an error:
{"object":"error","status":400,"code":"validation_error","message":"body failed validation: body.properties.Due Date.date.start should be a valid ISO 8601 date string, instead was `\"\"`."}
In the Notion UI there’s a clear button that removes the date completely. How can I achieve the same thing through the API?
You need to pass null as the entire date object, not just the start property. Don’t try clearing the start field within the date object - set the whole date property to null instead. Here’s what works:
{
"properties": {
"Stage": {
"select": {
"name": "Completed"
}
},
"Due Date": {
"date": null
}
}
}
Hit this exact same issue building a task management integration last year. The API docs aren’t super clear on this, but you’re basically telling Notion to remove the entire date value rather than modifying its parts. Works for all property types that support null values in Notion.
Had the same frustration with a project management bot. Here’s the thing - Notion treats empty date fields differently than fields with empty values. When you clear the start property with an empty string, you’re basically telling the API there’s still a date object but with bad data. The fix is what charlottew said - set the entire date property to null instead of trying to modify what’s inside it. This tells Notion to completely remove the date value, which is like clicking the clear button in the UI. I spent hours on this because I kept thinking I needed to keep the date object structure and just clear what’s inside. Once I realized I could just nuke the whole thing with null, it worked perfectly.
yeah, this got me too on my project tracker. you need to set the entire date property to null like charlotte said - don’t try clearing individual fields inside it. just delete the whole value instead of editing pieces. fixed it right away once i did that.