---
schema_version: "1"
id: 4d6bdb4a29ef025dcd258c3bb41539d1501a709d5ace926e0c9e73ce13803550
title: JSON File Format for Content in Salesforce CMS
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/cms_import_content_json.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.cms_import_content_json.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d767ba16b17dcb9f4b3c690d93677c5900942ab7989a11446187bc107387f76b
description: Understand the content details from an export, then define your content details in JSON format to import content into a CMS workspace.
products:
  - Salesforce CMS
  - Cross Cloud
release: "264"
---
# JSON File Format for Content in Salesforce CMS

Understand the content details from an export, then define your content details in JSON format to import content into a CMS workspace.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

## Content Properties

The format of the JSON file depends on the content type—image, news, or custom content. Each one has different properties.

Here’s an example of the `JSON` structure for importing mixed content items in an array.

```javascript
{
    "content": [{
            "contentKey": "MC4NFMB52LHFFWPNFNKHQJHLFBQM",
            "type": "cms_image",
            "urlName": "content1a",
            "body": {
                "title": "My Image",
                "altText": "My Image",
                "thumbUrl": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA",
                "source": {
                    "url": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA}"
                }
            }
        },
        {
            "contentKey": "MC4NFMB52LHFFWPNFNKHQKJLMNFR",
            "type": "news",
            "urlName": "content2a",
            "body": {
                "title": "My News Item",
                "body": "<p>This is the body of my news item, which includes an uploaded banner image.</p>",
                "bannerImage": {
                    "ref": "MCFQ2WJD3O6NGCXOI3DIOF4RJQOI"
                },
                "excerpt": "This is a summary of my news item."
            }
        }
    ]
}
```

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-communities_managed_content-264-0-0-production-enus/8b149fc1-875c-4018-8e9e-2843a2196457/images/icon_tip.png)

Tip You can omit optional fields from the JSON.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d6467e78">Field Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d6467e80">Type</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d6467e82">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e78 "><code>body</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e80 "><code>body</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e82 ">
              <p>Required. Includes properties that define the body of the content item. Body
                properties differ by content type. </p>
              <ul>
                <li><a href="#cms_import_content_json__contentbody">cms_image body</a></li>
                <li><a href="#cms_import_content_json__news_properties">news
                    body</a></li>
                <li><a href="#cms_import_content_json__custom_content_body">custom content body</a></li>
              </ul>
            </td>
          </tr>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e78 "><code>contentKey</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e80 ">string</td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e82 ">A unique identifier generated by Salesforce CMS. This field isn’t required for
              import, but if it’s omitted or left empty, a new content key is assigned to the
              content after import. Content exported from Salesforce CMS includes this
              identifier.</td>
          </tr>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e78 "><code>type</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e80 ">string</td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e82 ">
              <p>Required. Defines the content type. Valid values depend on the content type.</p>
              <ul>
                <li><code>cms_image</code> for images</li>
                <li><code>news</code> for news</li>
                <li>For custom content types, any value as defined by the user. For example,
                  <code>blog</code>.
                </li>
              </ul>
            </td>
          </tr>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e78 "><code>urlName</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e80 ">string</td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e82 ">
              <p>Optional. Text for the link to the URL. Valid format: </p>
              <ul>
                <li>Doesn’t include null, empty, or white space.</li>
                <li>Doesn’t begin or end with a hyphen.</li>
                <li>All letters are lowercase.</li>
                <li>Ends with a lowercase letter.</li>
                <li>Doesn’t have groups of contiguous non-letters, decimal digits, marks, and
                  hyphens. Replace with a single hyphen.</li>
              </ul>
            </td>
          </tr>
        </tbody>
      </table>

## `cms_image` Body Properties

