Update collection schema
update_collection_schemaDefine or update the field schema of a collection. Pass the FULL ordered list of fields you want. This is a wholesale replace at the schema level (it is not a JSON Merge Patch).
expectedUpdatedAt is required: the updatedAt from get_collection (or from create_collection or the previous update_collection_schema). The save is refused if the collection changed since, for example a field a teammate just added in the dashboard; then call get_collection again, merge your fields into the current list, and retry.
Each field has:
name: string identifier (used as the key in entry content)
label: human-readable label
type: one of name, slug, text, html, number, checkbox (a yes/no value; boolean is saved as checkbox), date, image, media, icon, option, reference, related. The legacy select, textarea, email and url types are accepted so a collection that already has them can be saved back unchanged; use option and text for new fields.
required: optional boolean
helpText: optional help string
options: for option type, a comma-separated string of choices; for reference type, the target collection id; otherwise empty
list: optional boolean (allow array of values)
to: alternative for reference target id
config: optional flat object of type-specific settings. For date fields: { format, time, timeFormat } where format is one of "MMM D, YYYY" (default), "MMMM D, YYYY", "D MMM YYYY", "D MMMM YYYY", "MMM D", "MMMM D", "ddd, MMM D, YYYY", "dddd, MMMM D, YYYY", "MM/DD/YYYY", "DD/MM/YYYY", "DD.MM.YYYY", "YYYY-MM-DD", "MMM YYYY", "MMMM YYYY", "YYYY"; time is a boolean (false = calendar date only, true = date with time; this decides the value shape entries store); timeFormat is "12h" or "24h". A field sent without a config key keeps its stored config; config: null clears it. Other types take no config.
An icon field holds one icon per entry: a library icon or the site's own uploaded SVG or PNG. Use it for the small symbol beside a service, feature or step; photos and logos stay media.
Every collection has built-in Name and Slug fields (type name and type slug); they are required, never list, and their values are not part of content: the entry's name and URL slug live on the entry itself and change through update_entry. Keep both in the list when updating a collection that has them (a built-in cannot be removed or renamed); a collection holds at most one of each. A legacy collection whose name or slug is a plain text field can convert it by changing that field's type to the built-in one. Reserved field names: _raw, _icon, _pagination, _filters.
The schema has no draft: live listings and entry pages read it as soon as it is saved. A field left out of the list is removed from the schema, and changing a date field's config, or removing or retyping a date field, republishes every published entry page of the collection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The project ID | |
| fieldSchema | Yes | Full ordered list of fields. Replaces the collection's existing fieldSchema. | |
| collectionId | Yes | The collection ID | |
| expectedUpdatedAt | Yes | updatedAt as read from get_collection (or returned by create_collection or the last update_collection_schema); the save is refused if the collection changed since |