Dev GuideAPI ReferenceChangelog
Dev GuideAPI ReferenceUser GuideLegal TermsDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference

Schemas

StructuredContentModel

KeyTypeDescription
idstringUnique identifier of the structured content.
titlestringTitle of the structured content.
content_bodyContentDetailsModelContent body of the structured content.
labelsarrayLabels associated with the structured content.
labels[group]objectLabel group associated with the structured content.
labels[group][id]stringUnique identifier of the label group.
labels[group][name]stringName of the label group.
labels[values]objectSelected values for label group.
labels[values][id]stringUnique identifier of the label value.
labels[values][name]stringName of label value.
created_atstringDate of creation of the structured content.
modified_atstringDate of last modification of the structured content.
linksobjectLinks related to the structured content.
links[self]stringURL to fetch structured content through the CMP Open API.
{
  "id": "ce54ce74e3c240d38ace1a37704acf67",
  "title": "Some title",
  "content_body": <content_body_of_the_structured_content>,
  "labels": [
    {
      "group": {
        "id": "123123",
        "name": "Content Format"
      },
      "values": [
        {
          "id": "234234",
          "name": "content format 1"
        }
      ]
    }
  ],
  "created_at": "2022-09-28 12:49:00",
  "modified_at": "2022-09-28 12:20:12",
  "links": {
    "self": "https://api.cmp.optimizely.com/v3/structured-contents/ce54ce74e3c240d38ace1a37704acf67"
  }
}

ContentPreviewStructuredContentModel

KeyTypeDescription
idstringUnique identifier of the structured content.
titlestringTitle of the structured content.
content_bodyContentPreviewContentDetailsModelContent body of the structured content.
created_atstringDate of creation of the structured content.
modified_atstringDate of last modification of the structured content.
{
  "id": "ce54ce74e3c240d38ace1a37704acf67",
  "title": "Some title",
  "content_body": <content_body_of_the_structured_content>,
  "created_at": "2022-09-28 12:49:00",
  "modified_at": "2022-09-28 12:20:12"
}

ContentDetailsModel

KeyTypeDescription
content_guidstringUnique identifier of the content.
titlestringTitle of the content.
template_guidstring or nullTemplate guid of the content.
root_contentbooleanThis is true when the content is not embedded in another content through a content type reference field.
expiredboolean or nullWhether the content is expired or not.
expiry_datetimestring or nullDate on which the content expires.
content_type_guidstringUnique identifier of the content type.
content_type_namestringName of the content type.
content_typeContentTypeModel or nullContent type of the content.
latest_fields_versionLatestFieldsVersionModelLatest fields version of the content.
sourcestring or nullSource of the content.
source_idstring or nullSource id of the content.
source_metadatastring or nullSource metadata of the content.
created_atstringDate of creation of the content.
created_bystringUnique identifier of the user who created the content.
updated_atstringDate of last modification of the content.
updated_bystringUnique identifier of the user who last modified the content.
linksobjectLinks related to the content.
links[self]stringURL to fetch the content through the CMP Open API.
links[definition]stringURL to fetch the content definitions through the CMP Open API.
{
  "content_guid": "ce54ce74e3c240d38ace1a37704acf67",
  "title": "Some title",
  "template_guid": null,
  "root_content": false,
  "expired": false,
  "expiry_datetime": null,
  "content_type_guid": "319d2fd89b554f66832550a9a57c04fc",
  "content_type_name": "MyComponent",
  "content_type": <content_type_of_the_content>,
  "latest_fields_version": <latest_fields_version_of_the_content>,
  "source": null,
  "source_id": null,
  "source_metadata": null,
  "created_at": "2022-09-28T12:49:00",
  "created_by": "61d3f5f0312bdb3fe531ba34",
  "updated_at": "2022-09-28T12:49:00",
  "updated_by": "61d3f5f0312bdb3fe531ba34",
  "links": {
    "definition": "https://api.cmp.optimizely.com/v3/structured-content/content-types/319d2fd89b554f66832550a9a57c04fc/versions/90e07ce2b5a94880b196c8acb3ecf783",
    "self": "https://api.cmp.optimizely.com/v3/structured-content/contents/ce54ce74e3c240d38ace1a37704acf67"
  }
}

ContentPreviewContentDetailsModel

