> ## 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.




## 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.
      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: <h1>Massive Summer Sale!</h1>
              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/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:
    UpdateContentBlockRequest:
      title: Update Content Block Attribute Mapping
      type: object
      required:
        - id
        - name
        - status
        - raw_content
        - updated_by
        - content_block_used
      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
        raw_content:
          type: string
          description: Content of the content block
        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>For more information, refer to
            [Teams](/user-guide/settings/account/team-management/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:
    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).

````