Validation error when adding new entry using Notion API

I’m attempting to insert a new item into my Notion database but encounter a validation error instead. My entry includes two distinct fields - one for Owner that allows a dropdown selection of workspace members, and another for Priority with values ranging from 1 to 4.

The error message I’ve received states:

APIResponseError: body failed validation. Fix one:
body.properties.Priority.type should be not present, instead was “Select”.
body.properties.Priority.select should be not present, instead was {“value”:“1”}.
body.properties.Priority.name should be defined, instead was undefined.
body.properties.Priority.start should be defined, instead was undefined.

Here is the code I am using:

const properties = {
    title: [{
        text: {
            content: "Test"
        }
    }],
    Priority: {
        id: "9~q3",
        type: "Select",
        select: {
            value: "1"
        }
    },
    Owner: {
        people: [{
            email: "[email protected]"
        }]
    }
};

What might be the issue with my code’s structure?

You’re sending database schema config instead of just the values. Drop the id and type fields completely - those are for schema definitions, not creating pages. For Priority, use name not value since Notion wants the actual display name of your select option. Also make sure “1” actually exists in your Priority dropdown or it’ll fail without telling you why. I ran into this same issue with my first Notion integration - the docs don’t explain the difference between schema stuff and data stuff very well. Your Priority should look like Priority: { select: { name: "1" } } with no extra fields.

yeah, notion’s api is tricky here. your sending schema info instead of actual data. drop the id and type parts completely, then change value to name in your select object. also double-check that your priority option “1” exists in your database dropdown - otherwise it’ll just fail.

You’re mixing database schema definitions with page creation properties. When creating a new page, drop the id and type fields - those are only for defining the database structure itself. For the Priority field, use select: { name: "1" } instead of select: { value: "1" }. The API expects the option name, not a value property. Here’s your corrected properties object:

const properties = {
    title: [{
        text: {
            content: "Test"
        }
    }],
    Priority: {
        select: {
            name: "1"
        }
    },
    Owner: {
        people: [{
            email: "[email protected]"
        }]
    }
};

I hit this exact same issue when I started with the Notion API. The docs are confusing because they mix database schema and page creation examples together.