Creates a new field on a content model.
Field Data Types:
| type | description |
|---|---|
| color | This field is perfect for when you want to style different elements on your page such as background colors, text colors, borders, etc. |
| currency | This field is for when you want to store a cost, price, or account balance |
| date | Stores a simple date, data sent in the format YYYY-MM-DD |
| datetime | Stores a timestamp accepts data in the format YYYY-MM-DD HH:II:SS |
| dropdown | Creates a pre-populated dropdown controlled by the (options) |
| files | Accepts uploads to media and store the file references (requires the field type option limit) |
| images | An images field (requires the field type option limit) |
| internal_link | A field that accepts a Content ZUID and auto generates a link |
| link | A field that should validate a hyperlink url |
| markdown | Stores and interprets markdown |
| number | Number looks for any int or double |
| one_to_many | One to many relationship to another collection (requires relationship field on creation) |
| one_to_one | One to one relationship to another collection (requires relationship field on creation) |
| sort | A sort order field |
| text | Accepts short text content that doesn't need special formatting or have links or media |
| textarea | Accepts longer text content that doesn't need special formatting or have links or media |
| uuid | The UUID field creates a unique alphanumeric string when an item is created. This is a helpful feature for analytics tracking, inventory management, user management, etc. |
| wysiwyg_basic | What you see is what you get editor |
| yes_no | Yes/No fields take in two specific options |
| block_selector | Contains a custom endpoint that links to the block model and its variant |
| integration | Used for displaying content from an external API |
| repeater | Allows to create a group of fields for repeating contents |
Body: raw JSON
| name | description |
|---|---|
| label | [string] Required. Display name |
| name | [string] Required. Parsley reference name |
| datatype | [string] Required. Field type. See the above list for all possible values. |
| settings | [object] Required. Field settings that are dependent on datatype for additional context. More details on "Settings key" section below. |
| required | [boolean] Is the field required? Defaults to false |
| description | [string] Additional context |
| sort | [number] Loading position. Used for interfaces |
| relatedModelZUID | [string] Related Model ZUID when datatype is one_to_one or one_to_many |
| relatedFieldZUID | [string] Related Field ZUID when datatype is one_to_one or one_to_many |
Settings key
All field types require the settings object containing at least the list key of type boolean. The list key is used to show field as a column in the table in the content view. Most fields also have their own set of additional required and optional settings keys based on how they will be consumed which are not validated by the API. Below is an overview of all other keys, other than the list key, available for every field type.
| field types | keys |
|---|---|
| text textarea | defaultValue maxCharLimit minCharLimit regexMatchPattern regexMatchErrorMessage regexRestrictPattern regexRestrictErrorMessage |
| wysiwyg_basic markdown one_to_one one_to_many link internal_link date datetime color | defaultValue |
| number currency | defaultValue minValue maxValue currency (only for currency field type) |
| yes_no dropdown | defaultValue options |
| files images | limit |
| sort uuid block_selector | (no additional settings required) |
| integration | endpoint headers type keyPaths |
| repeater | subFields |
Descriptions for each field-specific key
yes_no field
options - accepts an object with "0" and "1" keys, where the values are the display labels for each option. Example: {"0": "No", "1": "Yes"}.
dropdown field
options - accepts an object with user-defined key-value pairs.
integration field
endpoint - URL endpoint
headers - Contains the request headers. Note that values are persisted.
type - must be one of: simple, text, details, image, video, shopify, youtube, mux, classy
keyPaths - accepts an object. See table below.
| key | description |
|---|---|
| rootPath | Path to API data array |
| heading | Primary label displayed on the display card |
| subHeading | Secondary label displayed below the heading |
| thumbnail | URL of image/video preview |
| detail | Short description |
| details | Long description |
repeater field
subFields - accepts an array of field objects with at least the following keys:
datatypedescriptionlabelnamerequiredsettingssort
Available fields that can be used for repeater fields are:
- text
- textarea
- wysiwyg_basic
- markdown
- images
- link
- number
- currency
- yes_no
- dropdown
- color
- sort
- uuid
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
