DocsAccounts & records · FQL
On this page

Create and edit records

Save, update and delete posts from your theme.

Before you begin: Manage account settings.

Create a Post

Use createPost for new posts.

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Options:

OptionRequiredPurpose
typeyesFRL post type, such as products.
postyesPost data to validate and store.

If post contains File or Blob values at any depth, Frontbacked uploads each file with a resumable flow and saves the post as JSON with file metadata. File bytes are not included in the post JSON body.

Track upload progress with onUploadProgress:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Use the Upload File guide for nested files, progress shape, and Frontbacked.uploads.resume().

Post IDs are generated by Frontbacked. Theme code cannot supply a custom ID when creating a post. If you need to copy the generated post ID into a normal field on the same post, set that field to the exact string "$id" on create; Frontbacked replaces it with the generated ID before storing the post.

Frontbacked.uploadPost(...) remains available as a compatibility alias for Frontbacked.createPost(...).

Update a Post

Use updatePost for existing posts.

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Options:

OptionRequiredPurpose
idyesExisting post id.
typenoPost type when Frontbacked needs it.
postyesPatch or replacement data.
mergenoDefaults to true. When true, Frontbacked can merge the submitted fields with the stored post before validation.

Frontbacked still runs FRL on the final post. Use strict schemas, immutable, and editableIf in FRL to protect fields that must not change through merged updates.

Delete a Post

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Frontbacked runs the post type's allow delete rule before deleting.

Continue with Submit a record form.