How can we get draft pages from in next js app

How we can get unpublished pages from ?
is there any Api to get all the pages published and unpublished (draft) pages?

Hi @olivela,

Thanks for reaching out.

Yes, you can get the latest draft from the API, it requires knowing the content ID, so you’d make an extra API Call to get the latest draft, something like:

import { builder } from "" // or ``

export async function resolveBuilderContent(modelName: string, userAttributes: Record<string, string | number>, loadLatestDraft = false) {
  let page = await builder.get(modelName, { userAttributes }).toPromise();
  if (page && loadLatestDraft) {
      page = await fetch(`${modelName}/${}?apiKey=${apiKey}&preview=true&noCache=true&cachebust=true`).then(res => res.json())

  return page;

To know more you can visit our forum post API parameter to include not yet live content.

Let us know if you have any further questions. Thank you!

always getting undefined response for draft pages .
is there any other way to get Draft pages ?

Hi @olivela,

You can also fetch the draft pages with the builder.get() method passing the option includeUnpublished=true. You can find more help at Builder Content API.

Let us know if you have any further questions. Thank you!