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

# GET /v1/email/templates

> List the active email templates designed in the Keebai portal.

Returns the email templates your team designed in the portal. Pass a template's `id` as `template_id` in [`POST /v1/email/send`](https://docs.keebai.com/dev/endpoints/email-send) to send it instead of a plain subject and body.

These are email templates, not WhatsApp templates. The WhatsApp catalog is [`GET /v1/templates`](https://docs.keebai.com/dev/endpoints/templates-list).

## Endpoint

```
GET https://api.keebai.com/v1/email/templates
```

## Required scope

`templates:read`

## Headers

| Header | Required | Value |
| - | - | - |
| `Authorization` | Yes | `Bearer kbai_pk_<token>` |

## Query parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `search` | `string` | No | Filter by name. |

## Example request

```bash curl theme={"system"}
curl -G https://api.keebai.com/v1/email/templates \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --data-urlencode "search=bienvenida"
```

```js JavaScript theme={"system"}
const params = new URLSearchParams({ search: "bienvenida" });

const response = await fetch(
  `https://api.keebai.com/v1/email/templates?${params}`,
  { headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` } },
);
const { templates } = await response.json();
```

```python Python theme={"system"}
import os, requests

resp = requests.get(
    "https://api.keebai.com/v1/email/templates",
    headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
    params={"search": "bienvenida"},
    timeout=10,
)
resp.raise_for_status()
templates = resp.json()["templates"]
```

## Response

### 200 OK

```json theme={"system"}
{
  "templates": [
    {
      "id": "6651c2d3e4f5a6b7c8d9e0f1",
      "name": "Bienvenida",
      "subject": "Bienvenido a {{empresa}}",
      "category": "marketing",
      "variables": ["nombre", "empresa"],
      "updated_at": "2026-10-09T15:12:40.511Z"
    }
  ]
}
```

| Field | Type | Description |
| - | - | - |
| `id` | `string` | Template id. Pass it as `template_id` when sending. |
| `name` | `string` | Name shown in the portal. |
| `subject` | `string` | Subject line of the template. |
| `category` | `string` | Category set in the portal. |
| `variables` | `string[]` | Variables the template uses. Fill them per recipient with `recipients[].variables`. |
| `updated_at` | `string` | ISO 8601 timestamp of the last edit. |

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `templates:read` scope.

### 502 Bad Gateway

The messaging service could not answer.

## Operational notes

* **Only active templates are listed.** Templates are designed and edited in the portal; this API does not create or change them.
* **`variables` is always an array.** A template without variables returns `[]`, never `null`.


## OpenAPI

````yaml GET /v1/email/templates
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/email/templates:
    get:
      tags:
        - email
      summary: List active email templates
      operationId: PublicEmailController_templates
      parameters:
        - name: search
          required: false
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
      security:
        - PAT: []
components:
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

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