KeyTypeDescription
content_guidstringUnique identifier of the content.
titlestringTitle of the content.
template_guidstring or nullTemplate guid of the content.
root_contentbooleanThis is true when the content is not embedded in another content through a content type reference field.
expiredboolean or nullWhether the content is expired or not.
expiry_datetimestring or nullDate on which the content expires.
content_type_guidstringUnique identifier of the content type.
content_type_namestringName of the content type.
content_typeContentTypeModel or nullContent type of the content.
fields_versionFieldsVersionModelFields version of the content.
sourcestring or nullSource of the content.
source_idstring or nullSource id of the content.
source_metadatastring or nullSource metadata of the content.
created_atstringDate of creation of the content.
created_bystringUnique identifier of the user who created the content.
updated_atstringDate of last modification of the content.
updated_bystringUnique identifier of the user who last modified the content.
{
  "content_guid": "ce54ce74e3c240d38ace1a37704acf67",
  "title": "Some title",
  "template_guid": null,
  "root_content": false,
  "expired": false,
  "expiry_datetime": null,
  "content_type_guid": "319d2fd89b554f66832550a9a57c04fc",
  "content_type_name": "MyComponent",
  "content_type": <content_type_of_the_content>,
  "fields_version": <fields_version_of_the_content>,
  "source": null,
  "source_id": null,
  "source_metadata": null,
  "created_at": "2022-09-28T12:49:00",
  "created_by": "61d3f5f0312bdb3fe531ba34",
  "updated_at": "2022-09-28T12:49:00",
  "updated_by": "61d3f5f0312bdb3fe531ba34"
}

ContentTypeModel

KeyTypeDescription
content_type_guidstringUnique identifier of the content type.
namestringName of the content type.
thumbnail_guidstring or nullThumbnail guid of the content type.
componentbooleanWhether content type is a component or not.
descriptionstring or nullDescription of the content type.
disabledboolean or nullDisabled status of the content type.
versionContentTypeVersionModelVersion of the content type.
sourcestring or nullSource of the content type.
source_idstring or nullSource ID of the content type.
source_metadatastring or nullSource metadata of the content type.
created_atstringDate of creation of the content type.
created_bystringUnique identifier of the user who created the content type.
updated_atstringDate of last modification of the content type.
updated_bystringUnique identifier of the user who last modified the content type.
linksobjectLinks related to the content type.
links[self]stringURL to fetch content type through the CMP Open API.
links[versions]stringURL to fetch content type versions through the CMP Open API.
{
  "content_type_guid": "319d2fd89b554f66832550a9a57c04fc",
  "name": "MyComponent",
  "thumbnail_guid": null,
  "component": false,
  "description": "Some description",
  "disabled": null,
  "version": <version_of_the_content_type>,
  "source": null,
  "source_id": null,
  "source_metadata": null,
  "created_at": "2022-09-27T16:32:26",
  "created_by": "61d3f5f0312bdb3fe531ba34",
  "updated_at": "2022-09-27T16:32:40",
  "updated_by": "61d3f5f0312bdb3fe531ba34",
  "links": {
    "self": "https://api.cmp.optimizely.com/v3/structured-content/content-types/319d2fd89b554f66832550a9a57c04fc",
    "versions": "https://api.cmp.optimizely.com/v3/structured-content/content-types/319d2fd89b554f66832550a9a57c04fc/versions"
  }
}

ContentTypeVersionModel

KeyTypeDescription
version_guidstringUnique identifier of the version.
latestbooleanWhether the version is latest.
expected_localesarray of stringsExpected locales of the version.
field_definitionsarray containing any of ContentTypeFieldDefinition, LibraryAssetFieldDefinition, TextFieldDefinition, BaseFieldDefinition, DatetimeFieldDefinition, RichTextFieldDefinition, ChoiceFieldDefinition, NumberFieldDefinitionField definitions of the version.
created_atstringDate of creation of the version.
created_bystringUnique identifier of the user who created the version.
linksobjectLinks related to the version.
links[self]stringURL to fetch the version through the CMP Open API.
links[content_type]stringURL to fetch content type through the CMP Open API.
{
  "version_guid": "90e07ce2b5a94880b196c8acb3ecf783",
  "latest": true,
  "expected_locales": ["en_US"],
  "field_definitions": [<field_definitions_of_the_content_type_version>],
  "created_at": "2022-09-28T12:16:14",
  "created_by": "61d3f5f0312bdb3fe531ba34",
  "links": {
    "content_type": "https://api.cmp.optimizely.com/v3/structured-content/content-types/319d2fd89b554f66832550a9a57c04fc",
    "self": "https://api.cmp.optimizely.com/v3/structured-content/content-types/319d2fd89b554f66832550a9a57c04fc/versions/90e07ce2b5a94880b196c8acb3ecf783"
  }
}

LatestFieldsVersionModel

