Preview a proposed change
const url = 'http://localhost:3000/api/v1/brands/example/previews';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ref":"example","title":"example","commit":"example","files":{"additionalProperty":"example"},"assets":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/brands/example/previews \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ref": "example", "title": "example", "commit": "example", "files": { "additionalProperty": "example" }, "assets": { "additionalProperty": "example" } }'A pull request’s files as the brand’s site, at a link that needs no account, and what they would change of the brand as it stands. Checked as an import is. One preview per ref: saving again keeps its link. It opens for 30 days after its last save.
Scope: write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Brand slug
Request Bodyrequired
Section titled “Request Bodyrequired”object
What proposes it, as its host names it: pull/12. One preview each; saving again updates it
The brand’s files by path in its folder: brand.yaml, rules/.yaml, pages/.yaml. Others are left alone
object
The files under assets/ the brand’s files point at: path to asset id, or to the SHA-256 of its bytes (upload first)
object
Examplegenerated
{ "ref": "example", "title": "example", "commit": "example", "files": { "additionalProperty": "example" }, "assets": { "additionalProperty": "example" }}Responses
Section titled “Responses”The preview
object
object
The site as the files say it; no account needed
object
What it would change of the brand as it stands
object
object
What changed: value, usage, label, spec, assets, type
object
Changed: the page’s own fields that changed (title, lede…)
Changed: its sections that changed, by id
object
Changed: which of its fields
Theme settings changed
The rules’ order changed
object
Example
{ "data": { "diff": { "rules": [ { "change": "added", "type": "color" } ], "pages": [ { "change": "added", "sections": [ { "change": "added" } ] } ] } }}default
Section titled “default”An error
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}