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

Metadata

Describes metadata for Content schema for querying content using GraphQL from Optimizely Content Management System (CMS) (SaaS).

IContentMetadata

The common base schema _Content, that all content types inherit, has a property _metadata of type IContentMetadata.

Content can be displayed as stand-alone instances and as part of other content inside content areas. IContentMetadata is the common signature for content metadata regardless of whether it is a stand-alone or part of another instance.

The schema IContentMetadata consists of:

PropertyTypeDescription
keyStringUnique identifier of a content instance. The key currently uses a UUID-based format, but this may change, and you should treat the key as an opaque string.
localeStringThe locale is in the format 'language code-country', like 'en-US'. For invariant cultures, the country is omitted, like 'en'. Content that is not localizable has an empty string value.
versionStringThe version uses an integer-based format, but this may change, and you should treat the version as an opaque string. The version identifier is guaranteed to be unique across versions with the same key.
urlContentUrlThe URL for the content item. The URL consists of several parts depending on the type of content and the application definitions. See Property Schemas-ContentUrl for information.
types[String]A list of types, where the first item is the content type and then base types.
publishedDateTimeA datetime specified when the content instance was published. For drafts, published is null. It can also be a future datetime and is then filtered from public queries until the published time is the present time.
statusStringSpecifies the status of the content version. See Content version status values.
createdDateTimeA datetime specified when the first content version in the current locale was created.
lastModifiedDateTimeSpecifies when the content version was last modified.

InstanceMetadata

For stand-alone instances, _metadata can be cast to InstanceMetadata, which inherits IContentMetadata but adds more properties. An example of a query that casts to InstanceMetadata is:

query RouteSegmentQuery {
  _Page {
    items {
      _metadata {
        displayName
        ... on InstanceMetadata {
          routeSegment
        }
      }
    }
  }
}

The schema InstanceMetadata consists of:

PropertyTypeDescription
locales[String]Specifies the locales where the content exists.
expiredDateTimeA datetime that specifies when the content instance expires. If the date is a time that as passed, the content be filtered from public queries.
containerStringThe key of the content instance that contains this instance.
ownerStringIf the content is in an asset to another content then this specifies the owning content.
routeSegmentStringSpecifies the route segment for this content instance. For components or blocks that are not routable, this is
lastModifiedByStringSpecifies who last updated the content version.
createdByStringSpecifies who created the first version in the current locale.
path[String]Specifies the hierarchy of containers.

MediaMetadata

For media content instances, _metadata can be cast to MediaMetadata, like the following:

query MimeTypeQuery {
  _Media {
    items {
      _metadata {
        displayName
        ... on MediaMetadata {
          mimeType
        }
      }
    }
  }
}

The schema MediaMetadata consists of the following:

PropertyTypeDescription
thumbnailStringThe URL for a thumbnail of the media content instance.
mimeTypeStringSpecifies the mime type for the media content instance.
contentStringContains extracted content from the media instance. See Text extraction field.