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

# Search Content Blocks

> This API searches for the available content blocks in your MoEngage account.




## OpenAPI

````yaml /api/content-blocks/content-blocks.yaml post /content-blocks/search
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/search:
    post:
      tags:
        - Content Blocks
      summary: Search Content Blocks
      description: >
        This API searches for the available content blocks in your MoEngage
        account.
      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: A set of filters to apply to the search.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchContentBlockRequest'
            example:
              filters:
                content_type:
                  - TEXT
                team_ids:
                  - '0'
                tag_ids:
                  - 6141c7ec9b4cbd0b57c872e5
                status:
                  - ACTIVE
                updated_by:
                  - geetima@moengage.com
                search_text: BT_non_personaliation
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchContentBlockListResponse'
              example:
                data:
                  - id: 61dd90a4cdfd67a8d48ef681
                    name: BT_non_personaliation
                    label: BT_non_personaliation
                    description: BT_non_personaliation
                    content_type: TEXT
                    status: ACTIVE
                    created_by: geetima@moengage.com
                    created_at: '2022-01-11T14:13:56.063000'
                    updated_by: geetima@moengage.com
                    updated_at: '2022-01-11T14:15:31.254000'
                    tag_ids:
                      - 6141c7ec9b4cbd0b57c872e5
                      - 61409d091202397cc82f8356
                    team_ids:
                      - '0'
        '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:
    SearchContentBlockRequest:
      type: object
      properties:
        filters:
          type: object
          description: >
            A set of filters to apply to the search.

            <Note>You can send empty filters if you want all the content blocks:
            `{ "filters" : {} }`</Note>
          properties:
            content_type:
              type: array
              items:
                type: string
                enum:
                  - HTML
                  - TEXT
              description: Type of the content block - HTML/Text
            team_ids:
              type: array
              items:
                type: string
              description: >
                Name of the teams for which the content block is enabled. This
                is only applicable to the accounts where Teams is enabled. For
                more information, refer to
                [Teams](/user-guide/settings/account/team-management/teams-in-moengage).
            tag_ids:
              type: array
              items:
                type: string
              description: Ids of the tags
            status:
              type: array
              items:
                type: string
                enum:
                  - ACTIVE
                  - ARCHIVED
              description: Status of the content block
            updated_by:
              type: array
              items:
                type: string
                format: email
              description: Email id of the user who updated the content block
            search_text:
              type: string
              description: You can use this to search content block by content block name
    SearchContentBlockListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SearchResponseContentBlock'
    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
    SearchResponseContentBlock:
      type: object
      description: Attribute Mapping for Search Response
      properties:
        id:
          type: string
          description: Content block id that was passed in the request
        name:
          type: string
          description: Name of the content block
        description:
          type: string
          description: Description of the content block
        content_type:
          type: string
          description: Type of the content block - HTML/Text
        content:
          type: string
          description: Content of the content block
        created_by:
          type: string
          description: Email id of the user who created the content block
        created_at:
          type: string
          description: Date Time of the content block creation
        updated_by:
          type: string
          description: Email id of the user who updates the content block
        updated_at:
          type: string
          description: Date Time of the content block update
        tag_ids:
          type: array
          items:
            type: string
          description: Tags associated with the content block
        team_ids:
          type: array
          items:
            type: string
          description: >
            Name of the teams for which the content block is enabled. This is
            only applicable to the accounts where Teams is enabled. For more
            information, refer to
            [Teams](/user-guide/settings/account/team-management/teams-in-moengage).
  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).

````