4

According to the API, we delete a page by switching "archived" to true. My code is as follows:

//in async
await notion.pages.update({page_id: idVar, archived: true});

but no dice. I can set parameters and whatnot, but this particular property doesn't seem to work.

Edit: Thanks guys, code worked fine after updating the API!

  • That is how you archive (delete) a page. The block for that page cannot be deleted from the database, however, since [blocks cannot be deleted from the API](https://developers.notion.com/docs/working-with-page-content#:~:text=Deleting%20and%20updating%20blocks%20is%20not%20currently%20available). – Aryan Beezadhur Jul 28 '21 at 11:52
  • Have you checked the return value? See https://developers.notion.com/reference/patch-page – Reporter Jul 28 '21 at 11:56

1 Answers1

2

I had the same issue and I updated notion's js package. Seems like it's working properly with version 0.2.3 of @notionhq/client. When I was running version 0.2.0 it wouldn't work properly.

tt_c
  • 46
  • 1