post https://{instance_zuid}.api.zesty.io/v1/content/models//fields
Creates a new field on a content model.
Field Data Types:
- [color]
- [currency]
- [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)
- [fontawesome]
- [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] Text
- [textarea] Text Area
- [uuid]
- [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
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 datatypedditional context |
| required | [boolean] Is the field required? Default to false |
| description | [string] Additional contect |
| 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 |
