API reference
CSS & JS assets
Assets are a shared library of CSS and JS files. A file can be assigned to any number of pages – a change takes effect everywhere.
Asset object
{
"id": 1,
"name": "base",
"kind": "css",
"content": "body { font-family: system-ui }",
"created_at": 1791191665,
"updated_at": 1791191665,
"page_ids": [1, 2]
}
| Field | Description |
|---|---|
kind |
css or js; cannot be changed after creation |
content |
File content (not included in lists) |
page_ids |
Pages to which the asset is directly assigned (lists only) |
snippet_ids |
Snippets to which the asset is assigned (lists only) – loaded on pages that use the snippet |
Assets are served publicly under /_assets/{kind}/{id}.{kind}?v={updated_at} – see public routes.
GET /assets 🔑
List without content, with page_ids and snippet_ids. Filter: ?kind=css or ?kind=js.
GET /assets/{id} 🔑
Single asset including content.
POST /assets ✏️
{ "name": "layout", "kind": "css", "content": ".grid { display: grid }" }
Required: name, kind. 201.
PUT /assets/{id} ✏️
Merge update of name, folder (folder in the admin list) and/or content. kind is ignored.
DELETE /assets/{id} ✏️
Deletes the asset and removes it from all pages and snippets. 204.