Create new type documents.

Use the /types end-point to create a new type document.

Example elements

Category element

{
   "key": "MyCategoryElement",
   "label": "My Category Element",
   "elementType": "category",
   "restrictedParents": ["63b5f83684cddba687cb41eca328a41a"],
      - Optional. Indicates that categories can only been chosen from the specified parent. Currently only supports a single entry.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "helpText": "Please select a category from the list"
}

Date (Date and Time) element

{
   "key": "MyDateElement",
   "label": "My Date Element",
   "elementType": "datetime",
   "fieldType": "date-time",
   "searchKey": "date1" | "date2" | "sortableDate1" | "sortableDate2",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Date",
   "helpText": "Please select a date and time"
}

Date (Date only) element

{
   "key": "MyDateElement",
   "label": "My Date Element",
   "elementType": "datetime",
   "fieldType": "date",
   "searchKey": "date1" | "date2" | "sortableDate1" | "sortableDate2",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Date",
   "helpText": "Please select a date"
}

File element

{
   "key": "MyFileElement",
   "label": "My File Element",
   "elementType": "file",
   "acceptType": ["plain-text", "presentation", "rich-document", "spreadsheet", "pdf-document"],
      - Optional. Specifies the allowed file types.. with the above list comprising the allowed values.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "File",
   "helpText": "Please select a file"
}

Formatted-Text element

{
   "key": "MyFormattedTextElement",
   "label": "My Formatted Text Element",
   "elementType": "formattedtext",
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Text",
   "helpText": "Enter some text"
}

Group element

{
   "key": "MyGroupElement",
   "label": "My Group Element",
   "elementType": "group",
   "typeRef": {"id":"73b5f83684cddba687cb41eca328a41a"},
      - Must refer to an existing content-type whose `kind` attribute contains the value `embedded`
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Text",
   "helpText": "Please fill in these fields"
}

Image element

{
   "key": "MyImageElement",
   "label": "My Image Element",
   "elementType": "image",
   "acceptType": ["jpg", "jpeg", "png", "gif", "svg"],
      - Optional. Specifies the allowed image types.. with the above list comprising the allowed values.
   "imageProfileId": "83b5f83684cddba687cb41eca328a4567",
      - Optional. Specifies the ID of the image profile that this element is using. If an image profile is selected, then 'svg' is no longer allowed as an acceptType.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Image",
   "helpText": "Please select an image"
}

Link element

{
   "key": "MyLinkElement",
   "label": "My Link Element",
   "elementType": "link",
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Link",
   "helpText": "Please select a link"
}

Location element

{
   "key": "MyLocationElement",
   "label": "My Location element",
   "elementType": "location",
   "searchKey": "location1",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "helpText": "Please select a location"
}

Number (Decimal) element

{
   "key": "MyNumberElement",
   "label": "My Number Element",
   "elementType": "number",
   "fieldType": "decimal",
   "minimum": 10.0,
      - Optional. Specifies the lowest accepted number.
   "maximum": 49.9,
      - Optional. Specifies the highest accepted number.
   "searchKey": "number1" | "number2" | "sortableNumber1" | "sortableNumber2",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Number",
   "helpText": "Enter a number between 10.0 and 49.9"
}

Number (Integer) element

{
   "key": "MyNumberElement",
   "label": "My Number Element",
   "elementType": "number",
   "fieldType": "integer",
   "minimum": 10,
      - Optional. Specifies the lowest accepted number.
   "maximum": 49,
      - Optional. Specifies the highest accepted number.
   "searchKey": "number1" | "number2" | "sortableNumber1" | "sortableNumber2",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Number",
   "helpText": "Enter a number between 10 and 49"
}

Option Selection element

{
   "key": "MyOptionSelectionElement",
   "label": "My Option Selection Element",
   "elementType": "optionselection",
   "options": [{"label":"Option 1", "selection": "Value 1"}, {"label":"Option 2", "selection": "Value 2"}],
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "helpText": "Enter make a selection"
}

Reference element

{
   "key": "MyReferenceElement",
   "label": "My Reference Element",
   "elementType": "reference",
   "restrictTypes": [{"id":"23b5f83684cddba687cb41eca328a1234"}, {"id":"23fhf83684cddba687cb41eca328a6789"}],
      - Optional. Restricts the allowed content items, to only those from the specified content-types.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Reference",
   "helpText": "Please select an item"
}

Text (Single Line) element

{
   "key": "MyTextElement",
   "label": "My Text Element",
   "elementType": "text",
   "minLength": 5,
      - Optional. Specifies the lowest number of accepted characters. Default is 0.
   "maxLength": 50,
      - Optional. Specifies the highest number of accepted characters. Default is 10000.
   "displayType": "singleLine",
   "displayWidth": 20,
      - Optional. Specifies the width of the text editor in characters.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Text",
   "helpText": "Enter some text between 5 and 50 characters"
}

Text (Multi Line) element

{
   "key": "MyTextElement",
   "label": "My Text Element",
   "elementType": "text",
   "minLength": 5,
      - Optional. Specifies the lowest number of accepted characters. Default is 0.
   "maxLength": 50,
      - Optional. Specifies the highest number of accepted characters. Default is 10000.
   "displayType": "multiLine",
   "displayWidth": 20,
      - Optional. Specifies the width of the text editor in characters.
   "displayHeight": 10,
      - Optional. Specifies the number of lines shown within the text editor.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Text",
   "helpText": "Enter some text between 5 and 50 characters"
}

Toggle element

{
   "key": "MyToggleElement",
   "label": "My Toggle element",
   "elementType": "toggle",
   "statement": "Lead in question",
      - Optional. Specifies the text (typically a question) to show with the toggle
   "searchKey": "boolean1" | "boolean2",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "helpText": "Please make a selection"
}

Video element

{
   "key": "MyVideoElement",
   "label": "My Video Element",
   "elementType": "video",
   "acceptType": ["mp4"],
      - Optional. Specifies the allowed video types.. with the above list comprising the allowed values.
   "searchKey": "string1" | "string2" | "string3" | "string4" | "sortableString1" | "sortableString2" | "sortableString3" | "sortableString4",
      - Optional. Indicates that the value of this element will be searchable under the specified key
   "required": false,
   "allowMultipleValues": true,
   "minimumValues": 1,
   "maximumValues": 50,
   "fieldLabel": "Video",
   "helpText": "Please select a video"
}

Note: Use the /types/new end-point to return a blank document instead of creating a new type document from scratch. To add an element to a type document, merge the element-fragment section from the element definition into the element section of the type document.

User roles: admin, manager

Language
Click Try It! to start a request and see the response here!