I’m working with the Notion API and trying to filter database entries using the unique_id property type. I know that Notion now supports unique_id properties in databases, but I can’t figure out the correct syntax for filtering by this field.
This approach fails and returns an error: [400] Could not find property with name or id: RecordID. I’ve double-checked and “RecordID” is definitely the correct name of my unique_id property in the database.
What’s the proper way to structure a filter query for unique_id properties? Is there a specific filter type I should be using instead of treating it as a number field?
Same issue here! Unique_id properties are weird - they act differently from regular number fields even though they store numbers. Your filter looks right, but try wrapping the number as a string first. I’ve seen that fix property recognition issues. Also double-check that your database property is actually set to unique_id type, not just a number field with validation. Made that mistake once and wasted hours debugging. The “property not found” error sounds more like a reference problem than filter syntax. Can you query the database without filters first? Just to make sure your API connection and property access work?
hey, just a heads up - def check the property ID from your db schema! using the name can mess things up, esp with unique_id fields. permissions can also lead to that 400 error, so make sure your integration can access that prop!
Had this exact problem last month! Your filter syntax looks fine - the issue is probably that you’re using the property name instead of the property ID in your API call. Notion’s API gets picky about property names, especially with unique_id fields. Here’s what worked for me: grab the database schema first using the retrieve database endpoint, then find your “RecordID” property in the response. It’ll have an internal ID that looks like “%3AkL%40” or some other encoded string. Use that property ID instead of “RecordID” in your filter. Your number filter structure is spot on - unique_id properties work as numbers for filtering. I’ve used equals, greater_than, and less_than operators with unique_id fields once I made the switch. Also check that your integration has read access to that property - permissions issues can throw similar errors.