templates/ prefix — versioned, ACL’d, and editable like any other page — with two optional frontmatter fields:
Page templates
- Create a template: create a page at
templates/<name>in the space (the space manage page has a shortcut), write the starting content, add the frontmatter above. - Use a template: the New Page form shows a “Start from” picker with every template you can read, org-wide. Choosing one pre-fills the content and title; after the page is created,
metadataDefaultsare applied as metadata so new pages are immediately queryable in Views. - API:
GET /templates(optional?space=<slug>&includeContent=true) lists visible templates.
Space templates
Page templates seed one page; space templates seed the whole space. The/templates gallery in the app lists ready-made kits — pages, page templates, and agent instructions included — and “Use this template” creates a new space with everything in place. A space template’s content is exactly the export bundle format, so authoring one is: build a space, export it, add it to a catalog.
Templates come from three sources, all merged into one gallery:
Built-in
A catalog tracked in the repo (
packages/api/src/space-templates/builtin/). Override with COCO_SPACE_TEMPLATES_PATH for a zero-egress company catalog.Remote (opt-in)
COCO_SPACE_TEMPLATES_URL names a root.json URL. Https-only, private hosts rejected, response sizes capped, bundles re-validated. Falls back to last good copy.Org-maintained
Org admins can “Save as org template” from any space manage page; it appears in the gallery for that org only.
API
GET /space-templatesPOST /space-templates/:source/:id/spacesPOST /space-templates/orgDELETE /space-templates/org/:id
/templates?template=<id> — the destination survives sign-in and org onboarding.