Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

286
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda