# Issue passing data with the HTML API

**URL:** <https://forum.builder.io/t/issue-passing-data-with-the-html-api/16050>\
**Category:** Bugs\
**Tags:** api\
**Created:** [December 28, 2025, 4:14am UTC](https://forum.builder.io/t/issue-passing-data-with-the-html-api/16050 "2025-12-28T04:14:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyu](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@cyu](https://forum.builder.io/u/cyu)\
**Post date:** [December 28, 2025, 4:14am UTC](https://forum.builder.io/t/issue-passing-data-with-the-html-api/16050/1 "2025-12-28T04:14:36Z")

</div>

I’m following this post on passing values through the HTML API:

> [@Passing dynamic data when rendering Builder content with the HTML API](https://forum.builder.io/t/passing-dynamic-data-when-rendering-builder-content-with-the-html-api/540):
>
> You can [bind](https://www.builder.io/c/docs/guides/state-and-actions) values to specific state keys, which will be available to blocks’ bindings and the Javascript code you add to your content. For example, if you add a text block, and [bind](https://www.builder.io/c/docs/guides/state-and-actions) its content to a state variable, like state.myCustomTextValue, the HTML API lets you alter the value of this parameter using query string parameters, like: curl --request GET \ --url 'https://builder.io/api/v1/html/page?=&apiKey=$API\_KEY&url=%2Fdemo-page&data.textFromState=a%20string' page in the URL path is …

However, when I do this, the values don’t properly render. The correct values do render for a second, but then is replaced with undefined.

Seeing that this post was created back in March of 2021, is this feature still supported?

**Code stack you are integrating Builder with**  
REST API

**Reproducible code example**  
Example URL:

[https://cdn.builder.io/api/v3/html/homepage?apiKey=df8e07d26b2f44ee9ee861afdbfa10c2&data.availRewards=a&data.pendRewards=b&url=%2Fhomepage](https://cdn.builder.io/api/v3/html/homepage?apiKey=df8e07d26b2f44ee9ee861afdbfa10c2&data.availRewards=a&data.pendRewards=b&url=%2Fhomepage)

Looking at the resulting HTML, it looks like the data value is passed to the options attribute as JSON string, and in the console the JSON payload has the `data` property converting the JSON string into an object instead of parsed as JSON:

```auto
{
    "0": "{",
    "1": "\"",
    "2": "a",
    "3": "v",
    "4": "a",
    "5": "i",
    "6": "l",
    "7": "R",
    "8": "e",
    "9": "w",
    "10": "a",
    "11": "r",
    "12": "d",
    "13": "s",
    "14": "\"",
    "15": ":",
    "16": "\"",
    "17": "a",
    "18": "\"",
    "19": ",",
    "20": "\"",
    "21": "p",
    "22": "e",
    "23": "n",
    "24": "d",
    "25": "R",
    "26": "e",
    "27": "w",
    "28": "a",
    "29": "r",
    "30": "d",
    "31": "s",
    "32": "\"",
    "33": ":",
    "34": "\"",
    "35": "b",
    "36": "\"",
    "37": "}"
}

```

---

<div class="post-metadata">

**Author:** ![Maureen](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Maureen](https://forum.builder.io/u/Maureen)\
**Post date:** [March 5, 2026, 3:30pm UTC](https://forum.builder.io/t/issue-passing-data-with-the-html-api/16050/2 "2026-03-05T15:30:25Z")

</div>

Hi cyu,

It looks like the `data` parameter is being serialized as a string and then treated like an object (character by character) instead of being properly parsed as JSON. That’s usually why you briefly see the correct value before it becomes `undefined` , the hydration process likely overwrites it when it can’t parse the structure correctly.

You might want to double-check how the `data` object is being encoded in the query string. In some cases, explicitly JSON-stringifying the object and ensuring proper URL encoding before passing it can prevent this issue. Also, verify whether the latest HTML API version still expects nested `data.*` parameters or a full `data` JSON payload.

I ran into a similar serialization issue before and documented a workaround on **[this website](https://telenrquiztoday.pk/)**, where parsing the payload manually before hydration resolved the `undefined` override.

It would also be good to confirm whether Builder has updated how state bindings work since 2021, there may have been changes to how the HTML API handles dynamic data injection.

Hope this helps point you in the right direction!
