---
title: Create contracts
slug: cms-13/docs/create-contracts
docTags: 
createdAt: 2026-07-30T20:22:06.571Z
---

Administrators create and manage contracts in the **Settings** UI; developers implement them in code.

## How contracts work

Contracts, also known as interfaces, define shared properties and behaviors across content types and establish a standardized structure for consistency. Integrate a contract with Optimizely Graph to extend these benefits to its content delivery APIs and support more flexible content querying.

For example, you can create a contract called *Categorizable* and specify that any content type implementing it must include the properties **Category** and **Tags**.

Content types such as *Blog article*, *Press release*, and *News article* can then implement this *Categorizable* contract. By doing so, you ensure the following:

- Every *Blog article* consistently has a **Category** and **Tags**.
- Every *Press release* consistently has a **Category** and **Tags**.
- Every *News article* consistently has a **Category** and **Tags**.

This consistency provides the following advantages:

- **Consistent content management** – Content editors encounter a uniform experience. Regardless of the specific content type, the **Category** and **Tags** fields always display, promoting standardized metadata application.
- **Enhanced search and filtering** – Developers and content managers search for, group, and filter content based on the contract's properties. For example, retrieve all *Categorizable* content and filter by *Category: Marketing* or *Tag: Product Launch*, without differentiating between *Blog article*, *Press release*, or *News article*.
- **Code reusability** – Developers write generic code that interacts with any content type implementing a specific contract. This reduces redundancy, simplifies development, and improves maintainability.

## Contracts and Optimizely Graph

Contracts extend to Optimizely Graph, changing how developers query and consume content. When you define a contract in CMS 13, CMS automatically generates a corresponding GraphQL schema (a typed representation of the contract's properties) in Optimizely Graph.

- **Unified querying** – Developers write a single GraphQL query targeting the *Categorizable* contract schema in Optimizely Graph. The query retrieves content from all implementing content types, such as *Blog article*, *Press release*, and *News article*.
- **Simplified data access** – Developers retrieve all relevant content adhering to the *Categorizable* structure in a single query, without writing separate queries for each content type. This approach simplifies data retrieval for applications that consume content from Optimizely Graph.
- **Decoupled development** – Contracts decouple front-end development from specific content type implementations. Developers build components that expect any *Categorizable* content, and Optimizely Graph delivers it consistently regardless of the original CMS content type.

## Create a contract

Create a contract to define a reusable set of properties that multiple content types share. Contracts enforce consistent metadata and unlock unified queries in Optimizely Graph.

1. Go to **Settings** > **Content Types** and select **Create New** > **Contract**. The **Create New Contract** window displays.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/WfC34F2JFtyfrM5052RjI_6ed816ebbb94c9c7926dd4f887c2c44c9fb52b5be98e674783674d9eb4ff5cb3-image.png)

:::Paragraph{listStyleType="disc" indent="2"}
**Name** – Enter the internal programmatic name for the contract (such as *Categorizable*).
:::

:::Paragraph{listStyleType="disc" indent="2"}
**Display name** – Enter the name that content editors see (such as *Categorizable content type*).
:::

:::Paragraph{listStyleType="disc" indent="2"}
**Description** – Provide a description of what content types implementing this contract must include (for example, *Any content type with this contract must have Category and Tags properties.*).
:::

2. Click **Properties** to add properties to the contract.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/XqwGTFmfM-EPMYkqJm7XN_93c754d225152e4e53a45d47ee32044124f4c4e975c32db751b0f0bcd218ca4c-image.png)

Add the properties that all content types implementing this contract must include. For example, if your contract is *Categorizable*, add properties such as *Category* and *Tags*. For each property, configure its settings.

:::Paragraph{listStyleType="disc" indent="2"}
**Display in edit view** – Select this option to make the property visible and editable in the content editor's view when a content type implements this contract.
:::

:::Paragraph{listStyleType="disc" indent="2"}
**Display name** – The label for the property that content editors see.
:::

:::Paragraph{listStyleType="disc" indent="2"}
**Help text** – Provide guidance for content editors on how to use this property.
:::

:::Paragraph{listStyleType="disc" indent="2"}
**Sort index** – Determines the order in which properties appear in the UI.
:::

:::Paragraph{listStyleType="disc" indent="2"}
**Property Group** – Assign the property to a group to organize properties in the UI.
:::

## Implement the contract in content types

:::hint{type="info"}
**Note**
Create the properties on the content types before applying the contract.
:::

After defining the contract (*Categorizable content type*) and its properties (*Category* and *Tags*), apply it to other content types.

For example, go to the **Contracts** section of the **Blog article**, **Press release**, or **News page** content type and select **Implement** or **Inherit** for the *Categorizable content type* contract.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/lcOkeVtJkobypG5aEa1Kn_63394b41a853a8fc7a82fd4cdd9d2415380599d1f67bbd6a20135155c2d8d520-image.png)

## Graph query example based on contracts

The following GraphQL query retrieves items categorized as *"Meetup"*, including their metadata, tags, and excerpt and main body for blog articles:

```graphql
query MyQuery {
  Categorizable(where: { Category: { eq: "Meetup" } }) {
    items {
      _metadata {
        key
        displayName
      }
      Category
      Tags
      ... on BlogArticle {
        Excerpt
        MainBody
      }
    }
  }
}
```
