> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Content Block

> You can use this API to create a content block in MoEngage.




## OpenAPI

````yaml /api/content-blocks/content-blocks.yaml post /content-blocks
openapi: 3.0.3
info:
  title: MoEngage Content Block API
  version: '1.0'
  description: >
    Content blocks allow marketers to reuse the same content across multiple
    campaigns. For example, a block might be a repeatedly used header, footer,
    or designed call-to-action button.



    This API enables you to fetch, create, and update content blocks on your
    MoEngage dashboard. [Read more about Content blocks in
    MoEngage](https://help.moengage.com/hc/en-us/articles/4414768369172-Content-blocks-).
servers:
  - url: https://api-0{dc}.moengage.com/v1/external/campaigns
    description: MoEngage Content Blocks API Server
    variables:
      dc:
        default: '1'
        description: >-
          Your MoEngage Data Center (DC). Replace {dc} with 1, 2, 3, etc. (e.g.,
          api-01, api-02).
        enum:
          - '1'
          - '2'
          - '3'
          - '4'
security:
  - moeAppKey: []
tags:
  - name: Content Blocks
    description: >-
      Use these operations to programmatically fetch, create, and update
      reusable content blocks.
paths:
  /content-blocks:
    post:
      tags:
        - Content Blocks
      summary: Create Content Block
      description: |
        You can use this API to create a content block in MoEngage.
      requestBody:
        required: true
        description: The details of the content block to be created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContentBlockRequest'
            example:
              name: Summer_Sale_Header
              label: summer_sale_header_2025
              description: Header for all summer sale communications
              content_type: HTML
              raw_content: <h1>Huge Summer Sale!</h1>
              images_used: []
              status: ACTIVE
              created_by: marketing@example.com
              content_block_used: []
      responses:
        '202':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                title: Invalid Field Value
                description: 'app_key - Some of the field values are invalid: app_key : None'
                code: nGpUNpDQ
        5XX:
          description: Failure. Server issue
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                title: Internal Server Error
                description: An unexpected error occurred on the server.
                code: SRV_ERR_123
components:
  schemas:
    CreateContentBlockRequest:
      title: Create Content Block Attribute Mapping
      type: object
      required:
        - name
        - label
        - raw_content
        - content_type
        - created_by
        - content_block_used
      properties:
        name:
          type: string
          description: Name of the content block
        label:
          type: string
          description: Label to uniquely identify your content block
        status:
          type: string
          enum:
            - ACTIVE
            - DRAFT
          description: Shows the status of the content block
        raw_content:
          type: string
          description: Content of the content block
        content_type:
          type: string
          enum:
            - HTML
            - TEXT
          description: Type of the content block - HTML/ Plain Text
        description:
          type: string
          description: Description of the content block
        created_by:
          type: string
          format: email
          description: Email id of the user who is creating the content block
        tag_ids:
          type: array
          items:
            type: string
          description: Tags associated with the content block
        team_ids:
          type: array
          items:
            type: string
          description: >
            Teams for which the content block should be available. Passing team
            id is mandatory if you are using multiple teams. 

            <Note>For more information, refer to
            [Teams](https://help.moengage.com/hc/en-us/articles/360028586211-Teams-in-MoEngage).</Note>
        content_block_used:
          type: array
          items:
            type: string
          description: >
            In case, you are using nested content blocks, provide the names of
            the other content blocks used in this content block.

            <Note>If you are not using nested content blocks, you can pass this
            as an empty array: `content_block_used : []`</Note>
        images_used:
          type: array
          items:
            type: string
            format: uri
          description: Images used in content block
    ErrorResponse:
      type: object
      properties:
        title:
          type: string
          example: Invalid Field Value
        description:
          type: string
          example: 'app_key - Some of the field values are invalid: app_key : None'
        code:
          type: string
          example: nGpUNpDQ
  securitySchemes:
    moeAppKey:
      type: apiKey
      in: header
      name: MOE-APPKEY
      description: >
        Your MoEngage Workspace ID (App Key). You can find this at **Settings**
        -> **Account** -> **APIs** -> **Workspace ID**.

````