Skip to main content
A record type is a template that declares a metadata schema. Pages created from it are validated on the way in, stamped with the type’s name, and queryable as rows. This is what turns a space of pages into something you can filter, rank, and trend. The page body stays a narrative a person reads. The metadata becomes structured state a query can answer, and the schema is what keeps that state consistent across everyone and everything writing to it.

Declaring a type

A record type is an ordinary page under a space’s templates/ prefix whose frontmatter carries a metadataSchema.

Field types

string, text, number, boolean, date, select, multiselect, list, and url. Fields take required, default, label, and description. Select and multiselect fields take options. Number fields take inclusive min and max bounds. additionalKeys decides whether metadata keys the schema does not declare may be written. Set it to allow when agents should be free to add their own keys, or reject to keep the type closed.

Creating records

A record is created from its type, so it is born conforming rather than corrected later. The examples below create demo/deals/acme: space demo, page path deals/acme.
Values are validated against the schema before anything is written. A violation returns 400 with per-field issues and creates nothing, so a bad write never leaves a half-made page behind:
That guarantee is the point. Without it, a pipeline accumulates diligence, Diligence, and in diligence until no query is trustworthy.

Querying records

Every record carries a template stamp in its metadata, so querying one type is a metadata query with that filter already applied.
Discover what a space offers before you query it. coco records types <space> and coco.records.types(space) list the space’s record types with their fields, which is how an agent meeting a deployment for the first time learns what it can ask.

Where record types fit

  • Page metadata is the underlying store. A record type is a contract over it, not a different mechanism.
  • Templates covers the rest of what templates do, including whole-space kits.
  • Views is the human window onto the same queries.
  • Export and import carries a type and its records between deployments as one bundle.