Description:
When attempting to apply a filter for the “tags” field (a relation property) in a Notion database using the API, the filter is not recognized and throws an UnrecognizedKwargsError. This behavior is inconsistent with the documented API, which works correctly when called using curl.
Steps to Reproduce:
-
Create a Notion database with a relation property (e.g., “tags”).
-
Attempt to apply the following filter using the API:
{
“property”: “tags”,
“relation”: {
“is_empty”: true
}
}
Error received:
{
“object”: “error”,
“status”: 400,
“code”: “UnrecognizedKwargsError”,
“message”: “filter”
}
using curl, it works correctly:
curl -X POST htt ps://api.notion.com/v1/databases/YOUR_DATABASE_ID/query
-H “Authorization: Bearer YOUR_TOKEN”
-H “Notion-Version: 2022-06-28”
-H “Content-Type: application/json”
-d ‘{
“filter”: {
“property”: “tags”,
“relation”: {
“is_empty”: true
}
}
}’