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

# Get Specific Content Blocks

> You can use this API to get specific content blocks from the available content blocks in your MoEngage account.




## OpenAPI

````yaml /api/content-blocks/content-blocks.yaml post /content-blocks/get-by-ids
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/get-by-ids:
    post:
      tags:
        - Content Blocks
      summary: Get Specific Content Blocks
      description: >
        You can use this API to get specific content blocks from the available
        content blocks in your MoEngage account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetByIdsRequest'
            example:
              ids:
                - 634fdf4db9c206ba55b8223b
              is_raw_content_required: true
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetByIdsListResponse'
              example:
                data:
                  - id: 634fdf4db9c206ba55b8223ab
                    name: Contentblocktest2
                    label: Contentblocktest2
                    description: ''
                    content_type: TEXT
                    content: aa
                    raw_content: aa
                    status: ACTIVE
                    created_by: user@email.com
                    created_at: '2022-10-19T11:28:13.925000'
                    updated_by: test
                    updated_at: '2022-10-21T08:38:51.419000'
                    tag_ids:
                      - '0'
                    team_ids:
                      - test
                    images_used: []
        '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:
    GetByIdsRequest:
      type: object
      required:
        - ids
      properties:
        ids:
          type: array
          items:
            type: string
          description: Comma-separated list of the content block ids
        is_raw_content_required:
          type: boolean
          description: >
            Boolean Flag used to control whether we need to show raw content or
            not.

            * `True`: Returns Non-Personalized content which was given during
            creation. * `False`: Does not return Personalized content
          default: false
    GetByIdsListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GetByIdsResponseContentBlock'
    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
    GetByIdsResponseContentBlock:
      type: object
      description: Attribute Mapping for Get Specific Content Blocks 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
        label:
          type: string
          description: Label 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
        raw_content:
          type: string
          description: >-
            Raw content of the content block. This is returned when
            is_raw_content_required=true is passed in the request.
        created_by:
          type: string
          description: Email id of the user who created the content block
        status:
          type: string
          description: Shows the status of 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](https://help.moengage.com/hc/en-us/articles/360028586211-Teams-in-MoEngage).
        images_used:
          type: array
          items:
            type: string
          description: Images used in content block
  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**.

````