Content api not outputting data blocks for some pages

We have several pages on our blog section, some of them seem to have a glitch where data is coming empty: data: {},

request are made on getStaticProps to:

builder.get('pible-page-article', { userAttributes: { urlPath }, includeUnpublished: true }).toPromise())

full response below:

{
  createdDate: 1760603983619,
  id: 'ae7fa79c1125435ab7b13c76330e3bc0',
  name: '',
  modelId: '6e78491bfb584fd8a0d1d8da08d07d47',
  published: 'draft',
  meta: {
    breakpoints: { small: 640, medium: 1200 },
    kind: 'page',
    lastPreviewUrl: 'https://develop.pie.tax_?builder.space=c62b6400b6304daabf5f25c1107e9986&builder.user.permissions=read%2Ccreate%2Cpublish%2CeditCode%2CeditDesigns%2Cadmin%2CeditLayouts%2CeditLayers%2CeditContentPriority%2CeditFolders%2CeditProjects%2CmodifyMcpServers%2CmodifyProjectSettings%2CconnectCodeRepository%2CcreateProjects%2CindexDesignSystems&builder.user.role.name=Admin&builder.user.role.id=admin&builder.cachebust=true&builder.preview=pible-page-article&builder.noCache=true&builder.allowTextEdit=true&__builder_editing__=true&builder.overrides.pible-page-article=ae7fa79c1125435ab7b13c76330e3bc0&builder.overrides.ae7fa79c1125435ab7b13c76330e3bc0=ae7fa79c1125435ab7b13c76330e3bc0&builder.options.locale=Default'
  },
  query: [],
  data: {},
  variations: {},
  lastUpdated: 1760604055134,
  previewUrl: 'https://develop.pie.tax_',
  testRatio: 1,
  createdBy: '7MNqcjAd4cPSDjwFvkEjU1qlpWN2',
  lastUpdatedBy: '7MNqcjAd4cPSDjwFvkEjU1qlpWN2',
  folders: [],
  rev: 'rd3lwtbx6gq'
}

If you look at the visual editor, there is plenty of content.

This happens in some pages only.

Builder content link

Builder public api key
c62b6400b6304daabf5f25c1107e9986

Code stack you are integrating Builder with
Nextjs

Hello @chris999,

We looked into your query and found that the content not returning the blocks with ID ae7fa79c1125435ab7b13c76330e3bc0 does not currently have any blocks. You can view the content here:

The other content seems to return data.blocks correctly. Here’s an example:
https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&userAttributes.urlPath=%2Ftax-pible%2Fhow-long-should-i-keep-records-for-self-assessment-uk&limit=1&includeUnpublished=true

We hope this clarifies the issue.

Thanks,

Hi @manish-sharma, the problem is that making a request to this, seems to return the wrong content, including id, any idea why?

This page has content, but it has other id indeed, depite the page url, which is assign to the below:

urlPath = “/tax-pible/how-long-should-i-keep-records-for-self-assessment-uk“
builder.get(‘pible-page-article’, { userAttributes: { urlPath }, includeUnpublished: true }).toPromise())

/tax-pible/how-long-should-i-keep-records-for-self-assessment-uk ==============
{
createdDate: 1760603983619,
id: ‘ae7fa79c1125435ab7b13c76330e3bc0’,
name: ‘’,
modelId: ‘6e78491bfb584fd8a0d1d8da08d07d47’,
published: ‘draft’,
meta: {
breakpoints: { small: 640, medium: 1200 },
kind: ‘page’,
lastPreviewUrl: ‘https://develop.pie.tax_?builder.space=c62b6400b6304daabf5f25c1107e9986&builder.user.permissions=read%2Ccreate%2Cpublish%2CeditCode%2CeditDesigns%2Cadmin%2CeditLayouts%2CeditLayers%2CeditContentPriority%2CeditFolders%2CeditProjects%2CmodifyMcpServers%2CmodifyProjectSettings%2CconnectCodeRepository%2CcreateProjects%2CindexDesignSystems&builder.user.role.name=Admin&builder.user.role.id=admin&builder.cachebust=true&builder.preview=pible-page-article&builder.noCache=true&builder.allowTextEdit=true&builder_editing=true&builder.overrides.pible-page-article=ae7fa79c1125435ab7b13c76330e3bc0&builder.overrides.ae7fa79c1125435ab7b13c76330e3bc0=ae7fa79c1125435ab7b13c76330e3bc0&builder.options.locale=Default’
},
query: ,
data: {},
variations: {},
lastUpdated: 1760604055134,
previewUrl: ‘https://develop.pie.tax_’,
testRatio: 1,
createdBy: ‘7MNqcjAd4cPSDjwFvkEjU1qlpWN2’,
lastUpdatedBy: ‘7MNqcjAd4cPSDjwFvkEjU1qlpWN2’,
folders: ,
rev: ‘p9jbrdksn9’
}

