Skip to main content

REST: Form templates

Overview​

GET /V1/webforms/form-templates lists the starter templates the store offers, the same ones the admin shows when you create a form (see Creating forms). Each item has:

Member Meaning
code Template code; send it as template_code to create a form
label Template name as the admin shows it
category Category code, for example support_feedback, orders_returns, products_quotes, b2b_wholesale, signups_bookings
description One-line description. label and description are translated into the language of the store view in the request path when the list is built

The list is returned whole, in the admin's order; total_count gives its length. Templates are declared in etc/webforms_templates.xml of WebForms and of any module that adds its own, so the list can differ from store to store: read it rather than hard-coding template codes.

Creating a form from a template​

POST /V1/webforms/forms/from-template with request_id, template_code, and optionally name and code. Without name the form takes the template's label, with a number added when a form of that name exists ("Contact Us (2)"); without code it has no code. The new form has the template's sections, fields, logic and email notifications, and is always created switched off; the notifications are switched off too. The answer is a form summary. This operation is listed with the form operations on REST: Forms.

Authentication​

OAuth 1.0a integration credentials, as described on REST API. Listing templates needs forms_view; creating a form from one needs forms_create.

Operations​

Method Path Operation ACL resource
GET /V1/webforms/form-templates FormReadInterface_getTemplates MageMe_WebForms::api_v1_forms_view

Errors​

Code HTTP When
NOT_FOUND 404 from-template: an unknown template code (Unknown template "…".)
VALIDATION_FAILED 400 from-template: the form code is used by another form
LICENSE_NOT_COVERED 403 from-template: the store's WebForms license does not cover this version
REQUEST_ID_REUSED 409 from-template: the request_id was already used with a different request

The refusals every route shares are listed on REST API.

Examples​

List the templates:

curl https://yourdomain.com/rest/all/V1/webforms/form-templates \
-H "Authorization: <signed-header>"
{
"items": [
{"code": "contact_us", "label": "Contact Us", "category": "support_feedback", "description": "General enquiries, routed to the right department."},
{"code": "warranty_claim", "label": "Warranty Claim", "category": "support_feedback", "description": "A warranty claim with photos, serial number and proof of purchase."},
{"code": "request_quote", "label": "Request a Quote", "category": "products_quotes", "description": "A full quote request: item grid, drawings, delivery and timing."},
"…"
],
"search_criteria": null,
"total_count": 27
}

Create a form from the Contact Us template:

curl -X POST https://yourdomain.com/rest/all/V1/webforms/forms/from-template \
-H "Authorization: <signed-header>" -H "Content-Type: application/json" \
-d '{"request": {"request_id": "erp-template-0001", "template_code": "contact_us", "name": "Showroom Enquiry", "code": "showroom_enquiry"}}'
{"id": 995589, "code": "showroom_enquiry", "name": "Showroom Enquiry", "revision": 28, "is_active": false, "has_draft": false, "draft_started_by_type": "", "draft_started_by_name": "", "updated_at": "2026-10-05T20:42:49Z", "warnings": []}

An unknown template code:

{"message": "Unknown template \"showroom_visit\".", "parameters": {"code": "NOT_FOUND", "details_schema_version": "1", "details_json": "{}"}}

Applies to WebForms 4Last reviewed November 24, 2026