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

# List Templates

> List template drafts and published templates.

Use query params like `channel`, `status`, and `search`.

`GET /templates?channel=email&status=active&search=cart`


## OpenAPI

````yaml api-reference/openapi.json GET /templates
openapi: 3.0.1
info:
  title: Sendrealm API
  description: >-
    API for email, push, audience resources, domains, campaign drafts,
    templates, events, topics, and automations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.sendrealm.com
security:
  - bearerAuth: []
paths:
  /templates:
    get:
      summary: List templates
      parameters:
        - name: channel
          in: query
          schema:
            type: string
            enum:
              - email
              - push
        - name: status
          in: query
          schema:
            type: string
        - name: search
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Template list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplatesListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    TemplatesListResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: integer
          description: HTTP response status code
        data:
          type: array
          items:
            $ref: '#/components/schemas/TemplateSummary'
    TemplateSummary:
      allOf:
        - $ref: '#/components/schemas/Template'
        - type: object
          required:
            - current_draft_version
            - current_published_version
          properties:
            current_draft_version:
              type: object
              nullable: true
              allOf:
                - $ref: '#/components/schemas/TemplateVersion'
            current_published_version:
              type: object
              nullable: true
              allOf:
                - $ref: '#/components/schemas/TemplateVersion'
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              $ref: '#/components/schemas/JsonValue'
            issues:
              type: array
              items:
                $ref: '#/components/schemas/ValidationIssue'
    Template:
      type: object
      required:
        - id
        - name
        - description
        - channel
        - status
        - current_draft_version_id
        - current_published_version_id
        - created_at
        - updated_at
        - deleted_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
          nullable: true
        channel:
          type: string
        status:
          type: string
        current_draft_version_id:
          type: string
          format: uuid
          nullable: true
        current_published_version_id:
          type: string
          format: uuid
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: string
          format: date-time
          nullable: true
    TemplateVersion:
      type: object
      required:
        - id
        - version_number
        - channel
        - state
        - label
        - subject_template
        - preview_text
        - editor_json
        - rendered_html
        - rendered_text
        - default_locale
        - messages
        - published_at
        - restored_from_version_id
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        version_number:
          type: integer
        channel:
          type: string
        state:
          type: string
        label:
          type: string
          nullable: true
        subject_template:
          type: string
          nullable: true
        preview_text:
          type: string
          nullable: true
        editor_json:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/JsonObject'
        rendered_html:
          type: string
          nullable: true
        rendered_text:
          type: string
          nullable: true
        default_locale:
          type: string
          nullable: true
        messages:
          $ref: '#/components/schemas/JsonArray'
        published_at:
          type: string
          format: date-time
          nullable: true
        restored_from_version_id:
          type: string
          format: uuid
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    JsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
    ValidationIssue:
      type: object
      required:
        - code
        - path
        - message
      properties:
        code:
          type: string
        path:
          type: string
          nullable: true
        message:
          type: string
    JsonObject:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
    JsonArray:
      type: array
      items:
        $ref: '#/components/schemas/JsonValue'
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````