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

# List email templates

> List email templates with filtering, sorting, and pagination. Supports minimal data mode. Non-minimal responses include name, subject, tags, type (Branded/Text), created_at, attachments, n_attachments, and n_bulk_sends (counted from email_bulk_sends).



## OpenAPI

````yaml /api-reference/cx/swagger.json post /library/email_template/_list
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /library/email_template/_list:
    post:
      tags:
        - library
      summary: List email templates
      description: >-
        List email templates with filtering, sorting, and pagination. Supports
        minimal data mode. Non-minimal responses include name, subject, tags,
        type (Branded/Text), created_at, attachments, n_attachments, and
        n_bulk_sends (counted from email_bulk_sends).
      parameters:
        - description: Return minimal data (set to any value)
          name: minimal
          in: query
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_library_email_templates.ListEmailTemplatesRequest
        description: List email templates request
        required: true
      responses:
        '200':
          description: Email templates list
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_library_email_templates.ListEmailTemplatesResponse
        '400':
          description: Bad request - invalid request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_library_email_templates.ListEmailTemplatesRequest:
      type: object
      properties:
        filters:
          $ref: >-
            #/components/schemas/pkg_routes_library_email_templates.ListEmailTemplatesFilters
        page:
          $ref: '#/components/schemas/types.ListPagination'
        sort:
          $ref: '#/components/schemas/types.ListSort'
    pkg_routes_library_email_templates.ListEmailTemplatesResponse:
      type: object
      properties:
        email_templates:
          type: array
          items:
            $ref: '#/components/schemas/types.EmailTemplate'
        total:
          type: integer
    pkg_routes_library_email_templates.ListEmailTemplatesFilters:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        search:
          type: string
        tags:
          description: |-
            Tags accepts a plain array (include-only, legacy) or the
            {include,exclude} shape from the ENG-6934 filter toggle.
          type: array
          items:
            type: string
    types.ListPagination:
      type: object
      properties:
        limit:
          type: integer
        skip:
          type: integer
    types.ListSort:
      type: object
      properties:
        field:
          type: string
        last: {}
        order:
          type: integer
    types.EmailTemplate:
      type: object
      properties:
        _id:
          type: string
        activity:
          description: For returning
          type: array
          items:
            $ref: '#/components/schemas/types.Activity'
        append_signature:
          type: boolean
        attachments:
          type: array
          items:
            type: string
        body:
          type: string
        branded:
          description: Branded email editing
          allOf:
            - $ref: '#/components/schemas/types.BrandedEmailTemplate'
        created_at:
          type: string
        deleted_at:
          type: string
        locked:
          type: boolean
        n_attachments:
          description: >-
            NumAttachments is len(Attachments). Computed on list/query; not
            stored.
          type: integer
        n_bulk_sends:
          description: >-
            NumBulkSends is the number of email_bulk_sends records for this
            template.
          type: integer
        name:
          type: string
        schedule:
          type: array
          items:
            $ref: '#/components/schemas/types.EmailSchedule'
        secure:
          type: boolean
        subject:
          type: string
        tags:
          type: array
          items:
            type: string
        team:
          type: string
        type:
          description: >-
            Type is "Branded" when the template has branded sections, "Text"
            otherwise.

            Computed on list/query; not stored.
          type: string
    types.ListFilterData:
      type: object
      properties:
        key:
          type: string
        op:
          type: string
        value: {}
    types.Activity:
      type: object
      properties:
        _id:
          type: string
        action:
          type: string
        changes:
          type: array
          items:
            $ref: '#/components/schemas/types.Change'
        client:
          type: string
        on_id:
          type: string
        on_py:
          type: integer
        on_type:
          type: string
        team:
          type: string
        timestamp:
          type: string
        user:
          type: string
    types.BrandedEmailTemplate:
      type: object
      properties:
        alignment:
          type: string
        background_color:
          description: Not used now, but in case we want them in the future
          type: string
        font_family:
          type: string
        foreground_color:
          type: string
        header_background:
          type: string
        sections:
          type: array
          items:
            $ref: '#/components/schemas/types.EmailSection'
    types.EmailSchedule:
      type: object
      properties:
        allow_partial:
          description: >-
            Deprecated: read by nothing, and its Outbox behaviour does not exist
            in the

            post-ENG-8318 pipeline. Use StopOnRenderFailure; remove once

            backend-monorepo's generated bindings stop referencing it
            (ENG-8602).
          type: boolean
        cc:
          description: Variables (eg. "contacts:*")
          type: array
          items:
            type: string
        clients:
          type: array
          items:
            type: string
        clients_filter:
          description: Filter instead of predefined list?
          allOf:
            - $ref: '#/components/schemas/types.ClientsFilter'
        file:
          description: Who are we launching it for? (clients/plans)
          type: string
        from:
          description: >-
            Variables to get From, To and Cc from client list or filtered
            clients
          type: string
        plans:
          type: array
          items:
            type: string
        plans_filter:
          $ref: '#/components/schemas/types.PlansFilter'
        stop_on_render_failure:
          description: >-
            Send nothing at all if any target fails to render, rather than
            skipping it

            and mailing the rest. Zero value is the historical skip-and-continue

            behaviour, so older records keep working (ENG-8602).
          type: boolean
        timestamp:
          description: When are we launching it?
          type: string
        to:
          description: Variables (eg. "contacts:[role]")
          type: array
          items:
            type: string
    types.Change:
      type: object
      properties:
        data:
          type: string
        field:
          type: string
        from:
          type: string
        to:
          type: string
    types.EmailSection:
      type: object
      properties:
        content:
          description: Heading 1, Heading 2, Heading 3, Paragraph, Image, Button, Divider
          type: string
        type:
          type: string
        url:
          type: string
    types.ClientsFilter:
      type: object
      properties:
        assignee:
          type: array
          items:
            type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        status:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
    types.PlansFilter:
      type: object
      properties:
        client:
          type: array
          items:
            type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        provisions:
          type: object
          additionalProperties:
            type: string
        pye: {}
        status:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        type:
          type: array
          items:
            type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.