Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
Creating a child database in a new page in Notion API

I'm able to create a new page using the Notion API, and as part of that page I want to create & include a database table. I'm able to create the page successfully, but when trying to create the database using the child_database block, I am getting a status 400 error. Sample code below. Any help appreciated.

let payload = {
    'parent': {'database_id': database_id_variable},
    'properties': {
        'Name': {
            'title': [
                {'text': {'content': 'My Grocery List Page'}}
            ]
        }
    },
    'children': [
        {
            'object': 'block',
            'type': 'child_database',
            'child_database': {
                'title': 'Grocery List',
                    'properties': {
                        'Grocery item': {
                            'type': 'title',
                            'title': [{ 'type': 'text', 'text': { 'content': 'Tomatoes' } }]
                        },
                    }
            }
        },
    ]
}

let response = await fetch('https://api.notion.com/v1/pages', {
    method: 'POST',
    body: JSON.stringify(payload),
    headers: {
        'Authorization' : 'Bearer secret_XXX',
        'Content-Type': 'application/json',
        'Notion-Version': '2021-08-16',
    },
});
console.log(await response.json());
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

While not a child database, I was able to resolve my issue by creating a simple table instead since Notion just announced the API would now support simple tables:

https://developers.notion.com/reference/block#table-blocks

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!