---
schema_version: "1"
id: 8e067b5db0e2303b90ee93fa54024b517be7e815ff83b3a6cb93daad05deff9c
title: Blocks
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-apis/blocks.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/blocks.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 479d1261cb54a61ceefe4db0e769d550b328d012c75981e692c7908fb6fb1727
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Blocks

Blocks are the simplest form of sub-content in an asset. Blocks have their own asset type, can be nested inside an asset, and have their own content and design. They can also be saved or loaded independently in Content Builder. Each block's assetType matches the individual block editing experience.

Add blocks to the asset as an object under `blocks` and to the `content` as a placeholder, where the object keys match the placeholder's `data-key` attribute. All blocks must be loaded inside of slots.

## Min, max, allowed blocks

An asset can specify the minimum and maximum number of blocks, as well as the type of blocks allowed to live under it.

Add block attributes to the asset under as number, number, and array of strings under the `minBlocks`, `maxBlocks`, and `allowedBlocks` attributes, respectively. The array holds assetType names for the allowed blocks. This example requires exactly one follow-up link of the `textblock` type and at least one author.

## Sample Asset with Blocks

```json
{
  "name": "NTO Welcome Series Email",
  "channels": {
    "email": true,
    "web": false
  },
  "views": {
    "html": {
      "content": "<!DOCTYPE html><body><div><div>Some header content</div><div data-type=\"slot\" data-key=\"firstslot\"></div><br /><div data-type=\"slot\" data-key=\"secondslot\"></div></div></body></html>",
      "slots": {
        "firstslot": {
          "content": "<div data-type=\"block\" data-key=\"block1\"></div><div data-type=\"block\" data-key=\"block2\"></div>",
          "blocks": {
            "block1": {
              "content": "123",
              "assetType": {
                "name": "freeformblock",
                "id": 195
              }
            },
            "block2": {
              "content": "234",
              "assetType": {
                "name": "htmlblock",
                "id": 197
              }
            }
          }
        },
        "secondslot": {
          "content": "<div data-type=\"block\" data-key=\"block3\"></div><div data-type=\"block\" data-key=\"block4\"></div>",
          "minBlocks": 1,
          "maxBlocks": 1,
          "allowedBlocks": ["textblock"],
          "blocks": {
            "block3": {
              "content": "345",
              "assetType": {
                "name": "textblock",
                "id": 196
              }
            }
          }
        }
      }
    },
    "text": {},
    "subjectline": {},
    "preheader": {}
  },
  "assetType": {
    "name": "templatebasedemail",
    "id": 207
  }
}
```

## Related Items

- [Asset Model](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/asset-model.md)
- [Asset Model Example](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/asset_model_examples.md)
