Skip to content
storefronts / Page templates
POST/api/page-templates/{id}/variables

Create Page Template Variable

Adds a variable to a page template owned by the authenticated user.

GETPOST

Authentication

Requirement
Required
Credential type
session
Scopes
Not specified

Permissions

  • Requires an authenticated storefront session.

Headers

Path Parameters

NameRequiredTypeDetails
idYesNot specified
Description: Identifier for the resource.

Query Parameters

Request Body

Schema: CreateVariableBody

FieldRequiredTypeDetails
keyYesstring
Description: Text value.
labelYesstring
Description: Human-readable label.
typeNoboolean
Description: Boolean flag.
default_valueNostring
Description: Text value.
optionsNoarray<string>
Description: Options payload for this resource.
Items: string
sort_orderNointeger
Description: Integer value.

Response Body

Example 200 response

json
{
  "id": 1,
  "template_id": 1,
  "key": "string",
  "label": "Example",
  "required": true,
  "default_value": "string",
  "options": [],
  "sort_order": 1,
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z"
}

Errors

400 template_variable_key_required400 template_variable_label_required404 page_template_not_found500 page_template_variable_create_failed

Availability

Available in
v0.1.0
Available since
v0.1.0
Implementation
Available
Deprecation
Not specified
Rate limits
Not specified