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

# Get Notification Content

> Retrieve the content of a notification template. The response shape depends on whether the template uses V1 (blocks/channels) or V2 (elemental) content. Use the `version` query parameter to select draft, published, or a specific historical version.



## OpenAPI

````yaml /openapi-specs/openapi.documented.yml get /notifications/{id}/content
openapi: 3.0.1
info:
  title: Courier
  description: The Courier REST API.
  version: 0.0.1
servers:
  - url: https://api.courier.com
    description: Production
security: []
paths:
  /notifications/{id}/content:
    get:
      tags:
        - Notification Templates
      summary: Get Notification Content
      description: >-
        Retrieve the content of a notification template. The response shape
        depends on whether the template uses V1 (blocks/channels) or V2
        (elemental) content. Use the `version` query parameter to select draft,
        published, or a specific historical version.
      operationId: notifications_getContent
      parameters:
        - name: id
          in: path
          description: Notification template ID (`nt_` prefix).
          required: true
          schema:
            type: string
        - name: version
          in: query
          description: >-
            Accepts `draft`, `published`, or a version string (e.g., `v001`).
            Defaults to `published`.
          required: false
          schema:
            type: string
          examples:
            published:
              value: published
              summary: Current published version (default)
            draft:
              value: draft
              summary: Current draft version
            historical:
              value: v001
              summary: Specific historical version
      responses:
        '200':
          description: Template content retrieved.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/NotificationContentGetResponse'
                  - $ref: '#/components/schemas/NotificationGetContentResponse'
              examples:
                V2Content:
                  summary: V2 elemental content response
                  value:
                    version: '2022-01-01'
                    elements:
                      - id: elem_channel_1
                        type: channel
                        checksum: abc123def456
                        locales:
                          es:
                            checksum: es_abc123
                          fr:
                            checksum: fr_abc123
                        elements:
                          - id: elem_meta_1
                            type: meta
                            checksum: meta_abc123
                          - id: elem_text_1
                            type: text
                            checksum: text_abc123
                V1Content:
                  summary: V1 blocks/channels content response (legacy)
                  value:
                    blocks:
                      - id: block_1
                        type: text
                        content: Hello
                    channels:
                      - id: channel_1
                        type: email
                    checksum: legacy_checksum
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Courier from '@trycourier/courier';

            const client = new Courier({
              apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.notifications.retrieveContent('id');

            console.log(response);
        - lang: Python
          source: |-
            import os
            from courier import Courier

            client = Courier(
                api_key=os.environ.get("COURIER_API_KEY"),  # This is the default and can be omitted
            )
            response = client.notifications.retrieve_content(
                id="id",
            )
            print(response)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trycourier/courier-go\"\n\t\"github.com/trycourier/courier-go/option\"\n)\n\nfunc main() {\n\tclient := courier.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Notifications.GetContent(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\tcourier.NotificationGetContentParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
        - lang: Java
          source: >-
            package com.courier.example;


            import com.courier.client.CourierClient;

            import com.courier.client.okhttp.CourierOkHttpClient;

            import
            com.courier.models.notifications.NotificationRetrieveContentParams;

            import
            com.courier.models.notifications.NotificationRetrieveContentResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    CourierClient client = CourierOkHttpClient.fromEnv();

                    NotificationRetrieveContentResponse response = client.notifications().retrieveContent("id");
                }
            }
        - lang: Ruby
          source: |-
            require "courier"

            courier = Courier::Client.new(api_key: "My API Key")

            response = courier.notifications.retrieve_content("id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Courier\Client;

            use Courier\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->notifications->retrieveContent('id', version: 'version');

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using Courier;

            using Courier.Models.Notifications;


            CourierClient client = new();


            NotificationRetrieveContentParams parameters = new() { ID = "id" };


            var response = await
            client.Notifications.RetrieveContent(parameters);


            Console.WriteLine(response);
        - lang: CLI
          source: |-
            courier notifications retrieve-content \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    NotificationContentGetResponse:
      title: NotificationContentGetResponse
      type: object
      description: >-
        Elemental content response for V2 templates. Contains versioned elements
        with content checksums.
      properties:
        version:
          type: string
          description: Content version identifier.
          example: '2022-01-01'
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementWithChecksums'
      required:
        - version
        - elements
    NotificationGetContentResponse:
      title: NotificationGetContentResponse
      type: object
      properties:
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/NotificationBlock'
          nullable: true
        channels:
          type: array
          items:
            $ref: '#/components/schemas/NotificationChannel'
          nullable: true
        checksum:
          type: string
          nullable: true
    NotFound:
      title: NotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    ElementWithChecksums:
      title: ElementWithChecksums
      type: object
      description: >-
        An element with its content checksum and optional nested elements and
        locale checksums.
      properties:
        id:
          type: string
        checksum:
          type: string
          description: MD5 hash of translatable content.
        type:
          type: string
          description: Element type (text, meta, action, etc.).
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementWithChecksums'
          description: Nested child elements (for group-type elements).
        locales:
          type: object
          additionalProperties:
            type: object
            properties:
              checksum:
                type: string
            required:
              - checksum
          description: Locale-specific content with checksums.
      required:
        - checksum
        - type
      additionalProperties: true
    NotificationBlock:
      title: NotificationBlock
      type: object
      properties:
        alias:
          type: string
          nullable: true
        context:
          type: string
          nullable: true
        id:
          type: string
        type:
          $ref: '#/components/schemas/BlockType'
        content:
          $ref: '#/components/schemas/NotificationContent'
          nullable: true
        locales:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NotificationContent'
          nullable: true
        checksum:
          type: string
          nullable: true
      required:
        - id
        - type
    NotificationChannel:
      title: NotificationChannel
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          nullable: true
        content:
          $ref: '#/components/schemas/NotificationChannelContent'
          nullable: true
        locales:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NotificationChannelContent'
          nullable: true
        checksum:
          type: string
          nullable: true
      required:
        - id
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
    BlockType:
      title: BlockType
      type: string
      enum:
        - action
        - divider
        - image
        - jsonnet
        - list
        - markdown
        - quote
        - template
        - text
    NotificationContent:
      title: NotificationContent
      oneOf:
        - type: string
        - $ref: '#/components/schemas/NotificationContentHierarchy'
    NotificationChannelContent:
      title: NotificationChannelContent
      type: object
      properties:
        subject:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
    NotificationContentHierarchy:
      title: NotificationContentHierarchy
      type: object
      properties:
        parent:
          type: string
          nullable: true
        children:
          type: string
          nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````