4

I am trying to update the status of a page using the api. I am using the JS-sdk built by notion.

To update the status you have to update the properties-object. I cannot get it to work as expected, it always throws an error.

I have tried to use the name of the property ('Status') and I have tried to use the id of the property but the same error appears.

const response = await notion.pages.update({
    page_id: 'abc123',
    properties: {
        [statusProp.id]: {
            status: {
                title: 'Done'
            }
        }
    }
})

The error I receive is the following:

{
object: 'error',
status: 400,
code: 'validation_error',
message:
    'body failed validation. Fix one:\nbody.properties.bSYl.title should be defined, instead was `undefined`.\nbody.properties.bSYl.rich_text should be defined, instead was `undefined`.\r\nbody.properties.bSYl.number should be defined, instead was `undefined`.\nbody.properties.bSYl.url should be defined, instead was `undefined`.\nbody.properties.bSYl.select should be defined, instead was `undefined`.\nbody.properties.bSYl.multi_select should be defined, instead was `undefined`.\nbody.properties.bSYl.people should be defined, instead was `undefined`.\nbody.properties.bSYl.email should be defined, instead was `undefined`.\nbody.properties.bSYl.phone_number should be defined, instead was `undefined`.\nbody.properties.bSYl.date should be defined, instead was `undefined`.\nbody.properties.bSYl.checkbox should be defined, instead was `undefined`.\nbody.properties.bSYl.relation should be defined, instead was `undefined`.\nbody.properties.bSYl.files should be defined, instead was `undefined`.\nbody.properties.bSYl.id should be defined, instead was `undefined`.\nbody.properties.bSYl.name should be defined, instead was `undefined`.\nbody.properties.bSYl.start should be defined, instead was `undefined`.'

}

Their documentation says: Not currently editable..
Although I am unsure whether they mean only the property 'color' of the status-property or if they mean the status-property.
Image of their doc.

vikiorf
  • 41
  • 2
  • 5

1 Answers1

1

Try changing 'title' to 'name'.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
daxro
  • 193
  • 13