The `cms_image` type has these body properties.

  
| Field Name | Type | Description |
| --- | --- | --- |
| `altText` | string | Optional. Accessibility text to describe the content. |
| `source` | [source](#cms_import_content_json__image_body_source) | Required. An image node (`IMG`). |
| `thumbUrl` | string | Optional. URL address of the thumbnail image. |
| `title` | string | Required. The title of the content item. This node is a name field (`NAMEFIELD`). |

`**source**`

The `source` field represents an image node (`IMG`) within the `cms_image` content type. At least one source field is required.

  
| Field Name | Type | Description |
| --- | --- | --- |
| `ref` | string | Required. File path of the image in the media folder of the .zip archive, or the content key of the image. |
| `url` | string | Required. URL address of the image. Valid URL bases are `http://` or `https://`. |

Here’s an example of the `JSON` structure for importing several images in an array. Salesforce CMS assigns a content key to new content after import.

```javascript
{
    "content": [{
            "type": "cms_image",
            "urlName": "lampplus",
            "body": {
                "title": "Uttermost Rovasenda Pale Mint Green Ceramic Table Lamp",
                "altText": "Uttermost Rovasenda Pale Mint Green Ceramic Table Lamp",
                "thumbUrl": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA",
                "source": {
                    "url": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA}"
                }
            }
        },
        {
            "type": "cms_image",
            "urlName": "lampplus",
            "body": {
                "title": "Modern Table Lamps Set of 2 with USB Gold Metal for Living Room Bedroom Bedside",
                "altText": "Modern Table Lamps Set of 2 with USB Gold Metal for Living Room Bedroom Bedside",
                "thumbUrl": "https://myimageurl.com/images/g/wP8AAOSw3S1ct-iC/s-l640.jpg",
                "source": {
                    "url": "https://myimageurl.com/images/g/wP8AAOSw3S1ct-iC/s-l640.jpg"
                }
            }
        },
        {
            "type": "cms_image",
            "urlName": "lampplus",
            "body": {
                "title": "Hanging Pendant Lamp with Bluetooth Accessibility",
                "altText": "Hanging Pendant Lamp with Bluetooth Accessibility",
                "source": {
                    "ref": "SummerCampaign/Sale/hangingpendantlamp.png"
                }
            }
        }
    ]
}
```

## `news` Body Properties

The `news` type has these body properties.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d6467e294">Field Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d6467e296">Type</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d6467e298">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e294 "><code>bannerImage</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e296 "><a href="#cms_import_content_json__news_bannerImage">bannerImage</a></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e298 ">Optional. An image node (<code>IMG</code>) to
              display a graphic as a banner in the news item.</td>
          </tr>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e294 "><code>body</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e296 ">string</td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e298 ">
              <p>Optional. A rich text node (<code>RTE</code>) with text to describe the banner
                image.</p>
              <p style="margin-bottom:0;">Can also include references to the Salesforce managed
                content ID (MCID) or content key of an image. The graphic for
                this reference must be imported and available in Salesforce CMS
                before the news content piece can be imported.</p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Field Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e294 "><code>excerpt</code></td>
            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e296 ">string</td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d6467e298 ">Optional. Used to summarize the news piece. This node is a multi-line text
              (<code>MTEXT</code>).</td>
          </tr>
        </tbody>
      </table>

`**bannerImage**`

The `bannerImage` field represents an image node (`IMG`) within the `news` content type.

  
| Field Name | Type | Description |
| --- | --- | --- |
| `ref` | string | Optional. Salesforce managed content ID (MCID) or content key of an image. The graphic for this reference must be imported and available in Salesforce CMS before the news content piece can be imported. |

Here’s an example of the JSON structure for a news item that references an image by using the image’s content key.

```javascript
{
"content":[
    {
    "contentKey":"MC4NFMB52LHFFWPNFNKHQJHLFBQM",
    "type":"news",
    "urlName":"content1a",
    "body":{
        "title":"Content1", 
        "body":"<p>This is body with uploaded banner1.<\/p>", 
        "bannerImage": {
            "ref":"MCFQ2WJD3O6NGCXOI3DIOF4RJQOI"
            },
        "excerpt":"This is a summary of my news item."
        }
    }]
}
```

Here’s an example of the JSON structure for a news item that references an image in the rich text editor (RTE).

```javascript
{
    "content": [{
        "contentKey": "MC4NFMB52OSDINTHIFEGINBVWTHY",
        "type": "news",
        "urlName": "content2a",
        "body": {
            "title": "Content 2",
            "body": "<p>This is body with an image reference inline.<\/p> <p><br><\/p> <p><img data-fileid="20YRM0000004MyW" data-cms-filename="SalesforceLogo.png"><\/img><\/p> <iframe frameborder="0" scrolling="auto" allowfullscreen="true" src="https:\/\/www.youtube.com\/embed\/X1XM4PwKVn0?showinfo=0" width="560px" height="315px"><\/iframe> <p><br><\/p>",
            "excerpt": "This is a summary of my news item."
        }
    }]
}
```

Here’s an example of the JSON structure for a news item that references an image by using the content key in the rich text editor (RTE).

{

"content": \[{

"contentKey": "MC8HYNJ89QAZXSWEDCVFRTGBNHYU",

"type": "news",

"urlName": "content3a",

"body": {

"title": "Content 3",

"body": "<img src=’ ‘ data-contentKey=’ ‘MCFQ2WJD3O6NGCXOI3DIOF4RJQOI’>",

"excerpt": "This excerpt is a summary of my news item."

}

}\]

}

## Custom Content Body Properties

Your content needs a name, but the rest of the content type properties are up to you. You can set any nodes depending on the type of content that you want to import. Here are some example properties.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-communities_managed_content-264-0-0-production-enus/8b149fc1-875c-4018-8e9e-2843a2196457/images/icon_note.png)

