HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunitySubmit a ticketLog In

Property format

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

A property format is a set of rules that apply to a content type 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 Optimizely Content Management System (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.

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.

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