# Content Type

The CDA (Content Delivery API) is a read-only API that delivers published resources to public visitors. This page covers how to read a published *Content Type*, the template (schema) that a *Content* follows. By reading this template through CDA, which fields it has and, for each field, its type, whether it is localized, whether it is required, and its validation rules, you can know in advance the shape of the published *Content* that follows the template.

CDA has only read (GET) endpoints; creating, editing, and publishing a *Content Type* is the responsibility of [CMA Content Type](/api/reference/cma/content-type.md). For CDA's common behavior, such as authentication and the published delivery model (the published snapshot, `revision`, and published-only visibility), see the [CDA overview](/api/reference/cda.md). A *Content Type* is a template schema, so its reads do not take a `locale` parameter.

## Resource structure {#resource-structure}

The following is how CDA delivers, in a single read, the published *Content Type* "Product" from the demo *Space*. Along with `sys` (system properties), it has body properties such as `name`, `displayField`, `publishWithAuthor`, and `fields`.

```json
{
  "sys": {
    "id": "3trmXRM3RqbgSnifyg7PAmlxvX4fGY",
    "type": "ContentType",
    "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
    "createdAt": "2026-06-17T16:22:01.047Z",
    "updatedAt": "2026-06-18T03:05:11.424Z",
    "revision": 7
  },
  "name": "Product",
  "displayField": "productName",
  "fields": [
    { "id": "3hzbux8gsnb4h", "name": "Product Name", "apiName": "productName", "type": "ShortText", "localized": true, "required": true, "validations": [], "disabled": false },
    { "id": "4usptben4t1z", "name": "Price", "apiName": "price", "type": "Long", "localized": false, "required": false, "validations": [], "disabled": false },
    { "id": "21zuem8be6o6j", "name": "Description", "apiName": "description", "type": "RichText", "localized": true, "required": false, "validations": [], "disabled": false },
    { "id": "2mr5ylgtheegr", "name": "Photo", "apiName": "photo", "type": "Refer", "localized": false, "required": false, "validations": [], "disabled": false, "targetType": "Media" },
    {
      "id": "5bpmiwo2woq8",
      "name": "Brand",
      "apiName": "brand",
      "type": "Refer",
      "localized": false,
      "required": false,
      "validations": [
        { "referContentType": [ { "sys": { "id": "3trmXRM3RqbgSnifyg7PLjv7PDSdHg", "type": "Refer", "targetType": "ContentType" } } ] }
      ],
      "disabled": false,
      "targetType": "Content"
    }
  ],
  "publishWithAuthor": false
}
```

Key properties:

