Field Types Reference
Contensa.ai supports a rich set of field types for building flexible content models. Each field type has its own options and validation rules.
Quick Reference
| Type | API Name | Use Case |
|---|---|---|
| 📝Short Text | short-text | Single-line plain text field |
| 📄Long Text | long-text | Multi-line plain text field |
| 📝Rich Text | rich-text | Full rich text editor with formatting support (bold, italic, headings, lists, links) |
| 🔢Number | number | Integer or decimal number |
| ✅Boolean | boolean | True/false toggle |
| 📅Date | date | Date and/or time picker |
| 🖼️Media | media | Single or multiple media assets (images, videos, PDFs, etc |
| 📋List | list | Array of simple primitive values (strings, numbers) |
| 🔗Reference | reference | Links to a SINGLE entry of another content model |
| 🔗🔗References (Many) | references-many | Links to MULTIPLE entries of another content model |
Field Type Details
Short Text
short-textSingle-line plain text field. Use for titles, names, slugs, and short descriptions.
Options
Example
{ "name": "title", "type": "short-text", "required": true }Long Text
long-textMulti-line plain text field. Use for descriptions, notes, and longer content without formatting.
Options
Example
{ "name": "description", "type": "long-text" }Rich Text
rich-textFull rich text editor with formatting support (bold, italic, headings, lists, links). Returns formatted content.
Options
Example
{ "name": "body", "type": "rich-text" }Number
numberInteger or decimal number. Use for prices, quantities, ratings, and numeric values.
Options
Example
{ "name": "price", "type": "number", "min": 0 }Boolean
booleanTrue/false toggle. Use for flags like published, featured, inStock, isActive.
Options
Example
{ "name": "published", "type": "boolean", "defaultValue": false }Date
dateDate and/or time picker. Stored as ISO 8601 string. Use for publishedAt, createdAt, expiresAt.
Options
Example
{ "name": "publishedAt", "type": "date", "includeTime": true }Media
mediaSingle or multiple media assets (images, videos, PDFs, etc.) from your Media Library. Returns URLs and metadata.
Options
Example
{ "name": "coverImage", "type": "media", "allowedTypes": ["image"] }List
listArray of simple primitive values (strings, numbers). Use for tags as plain strings, keywords, or simple scalar collections. Do NOT use for arrays of objects — use references-many instead.
Options
Example
{ "name": "keywords", "type": "list" }Reference
referenceLinks to a SINGLE entry of another content model. Use when the source data is a nested object (e.g. { id, name, bio }). Examples: author, category, primaryTag.
Options
Example
{ "name": "author", "type": "reference", "settings": { "targetContentTypeId": "author_content_type_id" } }References (Many)
references-manyLinks to MULTIPLE entries of another content model. Use when the source data is an array of objects (e.g. [{ id, name }, ...]). Examples: tags, relatedPosts, productVariants. Never use "list" for arrays of objects.
Options
Example
{ "name": "relatedPosts", "type": "references-many", "settings": { "targetContentTypeId": "post_content_type_id" } }Common Field Options
| Option | Type | Description |
|---|---|---|
required | boolean | Field must have a value when creating/updating an entry |
unique | boolean | Value must be unique across all entries of this model |
defaultValue | any | Default value used when no value is provided |
placeholder | string | Hint text shown in the editor input |
targetContentTypeId | string | ID of the content type to reference (for reference fields) |
allowedTypes | string[] | Allowed media types (e.g., ["image", "video", "pdf"]) |
multiple | boolean | Allow multiple media files (for media fields) |
Working with References
Reference fields are one of the most powerful features in Contensa.ai, allowing you to create relationships between different content types. This enables you to build complex, interconnected content structures.
What is a Reference?
A reference field creates a link between one content entry and another. Think of it like a foreign key in a database — it points to another piece of content. There are two types:
Reference (One-to-One)
Links to a single entry of another content model. Source data is a nested object.
// Nested object → reference
"author": { "id": "...", "name": "..." }References Many (One-to-Many)
Links to multiple entries of another content model. Source data is an array of objects.
// Array of objects → references-many
"tags": [{ "id": "...", "name": "..." }]Important — list vs references-many
Use list only for arrays of primitive values (strings, numbers). Use references-many for arrays of objects. Never use list to represent object relationships.
How to Add a Reference Field
Adding a reference field in the Contensa.ai dashboard is straightforward:
- 1
Open your content model
Navigate to the content model where you want to add the reference field.
- 2
Click "Add Field"
Choose either Reference (for single linked entry) or References Many (for multiple linked entries).
- 3
Configure the field
Give it an API name (e.g.,
author) and select the target content type to reference. - 4
Set options
Mark as required if needed to ensure the field must be filled when creating content.
- 5
Save the field
The reference field is now available when creating or editing content entries.
Via MCP Tool (AI agents)
When using the contensa_create_field MCP tool, you must provide settings.targetContentTypeId for any reference field:
// Single reference — nested object in source data
contensa_create_field({
contentTypeId: "blog-post-ct-id",
name: "author",
kind: "reference",
settings: { targetContentTypeId: "author-ct-id" }
})
// Multiple references — array of objects in source data
contensa_create_field({
contentTypeId: "blog-post-ct-id",
name: "tags",
kind: "references-many",
settings: { targetContentTypeId: "tag-ct-id" }
})Common Use Cases
Blog Post → Author
Each blog post has one author. Use a Reference field pointing to an "Author" content type.
Product → Categories
A product can belong to multiple categories. Use References Many pointing to a "Category" content type.
Article → Related Articles
Show related content by using References Many pointing to the same "Article" content type (self-reference).