تخطَّ إلى المحتوى

Field Types

When adding fields to a collection, you choose a field type that defines how data is stored and validated.

Text & Content

TypeDescriptionExample value
textShort single-line text"Hello world"
longtextMulti-line plain text"First line\nSecond line"
richtextHTML rich text (WYSIWYG editor)"<p>Hello <strong>world</strong></p>"
slugURL-safe string, auto-generated from another field"hello-world"
emailEmail address with validation"user@example.com"
passwordHashed password field(write-only)
colorHex color value"#3b82f6"

Numbers & Booleans

TypeDescriptionExample value
numberInteger number42
decimalDecimal number19.99
booleanTrue or falsetrue

Date & Time

TypeDescriptionExample value
dateDate only"2024-01-15"
datetimeDate and time (ISO 8601)"2024-01-15T10:30:00+00:00"
timeTime only"10:30"

Structure

TypeDescriptionExample value
enumerationOne value from a predefined list"draft"
jsonRaw JSON object or array{"key": "value"}

Relations

TypeDescriptionExample value
mediaReference to a media asset (image, file, video){"uuid": "...", "url": "..."}
relationReference to an entry in another collection{"uuid": "...", "fields": {...}}

Configuring relations

media fields store a reference to a file in the media library. The API returns the full asset object including URL and MIME type.

relation fields must specify a targetCollection in the field options. For example, a Post collection can have an author field of type relation pointing to end_users (the built-in user collection).

Configuring enumerations

enumeration fields require a list of allowed values, set in the field options. Example: ["draft", "published", "archived"].