BuildBaseBuildBase

Overview

Define a custom data schema, publish it as a version, and store records against it.

A collection is a custom data schema — the structured-data store behind forms, and usable on its own for anything you would otherwise add a table for.

Three levels, and the middle one is the part worth understanding:

LevelWhat it is
CollectionThe named thing, with a slug. Long-lived
VersionOne immutable set of field definitions
RecordOne row, stored against a specific version
curl https://api.console.buildbase.app/api/collections \
  -H "Authorization: $BUILDBASE_TOKEN"

Before you start

Build collections in the BuildBase console under Collections. Every endpoint here is token-authenticated — there is no public read path, so a collection is not a substitute for a public CMS API.

Versions are the schema

Fields do not live on the collection. They live on a version, so changing the schema means publishing a new version rather than editing the old one — and records stay readable against the version they were written under.

A version is created with live: false. Setting live: true publishes it.

Warning

A live version cannot be edited. PATCH on one returns 400 with "Cannot update live version". This is deliberate — records already point at it, so editing its fields would change the meaning of stored data.

To change a schema, create a new version and publish that.

Field types

Eight types, defined per field on a version:

TypeNotes
textDefault
rich-textLong-form content
number
boolNote the name — not boolean
date
color
link
email

Each field carries slug, title, helpText, type, required, and defaultValue. The slug is the key records are stored under.

Endpoints

MethodPathPurpose
GET/api/collectionsList collections
GET/api/collections/:idOne collection
POST/api/collectionsCreate
PATCH/api/collections/:idUpdate name or slug
DELETE/api/collections/:idDelete
GET/api/collections/:collectionId/versionsList versions
GET/api/collections/:collectionId/versions/:versionIdOne version, with its fields
POST/api/collections/:collectionId/versionsCreate a draft version
PATCH/api/collections/:collectionId/versions/:idEdit a non-live version
DELETE/api/collections/:collectionId/versions/:idDelete a version
GET/api/collections/chartRecord counts over time

Reading and deleting records is covered in the records API.

How forms use this

A form is a collection plus a published version plus a public endpoint. Every submission becomes a record carrying collectionId, versionId, formId, and the submitted data.

That is why a form cannot exist without a published version, and why changing a form's fields means publishing a new collection version.

The one difference: form submissions arrive through the public endpoint, which needs no token. Everything on this page does.

Next Steps

  • Records API — read and delete stored records.
  • Forms — collect records from a public endpoint.