Managing Draft and Published States via Write API

Hi,

I’m working with the Builder.io Write API and I have a question regarding handling draft and published states.

From what I understand, when using the Write API to update content, it directly overwrites the existing entry, meaning there’s no separation between a draft version and a published version.
Is there currently any supported way (or a recommended workaround) to maintain both a draft and a published version of a page or model entry via the API?

Thanks in advance!

Hello @mateuszad,

When using the Builder.io Write API, any updates to content directly overwrite the existing entry. This means there’s no built-in mechanism for maintaining separate draft and published versions of a content entry via the Write API.

You can include a field in your content model to track the status of each entry, such as published , draft , or archived . However, changing the state of content from published to draft would remove it from the live site because it effectively unpublishes the content. The content will no longer be included in published outputs until it’s set back to published again.

This behavior is expected since the draft status typically indicates content that is not yet ready for display to end users. The recommended approach, if you need to maintain live published content while working on a new draft, would be to create a mechanism for duplicating entries or maintaining separate entries for drafts and published versions. This way, the published content remains unaffected while the draft is being edited.

If this is a feature you’d like to see, you can submit a request on our ideas portal.

Hope this helps! Feel free to let us know if you have any further questions!

Best regards,