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

# Update Content Block

> This API updates the content blocks in MoEngage.

<Note>Updates are not always instant. For large content blocks, the updated state can take up to ~30 minutes to propagate to active event-triggered and flow sends. Small content blocks typically refresh near-instantly.</Note>




## OpenAPI

````yaml /api/content-blocks/content-blocks.yaml put /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](/user-guide/content/content-blocks/content-blocks).
servers:
  - url: https://api-{dc}.moengage.com/v1/external/campaigns
    description: MoEngage Content Blocks API Server
    variables:
      dc:
        default: '01'
        description: >-
          The 'dc' in the API Endpoint URL refers to the MoEngage Data Center
          (DC). MoEngage hosts each customer in a different DC. You can find
          your DC number and replace the value of 'dc' in the URL by referring
          to the DC and API endpoint mapping
          [here](/api/introduction#data-centers). Your MoEngage Data Center (DC)
          can be 01, 02, 03, 04, 05, 06, or 101.
security:
  - BasicAuth: []
tags:
  - name: Content Blocks
    description: >-
      Use these operations to programmatically fetch, create, and update
      reusable content blocks.
paths:
  /content-blocks:
    put:
      tags:
        - Content Blocks
      summary: Update Content Block
      description: >
        This API updates the content blocks in MoEngage.


        <Note>Updates are not always instant. For large content blocks, the
        updated state can take up to ~30 minutes to propagate to active
        event-triggered and flow sends. Small content blocks typically refresh
        near-instantly.</Note>
      parameters:
        - name: MOE-APPKEY
          in: header
          required: true
          schema:
            type: string
          description: >
            This is the Workspace ID of your MoEngage account that must be
            passed with the request. You can find it in the MoEngage dashboard
            at **Settings** > **Account** > **APIs** > **Workspace ID (earlier
            app id)**.
          example: YOUR_WORKSPACE_ID_XXXX
      requestBody:
        required: true
        description: The updated details for the content block.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContentBlockRequest'
            example:
              id: 634fdf4db9c206ba55b8223b
              name: Summer_Sale_Header_Updated
              status: ACTIVE
              raw_content: Massive Summer Sale!
              updated_by: abc@gmail.com
              content_block_used: []
      responses:
        '200':
          description: |
            Success. The response body is empty.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentBlockErrorResponse'
              example:
                error: Invalid Field Value
                message: 'app_key - Some of the field values are invalid: app_key : None'
                details: nGpUNpDQ
        '409':
          description: >
            Returned when the `label` provided is not unique within the
            workspace. Content block labels must be unique; use a different
            `label` value and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentBlockErrorResponse'
              example:
                error: Duplicate Label
                message: >-
                  label - A content block with this label already exists in the
                  workspace: label : summer_sale_header_2025
                details: dPQnUgNp
        5XX:
          description: Failure. Server issue
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentBlockErrorResponse'
              example:
                error: Internal Server Error
                message: An unexpected error occurred on the server.
                details: SRV_ERR_123
components:
  schemas:
    UpdateContentBlockRequest:
      title: Update Content Block Attribute Mapping
      type: object
      required:
        - id
        - name
        - status
        - raw_content
        - updated_by
      properties:
        id:
          type: string
          description: ID of the content block that you want to update
        name:
          type: string
          description: Name of the content block
        status:
          type: string
          enum:
            - ACTIVE
            - DRAFT
          description: Status of the content block - DRAFT/ACTIVE
        content_type:
          type: string
          enum:
            - HTML
            - TEXT
          description: >
            Type of the content block, set at creation time.

            <Note>`content_type` cannot be changed via this API. Including a
            different value in an update request fails with a `400` error:
            "Changing content type is not supported in update api".</Note>
        raw_content:
          type: string
          description: >
            Content of the content block.

            <Note>`ContentApi.*` Jinja calls are not supported in `raw_content`.
            Using them will cause the request to fail with a `400` error.</Note>
        description:
          type: string
          description: Description of the content block
        updated_by:
          type: string
          format: email
          description: Email id of the user who is updating the content block
        tag_ids:
          type: array
          items:
            type: string
          description: Tags associated to 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>Pass the internal team ID (for example,
            `69fb3d7d66ea00bdb35da08e`), not the team's display name. For more
            information, refer to
            [Teams](/user-guide/settings/account/team-management/teams-in-moengage).</Note>
        content_block_used:
          type: array
          items:
            type: string
          default: []
          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: object
          description: An image referenced within the content block.
          required:
            - name
            - link
          properties:
            name:
              type: string
              description: Name of the image.
            link:
              type: string
              format: uri
              description: URL of the image.
            info:
              type: string
              description: Additional information about the image (optional).
        content_json:
          type: object
          description: >
            Structured JSON representation of the content block's content, as
            used by the drag-and-drop builder on the MoEngage dashboard.

            <Note>This field is optional and currently populated by the MoEngage
            dashboard for content blocks built visually. It is not required when
            creating a content block via this API using `raw_content`.</Note>
    ContentBlockErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Invalid Field Value
        message:
          type: string
          example: 'app_key - Some of the field values are invalid: app_key : None'
        details:
          type: string
          example: nGpUNpDQ
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >
        Authentication is done via Basic Auth. This requires a base64-encoded
        string of your credentials in the format 'username:password'.


        - **Username**: Use your MoEngage workspace ID (also known as the App
        ID). You can find it in the MoEngage dashboard at **Settings** >
        **Account** > **APIs** > **Workspace ID (earlier app id)**.

        - **Password**: Use your API Key, which you can find within the
        **Campaign report/Business events/Custom templates/Catalog API/Inform
        Report** tile.


        For more information on authentication and getting your credentials,
        refer
        [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials).

````