Note For custom content type, all optional fields can be defined as required.

  
| Example Field Name | Type | Description |
| --- | --- | --- |
| `dateNode` | string | Optional. Date node (`DATE`). Valid format is yyyy-MM-dd. |
| `dateTimeNode` | [dateTimeNode](#cms_import_content_json__customdatetimenode) | Optional. Datetime node (`DATETIME`). Defines the body of the date, time, and time zone of the content. |
| `nameNode` | string | Required. The name field node (`NAMEFIELD`) is a free text field. |
| `urlNode` | string | Optional. URL address of the content. |

`**dateTimeNode**`

The `dateTimeNode` field represents a managed content date and time node (`DateTime`) within the custom content type.

  
| Field Name | Type | Description |
| --- | --- | --- |
| `dateTimeValue` | string | Optional. Valid format is yyyy-MM-dd'T'HH:mm:ss.SSS'Z' (UTC datetime in ISO 8601 format). Valid format for the date is YYYY-MM-DD. Valid format for the time is 24-hour style. |
| `timeZone` | string | Optional. Valid format is Country/City. |

Here’s an example of the JSON structure for importing a custom content item. Salesforce CMS assigns a content key after import.

```javascript
{
    "content": [{
        "type": "customContentType",
        "body": {
            "nameNode": "CustomContentImportTest",
            "urlNode": "http://www.exampletube.com/myVideo",
            "dateNode": "1994-07-01",
            "dateTimeNode": {
                "dateTimeValue": "2008-09-15T15:53:00.000Z",
                "timeZone": "America/Los_Angeles"
            }
        }
    }]
}
```

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-communities_managed_content-264-0-0-production-enus/8b149fc1-875c-4018-8e9e-2843a2196457/images/icon_note.png)

Note Sometimes, the JSON file might start with a hidden character called a byte order mark. This character is not visible in all text editors and it can cause the import to fail with a file read error. To fix this, save the file using a text editor that lets you choose the encoding UTF-8.

#### See Also

- [JSON File Format for Content in an Enhanced CMS Workspace](https://help.salesforce.com/s/articleView?id=xcloud.cms_import_content_json_enhanced.htm&release=264.0.0&type=5 "Understand the content details from an export, then define your content details in JSON format for import. The export and import process works differently in enhanced CMS workspaces than it does in CMS workspaces. In enhanced CMS workspaces, each content item must have its own content.json file. Optionally, to specify the content key and folder placement of each content item, include a _meta.json file for each content.json.")
- [Import Content into Salesforce CMS](https://help.salesforce.com/s/articleView?id=xcloud.cms_import_content.htm&release=264.0.0&type=5 "Import images, news, documents, or custom content types into a CMS workspace or an enhanced CMS workspace by uploading a .zip archive of JSON files. Transfer content from an external source or CMS, or mass-import images from an external digital asset manager (DAM), for product enrichment.")