REST API and AJAX endpoints
The REST routes (namespace bfe/v1) and admin-ajax actions used by Front User Submit, with permissions.
The plugin’s own scripts use these endpoints. They are internal: the request format can change between versions. Use the hooks to change behaviour instead of calling them directly where you can.
All REST routes are in the namespace bfe/v1, so the full URL is https://example.com/wp-json/bfe/v1/<route>.
REST routes
| Route | Method | Permission | Purpose |
|---|---|---|---|
/form |
POST | edit_others_posts |
Form builder configuration (admin) |
/add-update-form |
POST | edit_others_posts |
Save a form from the builder (admin) |
/add_or_update_post |
POST | REST nonce + valid form_id; guests only if the form allows guest posting |
Create or update a post from a front-end form |
/post_thumb_uploading_image |
POST | same as above | Upload the featured image |
/upload_image |
POST | public | Upload an image from EditorJS |
/upload_file |
POST | public | Upload a file from the EditorJS Attaches block (max 5 MB) |
/process |
POST | public | Pro: upload a file of the File field |
/revert |
DELETE | public | Pro: remove a just-uploaded file of the File field |
/load/<id> |
GET | public | Pro: load a file of the File field when editing |
/ai_assist |
POST | REST nonce, published form with AI assistant: Enabled, assistant available for the visitor, daily limit | AI writing assistant |
/ai_test_connection |
POST | manage_options |
Test AI provider settings |
/ai_generate_form |
POST | edit_others_posts |
Pro: AI form generator |
Uploaded files are checked by their real content. HTML, SVG, XML and JavaScript are refused.
/add_or_update_post request
Sent as multipart/form-data by the front-end script. Main fields:
| Field | Description |
|---|---|
form_id |
Form ID |
post_id |
new or the post ID to update |
page_id |
Page that contains the form (saved as fus_post_created_from_page) |
x-wp-nonce |
wp_create_nonce('wp_rest') |
save_to_draft |
true when Save Draft was clicked |
post_title |
Title |
thumb_img_id / image |
Featured image ID or file |
editor_js[<name>], tinymce[<name>], md_editor[<name>], textarea[<name>] |
Editor fields |
tax[<taxonomy>][ids] |
Comma separated term IDs (or new term names) |
text_fields[<name>], number[<name>], date[<name>], select[<name>], checkbox[<name>], radio[<name>], hidden_fields[<name>], google_map[<name>], file_field[<name>] |
Custom fields |
Success response:
{ "success": true, "data": { "url": "…", "post_id": 123, "message": "New post created", "redirect_to": false } }
Errors use wp_send_json_error() with { "field": "…", "message": "…" }.
/ai_assist request
| Param | Description |
|---|---|
form_id |
Form ID |
ai_action |
write, improve, fix_grammar, shorten, expand (Pro: translate, tone, custom, plus actions added with bfe_ai_assistant_actions) |
format |
title, text, markdown or html |
content |
Current field text (max 15,000 characters) |
prompt |
User instructions (max 2,000 characters) |
context_title |
Post title (max 300 characters) |
Response: { "success": true, "data": { "text": "…" } }. Limit reached: HTTP 429 with code fus_ai_limit.
admin-ajax actions
| Action | Who | Purpose |
|---|---|---|
fus_login |
everyone | AJAX login ([fus_form_login]), nonce fus_ajax_nonce |
fus_register |
everyone | AJAX registration ([fus_form_register]), nonce fus_ajax_nonce |
fe_get_formBuilder_data |
logged in | Form builder data (admin) |
save_post_front_settings |
logged in | Save a form (admin) |
save_migration_settings |
logged in | Export / import form settings (Migration Settings) |