Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Property format

Describes the property format resource in Content Management System (CMS) (SaaS) and how to work with them.

A property format is a set of rules that apply to a content type's property. It can define validation rules, which editor to use, and settings for that editor. A property format is associated with a specific data type.

The available property formats are limited to formats defined by CMS (SaaS) and cannot be modified.

The property format resource contains the following fields:

  • key – A string identifying the property group in the API.
  • dataType – The data type to which you can apply this format. It must be one of the data types. See Data types in Content types.
  • displayName – A user-friendly name for the group displayed to end users.
  • editor – A relative index used in some listings to define the order of property groups.

Pre-defined formats

The following formats represent pre-defined behaviors in the system. You can assign these to a content type property when such a behavior is preferable.

  • html (string) – Indicates that you should use the HTML editor to edit the property.
  • url (string) – Indicates that the string must be a valid URI and that you should use the URL selector when editing the string.
  • selectOne (string) – Indicates that the string should be one of a list of pre-defined values.
  • selectMany (string) – Indicates that the string should be one or more values of a list of pre-defined values.

List property formats

Retrieve a list of property formats through the propertyformats API. See List property formats API reference.

GET https://example.com/_cms/version2/propertyformats
[
    {
        "key": "html",
        "dataType": "string",
        "displayName": "HTML",
        "editor": "tinyMCE"
    },
    {
        "key": "switch",
        "dataType": "boolean",
        "displayName": "Switch",
        "editor": "bool-switch"
    },
]

Get a property format

Retrieve a specific property format through the propertyformats API using its unique key. See Get property format API reference.

GET https://example.com/_cms/version2/propertyformats/html
{
    "key": "html",
    "dataType": "string",
    "displayName": "HTML",
    "editor": "tinyMCE"
}