Contents
- Domma CMS User Manual
- 1. Using the CMS
- 2. Tutorials
- 3. Components
- 4. API Reference
- 5. Tools
Layouts API
Updated by Darryl Waterhouse on 29 September 2026 · 2 min read
Layouts are the page frames a page picks with layout: in its frontmatter (navbar, footer, sidebar, width, background). They are stored in config/presets.json and edited at System > Layouts. The endpoints need the layouts permission (read, or update for any change).
GET /api/layouts
Requires Bearer token + layouts read permission.
Every layout, keyed by name. Nine are built in: default, landing, blank, with-sidebar, minimal, article, product, dashboard and wide.
// Response 200
{ "default": { "key": "default", "label": "Default", "description": "Standard page with navbar and footer.",
"builtin": true, "navbar": true, "footer": true, "sidebar": false, "width": "normal",
"bgColor": "", "bgImage": "", "class": "" }, ... }
POST /api/layouts
Requires Bearer token + layouts update permission.
Add a layout. Its key is made from the label.
| Field | Type | Description |
|---|---|---|
label | string | Required. Up to 60 characters |
description | string | Up to 200 characters |
navbar, footer | boolean | Show them (default true) |
sidebar | boolean | Show a sidebar (default false) |
width | string | narrow, normal (default), wide or full |
bgColor, bgImage, class | string | Background colour, background picture and extra CSS classes |
// Response 200
{ "success": true, "key": "landing-wide", "preset": { ... } }
// Error 409
{ "error": "A preset with this key already exists" }
PUT /api/layouts/:key
Requires Bearer token + layouts update permission.
Change a layout (same fields; label is required). A built-in layout can be changed but stays built in.
DELETE /api/layouts/:key
Requires Bearer token + layouts update permission.
Delete a layout you added. Built-in layouts cannot be deleted (400). A page that names a missing layout is shown with default.
GET /api/layouts/_usage
Requires Bearer token + layouts read permission.
Which pages use each layout, and which pages name a layout that does not exist.
PUT /api/layouts
Requires Bearer token + layouts update permission.
Replace every layout at once. Each must be an object with a non-empty label; prefer the per-layout routes above.
// Response 200
{ "success": true }
GET /api/layouts/options
Requires Bearer token + layouts read permission.
Layout options, kept in config/site.json under layoutOptions.
// Response 200
{ "spacerSize": 40 }
PUT /api/layouts/options
Requires Bearer token + layouts update permission.
Merge option changes; keys you leave out are kept.
| Field | Type | Description |
|---|---|---|
spacerSize | number | Default [spacer] size in pixels (0-500) |
spacerClass | string | Extra CSS class on every spacer |
// Response 200
{ "success": true }