Error locating property when applying status filter in Notion database with JavaScript client

I’m using the Notion JavaScript client to fetch all tasks from my database that aren’t marked as completed. Unfortunately, I keep encountering an error that states ‘Could not find property with name or id: status’ when executing my code.

This is my current implementation:

(async () => {
  const databaseId = 'your-database-id';
  const response = await notion.databases.query({
    database_id: databaseId,
    filter: {
      property: 'status',
      status: {
        does_not_equal: 'Finished'
      }
    }
  });
  console.log(response);
})();

I believe the status property should be present in my database, so I’m uncertain why this error is occurring. What steps should I take to troubleshoot this problem?

make sure ur property name is exactly ‘status’, like not ‘Status’ since Notion is case-sensitive ya know? if it still throws an error, try the property ID from your db settings instead.

Check your integration permissions too. Sometimes the property exists but your Notion integration can’t read it - throws the same confusing error. Go to your database settings and make sure your integration has access to the properties you’re filtering on. I wasted hours debugging this once, turns out my bot token didn’t have the right permissions. Also, if you just created or renamed the status property, the API might need a few minutes to catch up.

Had this same problem last month. You’re probably using the display name instead of the actual property name from the database schema. Check your Notion database settings for the exact property name - sometimes there’s hidden spaces or it might be ‘Status’ with a capital S instead of lowercase. Also make sure the property type is set to ‘Status’ and not ‘Select’ or ‘Multi-select’. If it’s still not working, grab the property ID from the database properties panel and use that instead of the name. That’s what finally worked for me when the names didn’t match up.