# Retrieve template

> Returns one template.

Source: https://mailvina.com/docs/api-reference/templates/retrieve-template · Base URL: https://api.mailvina.com · Guide: https://mailvina.com/docs/templates

`GET /templates/:id_or_alias`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id_or_alias` | `string` | yes | Template ID or alias. |

**Request**

```bash
curl -X GET 'https://api.mailvina.com/templates/:id_or_alias' \
  -H 'Authorization: Bearer mv_xxxxxxxxx'
```

```js
const res = await fetch('https://api.mailvina.com/templates/:id_or_alias', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.MAILVINA_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.mailvina.com/templates/:id_or_alias",
    headers={"Authorization": f"Bearer {os.environ['MAILVINA_API_KEY']}"},
)
print(res.json())
```

**Response**

```json
{
  "object": "template",
  "id": "f3b9756c-f4f4-44da-bc00-9f7903c8a83f",
  "name": "Welcome email",
  "alias": "welcome-email",
  "subject": "Welcome, {{name|friend}}!",
  "html": "<h1>Hi {{name|there}}</h1>"
}
```

### The template object

A reusable email. Refer to it by its ID or its alias anywhere a template is accepted.

**Fields**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | `string` | no | Always `template`. |
| `id` | `string` | no | Unique ID of the template. |
| `name` | `string` | no | Its name, unique within your team. |
| `alias` | `string` | no | A stable, readable identifier, unique within your team (e.g. `welcome-email`). Works everywhere the ID does. |
| `subject` | `string` | no | Subject line. Can contain `{{variables}}`. |
| `html` | `string` | no | HTML body. Can contain `{{variables}}`. |
| `text` | `string \| null` | no | Plain-text body. |
| `from` | `string \| null` | no | Default sender, used when a send leaves out `from`. |
| `reply_to` | `string \| null` | no | Default Reply-To, used when a send leaves it out. |
| `created_at` | `string` | no | When it was created (ISO 8601, UTC). |
| `updated_at` | `string` | no | When it was last changed. |
