Comment Post Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 06, 2022 09:14 AM
Trying to make a post request to Notion to create a new page. Receiving an Error 400 Bad Request and can’t find the issue.
Here’s the documentation - Create a page
and script below
let payload = {
'parent': {
"type": "page_id",
"page_id": "my page id"
},
'properties': {
"Name": {
"type": "title",
"title": [{ "type": "text", "text": { "content": "My Page Title" } }]
}
}
};
let response = await remoteFetchAsync(postUrl, {
method: 'POST',
body: JSON.stringify(payload),
headers: {
'Notion-Version': '2022-06-28',
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`,
},
});
output.text('**POST RESPONSE**' + ' - ' + response.status)
Solved! Go to Solution.
10 Replies 10

Comment Post Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 09, 2022 06:45 PM
Thanks for the update. I guess I’ve just got my own issues with Notion’s wording. :winking_face:
As for the issue you encountered, there might be some deeper reason why a database ID worked where a page ID didn’t. Without knowing a lot more about your specific setup, though, it’s tough to say why.

- « Previous
-
- 1
- 2
- Next »