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

Make an uploaded file editable

Turns an uploaded public/ CSS or JS file into an editable template at the same path, if it is valid UTF-8 and at most 65,535 bytes. Its URL does not change.

POST/themes/{theme_id}/files/editable
Authorization
AuthorizationBearer token (JWT) · headerrequired
Path parameters
theme_idstringrequired
Request body
requiredapplication/json
pathstringrequired
Responses
200

The new template

_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.

401

Unauthorized

403

Access denied

422

No uploaded file at that path, or it can't be a template (type, size or encoding)

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.onbolder.com/v2/themes/abc123/files/editable' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "path": "public/js/vendor.min.js"
}'
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?