Create Field
POST {{protocol}}://{{instance_zuid}}.{{instances_api_url}}/{{instances_api_version}}/content/models/{{content_model_zuid}}/fields
name | description |
---|---|
label | [string] Required. Display Name |
name | [string] Required. Parsley Reference Name |
datatype | [string] Required. Field Type. Possible values are documented above |
settings | [object] Required. Field Settings that are dependent on datatype |
required | [boolean] Is the field required? Default to false |
description | [string] Additional context |
sort | [number] Loading position. Used for interfaces |
relatedModelZUID | [zuid] Related Model ZUID when datatype is onetoone or onetomany |
relatedFieldZUID | [zuid] Related Field ZUID when datatype is onetoone or onetomany. Model field to display |
Settings Object
name | description |
---|---|
list | [boolean] Required. Dictates the field's visibility in table listing view |
tooltip | [string] Tool tip displayed to content editors |
options | [object] Required ONLY when datatype is dropdown and yes_no. All possible options (e.g. for yes_no: {0: No, 1: Yes}) |
limit | [number] Required ONLY when datatype is images. Image Limit |
group_id | [zuid] Media Group ZUID for datatype images |
Request Body
{"label"=>"Example Field", "name"=>"example_field", "datatype"=>"text", "settings"=>{"list"=>true}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: Created
{"_meta":{"timestamp":"2021-09-16T00:52:47.996279098Z","totalResults":1,"start":0,"offset":0,"limit":1},"data":{"ZUID":"12-f4cbd6d2ae-w4jtkm"}}