> For the complete documentation index, see [llms.txt](https://docs.overflowcms.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overflowcms.com/editor-guide/collections-and-fields.md).

# Collections & Fields

## Collections & Fields

A collection is a content type you define yourself — not a fixed template. Give it a name (the slug is derived automatically, e.g. "Blog" → `blog`) and a list of fields.

![The Fields tab of a collection, showing the field-schema editor](https://overflowcms.com/images/docs-screenshots/collection-fields.png)

### Field types

| Type        | Stores                                 | Indexable     | Notes                                                                                                      |
| ----------- | -------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------- |
| `text`      | Plain string                           | Yes (text)    | Optional max length                                                                                        |
| `richText`  | HTML string                            | No            | Authored with a rich-text editor (bold/italic/H2/bullet list/quote); bind with `data-oc-html` in the embed |
| `image`     | MediaRef object                        | No            | See Images & Media                                                                                         |
| `number`    | Integer or decimal                     | Yes (numeric) | Optional min/max                                                                                           |
| `date`      | ISO-8601 datetime string               | Yes (numeric) |                                                                                                            |
| `boolean`   | true/false                             | Yes (numeric) |                                                                                                            |
| `option`    | One value from a fixed list you define | Yes (text)    | Enforced against your option list on save                                                                  |
| `reference` | Another item's id                      | Yes (text)    | **Requires Pro+.** Resolved one level deep at read time                                                    |
| `video`     | MediaRef object                        | No            | **Requires Pro+.** See Images & Media                                                                      |

Every field has a **key** (camelCase, e.g. `publishedDate`) — this is both the JSON property name in the item's data and the value you put in `data-oc-field` in Webflow. Renaming a field's **label** never changes its key, specifically so existing item data doesn't get orphaned; you only change the key if you edit it explicitly, and the dashboard warns you when a collection already has items.

### Indexed fields

Mark a field **indexed** to make it usable in the public API's `sort`/`filter` query params (and in the embed's `data-oc-sort`). Indexed values are extracted into a separate lookup table when an item is saved, which is what lets sorting and filtering compile to real indexed SQL instead of scanning JSON blobs — it's also why not every type is indexable (rich text and images aren't meaningful to sort by).

### Editing a collection later

Collections aren't locked in after creation. From the collection's **Fields** tab you can rename it, add/remove/reorder fields, and change a field's type or config — changes apply to new and existing items. Deleting a collection deletes all of its items; there's a confirmation step because it can't be undone.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.overflowcms.com/editor-guide/collections-and-fields.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