Hello @chris999,

The issue appears to be caused by the following content, which does not have any targeting set:

As a result, queries using userAttributes.urlPath are failing:

To resolve this, you can either:

  1. Delete the content

  1. Use noTargeting=true in your query:

https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&userAttributes.urlPath=%2Ftax-pible%2Fhow-long-should-i-keep-records-for-self-assessment-uk&limit=1&includeUnpublished=true&noTargeting=true

Either of these steps should fix the query failure.

Thanks,

@manish-sharma the issue stils, look at your option 2 result, it’s not the correct page content:

page url:
/tax-pible/how-long-should-i-keep-records-for-self-assessment-uk
id: fbde029c22ee42c185eecb0354b91387

when querying it, look at the results, it has content from another page, not from the query url:
/tax-pible/understanding-seis-tax-relief-a-guide-for-startups-and-investors
id: e92e5f3b5557419592ade3595e249f9e

looking closer to the result, I see this:

results": [{
“createdDate”: 1760707984918,
“id”: “e92e5f3b5557419592ade3595e249f9e”,
“name”: “Understanding SEIS Tax Relief: A Guide for Startups and Investors”,
...
data: {
"url": "/tax-pible/understanding-seis-tax-relief-a-guide-for-startups-and-investors",
}
...

Above it the wrong url content, but it has the correct query url in the state prop :confused:

“state”: {
“deviceSize”: “large”,
“location”: {
“pathname”: “/tax-pible/how-long-should-i-keep-records-for-self-assessment-uk”,
“path”: [
“tax-pible”,
“how-long-should-i-keep-records-for-self-assessment-uk”
],
“query”...


https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&userAttributes.urlPath=%2Ftax-pible%2Fhow-long-should-i-keep-records-for-self-assessment-uk&limit=1&includeUnpublished=true&noTargeting=true

Hello @chris999,

I see you have deleted that content which was causing the issue and API calls seems to return correct response now.

Let us know if you have any further questions.

Thanks,

@manish-sharma It’s not returning the correct content. Look at the response.

the http request is to this URL PATH:
/tax-pible/how-long-should-i-keep-records-for-self-assessment-uk

but the response is the content of another page URL:
/tax-pible/understanding-seis-tax-relief-a-guide-for-startups-and-investors

Hello @chris999,

Please remove noTargeting=true param from the content api call.

https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&userAttributes.urlPath=%2Ftax-pible%2Fhow-long-should-i-keep-records-for-self-assessment-uk&limit=1&includeUnpublished=true

1 Like

@manish-sharma
we seem to have a new issue, any request I make, to any url, returns the same (wrong) content
All our pages are broken, any idea why?

all requests to a pible-page-article results in:
“results”:[{“id”:“865a23cd08b64b5ea3dc8eccc166a4a1”,“name”:"Navigating Seed Funding Tax for UK

https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&userAttributes.urlPath=%2Ftax-pible%2Fhow-long-should-i-keep-records-for-self-assessment-uk&limit=1&includeUnpublished=true

Hello @chris999,

It appears that the content titled “Navigating Seed Funding Tax for UK Startups” was created without any targeting, which seems to be causing the issue.

Could you please confirm if this content was created via the API?

Best regards,

1 Like

Hello @chris999,

The issue was caused by an incorrect page URL. I’ve gone ahead and updated the page URL for “Navigating Seed Funding Tax for UK Startups”, and your API calls should now work as expected.

For future reference, you can find more details on setting the page URL correctly using the Write API here:

Best regards,