- `sys.id`: The unique identifier of the *Content Type*. It goes into `{contentTypeId}` in the single-read path.
- `sys.revision`: The version at the time it was published. Because CDA does not carry the management `version`, `revision` is the only value that points to the published version.
- `name`: The name of the *Content Type* (e.g. `Product`).
- `displayField`: The `apiName` of the field used to represent each *Content* in the content studio list (e.g. `productName`).
- `publishWithAuthor`: Whether to include author information when a *Content* is published (`false` in the example).
- `fields`: The list of fields this template defines. The structure of each entry is described in [Fields](#fields) below.

## System properties (sys) {#system-properties-sys}

The `sys` of a published *Content Type* carries only properties for the published snapshot. `space`, `createdBy`, and `updatedBy` are in the `Refer` shape (`{ "sys": { "id", "type": "Refer", "targetType" } }`).

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique resource identifier. |
| `type` | string | Resource kind. For a *Content Type* this is always `"ContentType"`. |
| `space` | Refer&lt;Space&gt; | The *Space* this *Content Type* belongs to. |
| `createdAt` | string (date-time) | Creation time. |
| `updatedAt` | string (date-time) | Last update time. |
| `revision` | integer | The version at the time it was published. Each publish records the version at that moment here. |
| `createdBy` | Refer&lt;User&gt; | The user who created it. Included only when the *Content Type*'s `publishWithAuthor` is on. |
| `updatedBy` | Refer&lt;User&gt; | The user who last updated it. Included only when `publishWithAuthor` is on. |

Because this is a published snapshot, the `version`, `status`, `publish`, and `archive` found in CMA's `sys` are not carried. `revision` is the only value that points to the published version.

## Fields {#fields}

`fields` is the list of fields this *Content Type* defines. Each entry has the following structure (FieldDefinition).

| Key | Type | Description |
|---|---|---|
| `id` | string | The unique identifier of the field. |
| `name` | string | The field name shown in the content studio (e.g. `Product Name`). |
| `apiName` | string | The key that refers to this field in the API. The published *Content*'s `fields` also reads values by this key. |
| `type` | string (enum) | The type of the field. See [Field types (type)](#field-types-type) below. |
| `localized` | boolean | Whether it can hold multilingual values. |
| `required` | boolean | Whether input is required. |
| `validations` | array | The list of validation rules applied to the value. An empty array `[]` if there are no rules. |
| `disabled` | boolean | Whether it is disabled. |
| `targetType` | string (enum) | Only when `type` is `Refer`. Whether the reference target is `Content` or `Media`. |
| `items` | object | Only when `type` is `Array`. The definition of the array elements (a `Refer` element or a `ShortText` element). |

### Field types (type) {#field-types-type}

`type` determines how the value is stored and retrieved. Some types behave differently in search.

| `type` | Meaning | Notes |
|---|---|---|
| `ShortText` | Short single-line text. | Suited for exact keyword lookup. |
| `LongText` | Long body text. | Supports full-text similarity search. |
| `RichText` | Formatted body. | Not searchable; used for formatted presentation. |
| `Long` | Integer. | Example: price `price`. |
| `Number` | Real number (including decimals). | |
| `Boolean` | True/false. | |
| `Date` | Date and time. | |
| `Json` | Arbitrary JSON structure. | |
| `Location` | Location (coordinates). | |
| `Refer` | A reference pointing to another resource. | Specify `Content` or `Media` with `targetType`. |
| `Array` | An array holding multiple values. | Accompanied by an element definition in `items`. |

In the "Product" example, `Product Name` is `ShortText`, `Price` is `Long`, `Description` is `RichText`, `Photo` is `Refer` (`targetType: Media`), and `Brand` is `Refer` (`targetType: Content`). The `Brand` field uses `referContentType` in `validations` to restrict references to only *Content* of a specific *Content Type* (here, "Brand", whose `sys.id` is `3trmXRM3RqbgSnifyg7PLjv7PDSdHg`).

The full catalog of validation rule keys usable in `validations` is documented in [CMA Content Type](/api/reference/cma/content-type.md#validations). The published snapshot that CDA delivers carries the same structure unchanged.

## API {#api}

The base URL for the two endpoints below is `https://cda.weegloo.com/v1`, and a Bearer token that authenticates against CDA is required in the `Authorization` header. Because a *Content Type* is a template (schema) and is not subject to value resolution, it does not accept the `locale` query parameter, unlike a *Content* read.

```api-endpoint
{
  "title": "List published Content Types",
  "method": "GET",
  "path": "/spaces/{spaceId}/content-types",
  "description": "Reads the list of published Content Types in a Space, page by page. Only published items are included; unpublished Content Types are not.",
  "responseStatus": 200,
  "baseUrl": "https://cda.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true }
  },
  "queryParameterSchema": {
    "limit": { "type": "integer", "description": "Number of items to return per page (1-100)", "default": 15 },
    "skip": { "type": "integer", "description": "Number of items to skip", "default": 0 },
    "next": { "type": "string", "description": "Next page cursor (the value obtained from links.next in the previous response)" },
    "prev": { "type": "string", "description": "Previous page cursor (the value obtained from links.prev in the previous response)" },
    "order": { "type": "string", "description": "Sort criteria. Comma-separated for multi-level sorting (e.g. sys.createdAt,sys.id)", "default": "sys.createdAt,sys.id" },
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 },
    "select": { "type": "string", "description": "Fields to include (sys.id,sys.createdAt) or exclude (-sys.id). Do not mix include and exclude." }
  },
  "additionalQueryParams": true,
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CDA authentication; usually a DeliveryAccessToken)" }
  },
  "responseExample": {
    "sys": { "type": "TotalPageResponse" },
    "limit": 15,
    "totalCount": 3,
    "items": [
      {
        "sys": {
          "id": "3trmXRM3RqbgSnifyg7PAmlxvX4fGY",
          "type": "ContentType",
          "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
          "createdAt": "2026-06-17T16:22:01.047Z",
          "updatedAt": "2026-06-18T03:05:11.424Z",
          "revision": 7
        },
        "name": "Product",
        "displayField": "productName",
        "fields": [
          { "id": "3hzbux8gsnb4h", "name": "Product Name", "apiName": "productName", "type": "ShortText", "localized": true, "required": true, "validations": [], "disabled": false },
          { "id": "4usptben4t1z", "name": "Price", "apiName": "price", "type": "Long", "localized": false, "required": false, "validations": [], "disabled": false },
          { "id": "21zuem8be6o6j", "name": "Description", "apiName": "description", "type": "RichText", "localized": true, "required": false, "validations": [], "disabled": false },
          { "id": "2mr5ylgtheegr", "name": "Photo", "apiName": "photo", "type": "Refer", "localized": false, "required": false, "validations": [], "disabled": false, "targetType": "Media" },
          { "id": "5bpmiwo2woq8", "name": "Brand", "apiName": "brand", "type": "Refer", "localized": false, "required": false, "validations": [ { "referContentType": [ { "sys": { "id": "3trmXRM3RqbgSnifyg7PLjv7PDSdHg", "type": "Refer", "targetType": "ContentType" } } ] } ], "disabled": false, "targetType": "Content" }
        ],
        "publishWithAuthor": false
      },
      {
        "sys": {
          "id": "3trmXRM3RqbgSnifyg7PLjv7PDSdHg",
          "type": "ContentType",
          "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
          "createdAt": "2026-06-18T01:57:26.377Z",
          "updatedAt": "2026-06-18T01:57:26.377Z",
          "revision": 1
        },
        "name": "Brand",
        "displayField": "brandName",
        "fields": [
          { "id": "31byfj01w9fav", "name": "Brand name", "apiName": "brandName", "type": "ShortText", "localized": true, "required": true, "validations": [], "disabled": false },
          { "id": "1j6wqqeyg2jws", "name": "Description", "apiName": "brandIntro", "type": "RichText", "localized": true, "required": false, "validations": [], "disabled": false }
        ],
        "publishWithAuthor": false
      }
    ],
    "links": { "self": "/v1/spaces/tcq4V2Xb/content-types" }
  }
}
```

```api-endpoint
{
  "title": "Read a single published Content Type",
  "method": "GET",
  "path": "/spaces/{spaceId}/content-types/{contentTypeId}",
  "description": "Reads one published Content Type by sys.id. An unpublished Content Type is not delivered.",
  "responseStatus": 200,
  "baseUrl": "https://cda.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true },
    "contentTypeId": { "type": "string", "description": "The sys.id of the Content Type", "required": true }
  },
  "queryParameterSchema": {
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CDA authentication; usually a DeliveryAccessToken)" }
  },
  "responseExample": {
    "sys": {
      "id": "3trmXRM3RqbgSnifyg7PAmlxvX4fGY",
      "type": "ContentType",
      "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
      "createdAt": "2026-06-17T16:22:01.047Z",
      "updatedAt": "2026-06-18T03:05:11.424Z",
      "revision": 7
    },
    "name": "Product",
    "displayField": "productName",
    "fields": [
      { "id": "3hzbux8gsnb4h", "name": "Product Name", "apiName": "productName", "type": "ShortText", "localized": true, "required": true, "validations": [], "disabled": false },
      { "id": "4usptben4t1z", "name": "Price", "apiName": "price", "type": "Long", "localized": false, "required": false, "validations": [], "disabled": false },
      { "id": "21zuem8be6o6j", "name": "Description", "apiName": "description", "type": "RichText", "localized": true, "required": false, "validations": [], "disabled": false },
      { "id": "2mr5ylgtheegr", "name": "Photo", "apiName": "photo", "type": "Refer", "localized": false, "required": false, "validations": [], "disabled": false, "targetType": "Media" },
      { "id": "5bpmiwo2woq8", "name": "Brand", "apiName": "brand", "type": "Refer", "localized": false, "required": false, "validations": [ { "referContentType": [ { "sys": { "id": "3trmXRM3RqbgSnifyg7PLjv7PDSdHg", "type": "Refer", "targetType": "ContentType" } } ] } ], "disabled": false, "targetType": "Content" }
    ],
    "publishWithAuthor": false
  }
}
```

## Related documents {#related-documents}

- [CMA Content Type](/api/reference/cma/content-type.md): The management API for creating and editing a Content Type (including the full spec of field types and validations).
- [CDA Content](/api/reference/cda/content.md): Receiving the published Content that follows this template.
- [States and publishing (concept)](/getting-started/core-concepts/common/states-and-versions.md): What publishing and versions mean.
