On this page
Workflow helpers reference
Find verification, confirmation, job and file helpers.
Before you begin: Payment actions reference.
Rate limits
Declare reusable rateLimit policies, then attach them with rateLimit create, edit policy_name; inside a post or rateLimit policy_name; inside an endpoint. Comments immediately above a policy become its admin description. See Rate Limits and Abuse Protection for syntax, scopes, admin adjustments, and safe retry handling.
Email verification codes
Use otp.send, otp.resend, and otp.verify in FRL endpoints, then pass the returned challenge to Frontbacked.otp.show(challenge, { verify, resend }) for an accessible code-entry dialog. See Email verification codes for the complete flow.
Paired confirmations
Use confirmation.create({ userId, key?, expiresIn?, expiresAt?, printLabel? }) for private code-view pages and shareable confirmation links. The returned pair includes a readable codeName for matching both sides. Respond with confirmation completed and read $confirmation to update your records. See Paired confirmations for access rules, printable QR cards, and cancellation.
Background jobs
Declare job name { ... }, start it with job.start(name, input) in an endpoint, and follow it by ID with Frontbacked.jobs or $jobs bindings. Use for_parallel (..., key="items", concurrency=8) for bounded parallel work and retryable (key) { ... } for independently retryable blocks. See Background Jobs and Parallel Work.
Remove Post Files
Use post.removeFiles(postId, files) in an endpoint, hook or automation to remove saved attachments by permanent identity:
Rule input (JSON)
Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.
Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.
files accepts 1–100 permanent file-ID strings or saved file objects. The action removes matching files throughout the target post, preserves unrelated fields, and validates the resulting post against its schema. Missing attachments and invalid removals fail without partially saving the related writes. Like post.edit, this is a trusted related-write operation: enforce the caller's permissions and target access in your endpoint. Normal frontend edits use Frontbacked.removePostFiles() and the post's allow edit rule.
File objects retain their permanent id, and video files retain mediaId. Copy complete file metadata when saving order snapshots or other shared references. After a successful change, Frontbacked cleans up managed files with no remaining references, including generated image and video files. Temporary deletion failures retry automatically; there is no URL-based legacy cleanup and no method that deletes arbitrary storage keys.
Find a user by ID or email
Use users.findOne({ id: "user-id" }), users.findOne({ email: "person@example.com" }), or users.findOne({ username: "ada" }) inside a guarded FRL endpoint to resolve an existing user on your site. Email and username input ignores case and surrounding whitespace. The result is { id, name, email }, or null when no user matches. Passwords, PINs and private profile values are never included. For invitations, save the returned id so access remains attached to the same account if its username changes. Return only the fields the caller needs.
For example, let an administrator issue a membership or card using an email address, then save the returned user ID as a user reference. Read the person's current name and email through that reference instead of copying those values into each record. Always check the action's admin permission before looking up another user's identity.
Additional helper reference
| Helper | Use |
|---|---|
money.getUnits(value, currency?) | Read the exact fixed-scale integer units as text. Prefer money helpers for arithmetic; do not convert large unit values to a JavaScript number. |