Skip to content
BolderBolder Developers
Esc
↑↓navigate↵open⌘Jpreview

Restore a template version

Puts the version’s body back into the template. The current body is saved as a version first (labelled “before restore to …”), so a restore can itself be undone.

POST/themes/{theme_id}/templates/{template_id}/versions/{id}/restore
Authorization
AuthorizationBearer token (JWT) · headerrequired
Path parameters
theme_idstringrequired
template_idstringrequired
idstringrequired
Responses
200

The template, with the restored body

_linksHalLinks
idstring
file_namestring
pathstring
bodystring

Full template source code

is_sectionboolean
schemaobject

Present only when is_section is true — the section's configurable schema.

parent_commitstring | null
updated_onstring<date-time>
warningsobject[]

Problems of the template the storefront would only show when the page renders, for an editor to show right after saving. They never block saving. Present when a single template is returned (not in the templates listed with a theme). Checked: Liquid syntax (with the storefront's own tags), a layout without {% bolder_header %} / {% bolder_footer %}, literal asset_url files the theme does not have, and literal include / include_partial templates it does not have.

Show properties
Array of object
severitystring
Allowed:errorwarning
codestring
Allowed:syntaxlayout_headerlayout_footermissing_assetmissing_include
messagestring
lineinteger

Line of the template, when known.

403

Access denied

404

Version not found for that template

Try it
Server
Authorization
Parameters
Request
curl -X POST 'https://api.onbolder.com/v2/themes/string/templates/string/versions/string/restore' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "_links": {
    "property1": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    },
    "property2": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    }
  },
  "id": "string",
  "file_name": "layout.html",
  "path": "string",
  "body": "string",
  "is_section": true,
  "schema": {},
  "parent_commit": "string",
  "updated_on": "2019-08-24T14:15:22Z",
  "warnings": [
    {
      "severity": "error",
      "code": "syntax",
      "message": "string",
      "line": 0
    }
  ]
}

Was this page helpful?