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

# List Email Templates

> Retrieve all email templates available in your Minimo account

## Overview

Get a list of all email templates you've created in the Minimo dashboard. Use this endpoint to:

* Display available templates in your application
* Verify template IDs before sending emails
* Build template selection interfaces
* Audit your template library

## Response Structure

The response includes template metadata:

```json theme={null}
{
  "data": [
    {
      "id": "tmpl_abc123",
      "name": "Order Confirmation",
      "subject": "Your order {{orderNumber}} is confirmed",
      "status": "active",
      "category": "transactional",
      "createdAt": "2025-10-01T10:00:00Z",
      "updatedAt": "2025-11-01T15:30:00Z",
      "variables": ["orderNumber", "customerName", "total"]
    },
    {
      "id": "tmpl_xyz789",
      "name": "Welcome Email",
      "subject": "Welcome to {{companyName}}!",
      "status": "active",
      "category": "marketing",
      "createdAt": "2025-09-15T09:00:00Z",
      "updatedAt": "2025-09-15T09:00:00Z",
      "variables": ["companyName", "firstName"]
    }
  ]
}
```

## Template Categories

Templates can belong to different categories:

| Category        | Description                          | Examples                           |
| --------------- | ------------------------------------ | ---------------------------------- |
| `transactional` | Order-related, account notifications | Order confirmation, password reset |
| `marketing`     | Promotional campaigns                | Product launch, newsletter         |
| `automated`     | Triggered by user behavior           | Welcome series, abandoned cart     |

## Template Status

| Status     | Description                  |
| ---------- | ---------------------------- |
| `active`   | Template is ready to use     |
| `draft`    | Template is being edited     |
| `archived` | Template is no longer in use |

<Info>Only `active` templates can be used with the Send Email Template endpoint.</Info>

## Use Cases

### Template Selector UI

Build a dropdown to let users choose templates:

```javascript theme={null}
async function loadTemplates() {
  const response = await fetch('https://app.minimo.it/api/templates/email', {
    headers: {
      Authorization: `Bearer ${apiKey}`,
    },
  });

  const { data: templates } = await response.json();

  // Filter only active templates
  const activeTemplates = templates.filter((t) => t.status === 'active');

  // Populate dropdown
  const select = document.getElementById('template-select');
  activeTemplates.forEach((template) => {
    const option = document.createElement('option');
    option.value = template.id;
    option.textContent = template.name;
    select.appendChild(option);
  });
}
```

### Validate Template ID

Before sending an email, verify the template exists:

```javascript theme={null}
async function isValidTemplate(templateId) {
  const response = await fetch('https://app.minimo.it/api/templates/email', {
    headers: {
      Authorization: `Bearer ${apiKey}`,
    },
  });

  const { data: templates } = await response.json();

  return templates.some((t) => t.id === templateId && t.status === 'active');
}
```

## Filtering (Coming Soon)

Future versions will support filtering:

```bash theme={null}
GET /api/templates/email?category=transactional&status=active
```

## Related Endpoints

* [Send Email Template](/api-reference/messaging-channels/email/send-template) - Send emails using templates
* [Get Email Template Stats](/api-reference/messaging-channels/email/stats) - View template performance


## OpenAPI

````yaml get /api/templates/email
openapi: 3.1.0
info:
  title: API Documentation
  description: Documentation for transactional and subscribe APIs
  version: 1.0.0
servers:
  - url: https://app.minimo.it
security:
  - bearerAuth: []
paths:
  /api/templates/email:
    get:
      summary: List All Transactionals
      description: Retrieve the list of transactional messages created by a company.
      responses:
        '200':
          description: Successful response with a list of transactional messages.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Unique identifier for the transactional message.
                        name:
                          type: string
                          description: Name of the transactional message.
                        created:
                          type: string
                          format: date-time
                          description: Timestamp when the message was created.
                        updated:
                          type: string
                          format: date-time
                          description: Timestamp when the message was last updated.
              example:
                data:
                  - id: 1
                    name: Order Confirmation
                    created: '2023-12-01T10:00:00Z'
                    updated: '2023-12-04T15:30:00Z'
                  - id: 2
                    name: Shipping Update
                    created: '2023-11-15T08:00:00Z'
                    updated: '2023-12-01T12:45:00Z'
        '400':
          description: Invalid or missing authentication token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
              example:
                error: Missing API client ID or API key
        '404':
          description: Company not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message.
              example:
                message: Company not found
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mn-API_CLIENT_ID-API_KEY

````