Updating pages through code

Hello everyone,

Is it possible to update page contents including modules’ data entirely through code? I know I can add default modules using `dnd_module` HUBL code in page templates, but it seems when I update the template modules in code with new or updated module data, the existing pages don’t reflect the changes (which is logical - template should be used just to create the initial version). I would still like to edit the pages’ contents through code, so that I can have it stored in a separate versioning system. Is this possible?

I’m currently working on the free Hubspot version and am looking to buy starter version.

Hi Amohar,

You can update pages via code by using the API: https://legacydocs.hubspot.com/docs/methods/pages/put_pages_page_id

Is that what you mean?

Hello Twan, yeah, I need to take a deeper look but this sounds promising. I see I can set up all the widgets (modules) and their field values for a page, which is what I’m after. Thanks!