storefronts / Page templates
POST
/api/page-templates/{id}/variablesCreate 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
| Name | Required | Type | Details |
|---|---|---|---|
id | Yes | Not specified | Description: Identifier for the resource. |
Query Parameters
Request Body
Schema: CreateVariableBody
| Field | Required | Type | Details |
|---|---|---|---|
key | Yes | string | Description: Text value. |
label | Yes | string | Description: Human-readable label. |
type | No | boolean | Description: Boolean flag. |
default_value | No | string | Description: Text value. |
options | No | array<string> | Description: Options payload for this resource. Items: string |
sort_order | No | integer | 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_failedAvailability
- Available in
- v0.1.0
- Available since
- v0.1.0
- Implementation
- Available
- Deprecation
- Not specified
- Rate limits
- Not specified

