Getting error when trying to modify page properties in Notion API

I’m working with the Notion API and trying to update properties on a page that exists in one of my databases. I followed the official documentation but I keep running into errors.

Here’s the code I’m using:

const { Client } = require('@notionhq/client');

const notionClient = new Client({ auth: process.env.NOTION_TOKEN });

async function updatePageProperty(pageId) {
  try {
    const response = await notionClient.pages.update({
      page_id: pageId,
      properties: {
        'Status': {
          select: {
            name: 'In Progress'
          }
        }
      }
    });
    console.log('Page updated successfully:', response);
  } catch (error) {
    console.error('Error updating page:', error);
  }
}

updatePageProperty('your-page-id-here');

When I run this code, I get an error but I can’t figure out what’s wrong. The page ID seems correct and my API token has the right permissions. Has anyone encountered similar issues when working with Notion’s page update functionality? Any suggestions on what might be causing this problem would be really helpful.

I’ve hit this exact issue before when starting with Notion’s API. You’re probably using the display name ‘Status’ instead of the actual property key. Notion properties have internal keys that don’t match what you see in the UI. First, check your database schema to grab the correct property key. Also verify your integration has edit permissions for that database - read access won’t cut it. Another gotcha: ‘In Progress’ might not exist as an option in your Status property. It has to be a valid option you’ve already created in the database. I’d start by logging the database properties to see the exact structure and what options are available.

check if your page is actually in a database or just standalone - i made this mistake once and wasted hours debugging lol. standalone pages don’t have database properties to update. also double check the page_id format, sometimes notion gives you URLs instead of the actual ID needed for API calls.

This error usually happens when your property setup doesn’t match what’s actually in your database. I ran into the same thing - turns out my ‘In Progress’ select option wasn’t configured properly in the database schema. Check that this exact option exists in your Status property settings in Notion. Also make sure your API token has access to the specific database containing the page, not just general workspace permissions. I’d suggest querying the database first to see what properties and options are actually available before trying to update anything.