Skip to main content
PUT
Write a site file

Authorizations

Authorization
string
header
required

A member credential in the Authorization: Bearer header: a member session JWT, a portal JWT whose login is linked to a membership in that company, an opaque member token, or a verified One Auth identity access token. The credential alone identifies the member and company. Member session and portal JWTs are read-only and are refused with 403 on every write.

Path Parameters

site_id
string<uuid>
required

Public id of one of the member's sites.

path
string
required

The theme-style path of the file, with its slash: layouts/<name>.liquid, sections/<name>.liquid, snippets/<name>.liquid, pages/<slug>.liquid (pages/index.liquid for the home page), assets/<file> (a css, js, json, txt or html file), config/settings.json, config/menus.json, config/pages.json or config/access.json. Names use lowercase letters, digits, hyphens and underscores, with no subfolders. Any other path is refused with 422.

Pattern: ^.+$

Body

application/json

The content of a file. The path is in the URL.

content
string
required

The whole new content of the file. An asset must not be empty. config/settings.json takes a JSON object, and config/menus.json a JSON document of menus, config/pages.json a JSON document of the site's default layout and page settings, and config/access.json a JSON object whose uses key lists what the site uses, which is refused with 422 when it is not valid.

Pattern: ^[^\u0000]*$
lock_version
integer

The lock_version of config/settings.json the caller last read. The write is refused with 409 if the settings changed since. Ignored for every other file. Send either this or version, not both.

Required range: 0 <= x <= 2147483647
version
string

The version of the file the caller last read. The write is refused with 409 if the file has changed or been removed since, and nothing is written. For config/settings.json it is the lock_version as a string, and for config/menus.json, config/pages.json and config/access.json the digest of the document. Without version or must_not_exist, the write replaces whatever is at the path. Cannot be sent with must_not_exist or lock_version.

Maximum string length: 255
Pattern: ^[^\u0000]*$
must_not_exist
boolean

Send true to create the file only if the path holds none. The write is refused with 409 if a file is already there, so a file another writer created since the caller listed the files is not replaced. config/settings.json, config/menus.json and config/pages.json always exist, so it is always refused for them. config/access.json exists only once it is written, so it is refused for it only when the site already has one. Cannot be sent with version.

Response

The saved file, whether it was created or replaced.

One site file.

status
integer
required

HTTP status code (mirrors the response status line).

data
object
required

One file of a site.

meta
object
required

Envelope metadata present on every response.