KeyTypeDescription
version_guidstringUnique identifier of the version.
content_hashstringContent hash of the version.
validationobject or nullValidation of the version.
validation[fields]object or nullValidation of the fields.
validation[fields][*property_name]object or nullValidation of the field.
validation[fields][*property_name][*property_name]stringError reason. Will be one of REQUIRED_FIELD_ABSENT, LIST_EMPTY, INVALID_STATE, INVALID_SELF_REF, MIN_NOT_MET, MAX_NOT_MET or PATTERN_ERROR
fieldsobjectFields related to the version.
fields[*property_name]arrayLocalized field values of the version.
fields[*property_name][<index>]objectLocalized field values of the version.
fields[*property_name][<index>][locale]stringLocale of the field values.
fields[*property_name][<index>][field_values]array containing any of NumberFieldValueModel, BooleanFieldValueModel, DatetimeFieldValueModel, TextFieldValueModel, RichTextFieldValueModel, LibraryAssetFieldValueModel, ContentFieldValueModel, ContentFieldValueExpandedModel, URLFieldValueModel, JSONFieldValueModel, ChoiceFieldValueModel, LocationFieldValueModelField values of the field.
source_idstring or nullSource id of the version.
source_metadatastring or nullSource metadata of the version.
created_atstringDate of creation of the version.
created_bystringUnique identifier of the user who created the version.
{
  "version_guid": "5a37dd4957994366b29fb885819fa1f3",
  "content_hash": "ebc44b355f60640157b51918105d567322e29ded1e949ffecb5709b112cf847f995e5a6da5e4fcac8c64236d949b5d38",
  "validation": {
    "fields": {
      "field_key_1": {
        "value[0]": "INVALID_STATE"
      }
    }
  },
  "fields": {
    "field_key_1": [
      {
        "locale": "en_US",
        "field_values": [{}]
      }
    ],
    "field_key_2": [
      {
        "locale": "en_US",
        "field_values": [{}]
      }
    ]
  },
  "source_id": null,
  "source_metadata": null,
  "created_at": "2022-09-28T12:49:17",
  "created_by": "61d3f5f0312bdb3fe531ba34"
}

NumberFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
num_valuenumberValue of the field value.
{
  "order_index": null,
  "num_value": 2
}

BooleanFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
bool_valuebooleanValue of the field value.
{
  "order_index": null,
  "bool_value": true
}

DatetimeFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
datetime_valuestringValue of the field value.
{
  "order_index": null,
  "datetime_value": "2022-09-28T12:16:41"
}

TextFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
text_valuestringValue of the field value.
{
  "order_index": null,
  "text_value": "abc"
}

RichTextFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
rich_text_valuestringValue of the field value.
{
  "order_index": null,
  "rich_text_value": "<p>some text</p>"
}

LibraryAssetFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
asset_typestringType of the asset (article, image, video, raw file, or structured_content).
asset_guidstringUnique identifier of the GUID.
linksobject or nullLinks related to the field value.
links[self]stringURL to fetch an asset through the CMP Open API.
{
  "order_index": null,
  "asset_type": "image",
  "asset_guid": "66ebb5440f6f11edb68eaee6808b7756",
  "links": {
    "self": "https://api.cmp.optimizely.com/v3/asset-urls/66ebb5440f6f11edb68eaee6808b7756"
  }
}

ContentFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
embeddedbooleanWhether it is embedded or not.
content_guidstringUnique identifier of the content.
content_urlstring or nullURL of the content.
{
  "order_index": null,
  "embedded": true,
  "content_guid": "49d58696325d48cfbe9f1e77f882dc19",
  "content_url": "/v3/structured-content/contents/49d58696325d48cfbe9f1e77f882dc19"
}

ContentFieldValueExpandedModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
embeddedbooleanWhether it is embedded or not.
content_guidstringUnique identifier of the content.
content_urlstring or nullURL of the content.
content_detailsContentDetailsModelDetails of the content.
{
  "order_index": null,
  "embedded": true,
  "content_guid": "49d58696325d48cfbe9f1e77f882dc19",
  "content_url": "/v3/structured-content/contents/49d58696325d48cfbe9f1e77f882dc19",
  "content_details": {}
}

URLFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
urlstringUrl of the field value.
{
  "order_index": null,
  "url": "https://abc.com"
}

JSONFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
json_valueobject or array of anyValue of the field value.
{
  "order_index": null,
  "json_value": {
    "some_key": "some value"
  }
}

ChoiceFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
choice_keystringChoice key of the field value.
{
  "order_index": null,
  "choice_key": "somekey"
}

LocationFieldValueModel

KeyTypeDescription
order_indexinteger or nullOrder index of the field value.
longitudenumberLongitude of the location.
latitudenumberLatitude of the location.
{
  "order_index": null,
  "longitude": -77.0364,
  "latitude": 38.8951
}

LocationDefaultValue

