Design
Brand tokens and the site stylesheet.
Get the design
/sites/{siteId}/designThe site’s look: brand tokens (with the theme’s token list and defaults), fonts, and the stylesheet (design.css) whole and split into its parts (sections/hero.css, layout/header.css and so on). Shows unpublished site-wide draft changes too, as the editor does.
Path parameters
siteIdstringrequiredThe site’s id.
Response 200
tokensmap of stringrequiredthemeTokensarrayrequiredfontsarrayrequiredcssstringrequiredpartsarray of objectsrequired2 child fields
pathstringrequiredcssstringrequired
Errors
- 401No key, or the key isn’t valid.
- 403The key lacks the scope (insufficient_scope) or the role this needs, or the site’s plan lacks the feature (feature_not_in_plan).
- 404Not found, or not reachable with this key.
- 429Too many requests; wait for RateLimit-Reset seconds.
Try itRead-only. Sends a real request with your key.
curl https://api.unvop.com/v1/sites/site_123/design \
-H "Authorization: Bearer $UNVOP_KEY"const res = await fetch('https://api.unvop.com/v1/sites/site_123/design', {
headers: {
Authorization: `Bearer ${process.env.UNVOP_KEY}`,
},
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.unvop.com/v1/sites/site_123/design",
headers={"Authorization": f"Bearer {os.environ['UNVOP_KEY']}"},
)
data = res.json(){
"tokens": {
"signal": "#0f766e"
},
"themeTokens": [
{}
],
"fonts": [
{}
],
"css": "…",
"parts": [
{
"path": "/menu",
"css": "…"
}
]
}Change brand tokens
/sites/{siteId}/design/tokensSet brand tokens (colours, fonts, radius) by name. Token names come from themeTokens in GET /sites/{siteId}/design. They save as a site-wide draft: the editor and draft previews show them on every page, and the live site changes when you publish (POST /sites/{siteId}/publish or any page publish).
Path parameters
siteIdstringrequiredThe site’s id.
Request body JSON
tokensmap of stringrequired
Response 200
tokensmap of stringrequired
Errors
- 401No key, or the key isn’t valid.
- 403The key lacks the scope (insufficient_scope) or the role this needs, or the site’s plan lacks the feature (feature_not_in_plan).
- 404Not found, or not reachable with this key.
- 422The body is invalid; details say which values.
- 429Too many requests; wait for RateLimit-Reset seconds.
Try itSends a real request. Asks before it changes anything.
curl -X PATCH https://api.unvop.com/v1/sites/site_123/design/tokens \
-H "Authorization: Bearer $UNVOP_KEY" \
-H "Content-Type: application/json" \
-d '{
"tokens": {
"signal": "#0f766e"
}
}'const res = await fetch('https://api.unvop.com/v1/sites/site_123/design/tokens', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.UNVOP_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
tokens: {
signal: "#0f766e"
}
}),
});
const data = await res.json();import os, requests
res = requests.patch(
"https://api.unvop.com/v1/sites/site_123/design/tokens",
headers={"Authorization": f"Bearer {os.environ['UNVOP_KEY']}"},
json={
"tokens": {
"signal": "#0f766e",
},
},
)
data = res.json(){
"tokens": {
"signal": "#0f766e"
}
}Save one part of the stylesheet
/sites/{siteId}/design/styles/{file}Replace one part of design.css, such as sections/hero.css, or add a new section part under sections/. The CSS must parse; unsafe rules are removed and listed in warnings. Send the version from a previous read to refuse the save if the part changed since. Editing CSS is limited to platform administrators, as in the dashboard’s Code area.
Path parameters
siteIdstringrequiredThe site’s id.
filestringrequiredThe part’s path inside site/styles/, like sections/hero.css.
Request body JSON
contentstringrequiredversionstring
Response 200
pathstringrequiredcontentstringrequiredversionstringrequiredwarningsarray of strings
Errors
- 401No key, or the key isn’t valid.
- 403The key lacks the scope (insufficient_scope) or the role this needs, or the site’s plan lacks the feature (feature_not_in_plan).
- 404Not found, or not reachable with this key.
- 409It conflicts with the current state.
- 422The body is invalid; details say which values.
- 429Too many requests; wait for RateLimit-Reset seconds.
Try itSends a real request. Asks before it changes anything.
curl -X PUT https://api.unvop.com/v1/sites/site_123/design/styles/sections/hero.css \
-H "Authorization: Bearer $UNVOP_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": ".hero { padding-block: 6rem; }"
}'const res = await fetch('https://api.unvop.com/v1/sites/site_123/design/styles/sections/hero.css', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.UNVOP_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: ".hero { padding-block: 6rem; }"
}),
});
const data = await res.json();import os, requests
res = requests.put(
"https://api.unvop.com/v1/sites/site_123/design/styles/sections/hero.css",
headers={"Authorization": f"Bearer {os.environ['UNVOP_KEY']}"},
json={
"content": ".hero { padding-block: 6rem; }",
},
)
data = res.json(){
"path": "/menu",
"content": ".hero { padding-block: 6rem; }",
"version": "v_123",
"warnings": []
}