Discovering the content model at runtime
The content model is discoverable at runtime: five `/config` and `/openapi` reads return content types, the module palette and sites, with no credentials.
A consumer does not need kywi.config.ts to learn what a Kywi instance holds. Six reads describe the whole model — content types, the module palette, the sites, and an OpenAPI document — and none of them asks for a credential. That matters for more than convenience: a client generated from the config file goes stale the moment somebody adds a content type in the admin, and these routes do not.
The content types actually in force
/api/v1/config/content-typesNo authThe merged registry: types declared in kywi.config.ts and types created through the admin, each tagged with its source. The built-in structural types — page, folder, link, form — are omitted, so what you get back is the site's authorable model. Each entry carries name, label, baseType, source, an optional pluralLabel, and a fields array of { name, type, label, required, options? }.
{ "data": [ { "name": "docPage", "label": "Doc Page", "baseType": "content", "source": "config", "pluralLabel": "Doc Pages", "fields": [ … ] } ], "meta": { … } }The source tag is the reason to read this rather than the config file. A type created in the admin exists, is writable and is queryable exactly like a config-declared one — it is simply not in your repository.
{
"data": [
{ "name": "docPage", "label": "Doc Page", "baseType": "content", "source": "config", "pluralLabel": "Doc Pages" },
{ "name": "article", "label": "Article", "baseType": "content", "source": "admin" },
{ "name": "capability", "label": "Capability", "baseType": "content", "source": "admin" }
],
"meta": { "total": 3, "page": 1, "pageSize": 3, "totalPages": 1, "hasMore": false }
}What a layout may legally contain
/api/v1/config/modulesNo authThe full module palette — built-ins plus every module contributed by kywi.config.ts and by plugins — with each module's name, label, component, category, props and isBuiltIn flag. This is the authoritative answer to "what module types may appear in a layout document, and what props does each declare".
{ "data": [ { "name": "section", "label": "Section", "component": "@kywi-software/modules/Section", "category": "Layout", "props": { "backgroundColor": { "type": "color", "label": "Background Color" }, … }, "isBuiltIn": true } ], "meta": { … } }Sites: two ids, two routes
/config/sites answers from configuration and gives you the config id — the slug you put in ?siteId=. /sites answers from the database and gives you the row, including its UUID. Both are unauthenticated, and you will need the second one: the changeset routes take a real UUID and do not accept the config slug.
{
"data": [
{ "id": "default", "name": "kywi-marketing-v3", "domain": "kywi-marketing-production.up.railway.app", "defaultLocale": "en" },
{ "id": "docs", "name": "Kywi Docs", "domain": "docs.kywi.dev", "defaultLocale": "en" },
{ "id": "northwind-analytics-demo", "name": "Northwind Analytics (demo)", "domain": "northwind.demo", "defaultLocale": "en" }
],
"meta": { "total": 3, "page": 1, "pageSize": 3, "totalPages": 1, "hasMore": false }
}The OpenAPI document is a starting point
/openapi.json and /openapi.yaml serve the same document — openapi: "3.1.0", one bearerAuth security scheme, and no servers block, so a generator has no base URL until you add one. It is hand-maintained, not derived from the router: thirty paths are written out by hand, and the only generated part is two entries per content type declared in kywi.config.ts. Against the several hundred routes the router actually registers, the spec covers a fraction, and a type created in the admin never appears in it at all. Generate a client from it if you like, then expect to hand-write the rest.
{
"openapi": "3.1.0",
"info": {
"title": "Kywi CMS API",
"version": "1.0.0",
"description": "Auto-generated API documentation for the Kywi CMS"
},
"paths": { … },
"components": {
"securitySchemes": {
"bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" }
},
"schemas": { … }
}
}The bearer token is the same credential every other route takes — see Authenticating an external caller.