KeyTypeDescription
longitudenumberLongitude of the location.
latitudenumberLatitude of the location.
{
  "longitude": -77.0364,
  "latitude": 38.8951
}

CoreFieldDefinition

KeyTypeDescription
keystringKey of the field.
namestringName of the field.
is_listbooleanWhether the field is a list.
is_requiredbooleanRequired status of the field.
need_internationalizationbooleanWhether the field needs internationalization.
min_list_lengthinteger or nullMinimum list length of the field.
max_list_lengthinteger or nullMaximum list length of the field.
field_typestring or nullField type of the field (boolean, number, text-field, rich-text, datetime, library-asset, content-type, json, url, choice, location).
source_idstring or nullSource ID of the field.
source_metadatastring or nullSource metadata of the field.
order_indexinteger or nullOrder index of the field.
help_textstring or nullHelp text of the field.
editor_metadataobject or array of any or nullEditor metadata of the field.
{
  "key": "anotherComponent",
  "name": "another component",
  "is_list": false,
  "is_required": false,
  "need_internationalization": false,
  "min_list_length": 1,
  "max_list_length": -1,
  "field_type": "content-type",
  "source_id": null,
  "source_metadata": null,
  "order_index": null,
  "help_text": null,
  "editor_metadata": null
}

ContentTypeFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
allowed_content_typesarray of stringsAllowed content types of the field.
ref_typestringRef type of the field.
allow_ref_editboolean or nullWhether ref edit is allowed.
content_type_linksobject or nullContent type links of the field.
content_type_links[*property_name]objectInformation related to the linked content type item.
content_type_links[*property_name][name]stringName of the item.
content_type_links[*property_name][url]stringURL of the item.
default_valuestring or nullDefault value of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "allowed_content_types": [
    "5291e00b990a45f1857adc024fd26620",
    "8f124dbb63934c14833d594443a3f3ec"
  ],
  "allow_ref_edit": true,
  "ref_type": 2,
  "content_type_links": {
    "5291e00b990a45f1857adc024fd26620": {
      "name": "Author",
      "url": "/v3/structured-content/content-types/5291e00b990a45f1857adc024fd26620"
    },
    "8f124dbb63934c14833d594443a3f3ec": {
      "name": "Book",
      "url": "/v3/structured-content/content-types/8f124dbb63934c14833d594443a3f3ec"
    }
  },
  "default_value": null
}

LibraryAssetFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
allowed_typesarray of stringsAllowed types of the field.
default_valuesarray or nullDefault values of the field.
default_values[][asset_type]stringType of the asset.
default_values[][asset_guid]stringUnique identifier of the asset.
{
  "core": <core_fields_of_the_field_definition>,
  "allowed_types": [
    "article",
    "image",
    "video",
    "raw_file",
    "structured_content"
  ],
  "default_values": null
}

TextFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
validation_patternstringValidation pattern of the field.
min_lengthintegerMinimum length of the field.
max_lengthinteger or nullMaximum length of the field.
default_valuesarray of strings or nullDefault values of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "validation_pattern": "ab.*",
  "min_length": 1,
  "max_length": 10,
  "default_values": ["abc"]
}

BaseFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
base_typestringBase type of the field (boolean, json, url, or location).
default_valuesarray containing any of LocationDefaultValue, booleans, strings, object or array of any or nullDefault values of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "base_type": "url",
  "default_values": null
}

DatetimeFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
min_datestringMinimum date of the field.
max_datestringMaximum date of the field.
default_valuesarray of strings or nullDefault values of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "min_date": "1900-01-01T00:00:00",
  "max_date": "2100-12-31T23:59:59",
  "default_values": null
}

RichTextFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
min_visual_text_lengthintegerMinimum length of the field.
max_visual_text_lengthinteger or nullMaximum length of the field.
default_valuesarray of strings or nullDefault values of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "min_visual_text_length": 0,
  "max_visual_text_length": -1,
  "default_values": null
}

ChoiceFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
choicesobjectChoices of the field.
choices[*property_name]stringChoice of the field.
display_optionstring or nullDisplay option of the choice field (dropdown, radio, tag, or checkbox).
default_valuesarray of strings or nullDefault values of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "choices": {
    "somechoice": "somechoice"
  },
  "display_option": "dropdown",
  "default_values": null
}

NumberFieldDefinition

KeyTypeDescription
coreCoreFieldDefinitionCore field definition.
min_valueinteger or nullMinimum number of the field.
max_valueinteger or nullMaximum number of the field.
default_valuesarray of integers or nullDefault values of the field.
{
  "core": <core_fields_of_the_field_definition>,
  "min_value": null,
  "max_value": null,
  "default_values": null
}