---
title: "Get a template"
description: "Returns one of your templates, or a template shared with your team."
version: "v2"
---

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

Path: touchSMS API › Templates

`GET /v2/templates/{template}`

Returns one of your templates, or a template shared with your team.

## Authentication

- `basicAuth`, http, header `Authorization`

## Path parameters

- `template` (`getTemplate.path.template`; integer, required) — Template ID.

## Code samples

### cURL

```bash
curl --request GET \
  --url https://app.touchsms.com.au/api/v2/templates/1234 \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.touchsms.com.au/api/v2/templates/1234';
const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.touchsms.com.au/api/v2/templates/1234"

headers = {"Authorization": "Basic <credentials>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The template.

#### Example

```json
{
  "data": {
    "id": 1234,
    "user": 5678,
    "name": "Appointment Reminder",
    "message": "Hi {{firstname}}, reminder of your appointment tomorrow.",
    "subject": null,
    "replies": true,
    "sender_id": "SHARED_NUMBER",
    "updated": "2024-03-11T02:14:07Z",
    "created": "2024-02-02T23:51:19Z"
  }
}
```

- `data` (`getTemplate.response.200.data`; object, optional)
  - example `{"id":1234,"user":5678,"name":"Appointment Reminder","message":"Hi {{firstname}}, reminder of your appointment tomorrow.","subject":null,"replies":true,"sender_id":"SHARED_NUMBER","updated":"2024-03-11T02:14:07Z","created":"2024-02-02T23:51:19Z"}`
  - `id` (`getTemplate.response.200.data.id`; integer, optional)
  - `user` (`getTemplate.response.200.data.user`; integer | null, optional) — ID of the user that owns the template. `null` on templates shared with your team.
  - `name` (`getTemplate.response.200.data.name`; string, optional)
  - `message` (`getTemplate.response.200.data.message`; string, optional) — Template body. May contain merge fields such as `{{firstname}}`.
  - `subject` (`getTemplate.response.200.data.subject`; string | null, optional) — MMS subject, up to 40 characters.
  - `replies` (`getTemplate.response.200.data.replies`; boolean, optional) — Whether replies are enabled for messages sent with this template.
  - `sender_id` (`getTemplate.response.200.data.sender_id`; string | null, optional) — Sender ID the template sends from.
  - `updated` (`getTemplate.response.200.data.updated`; string, optional)
    - format `date-time`
  - `created` (`getTemplate.response.200.data.created`; string, optional)
    - format `date-time`

### 401

Missing, malformed or invalid API credentials.

#### Example

```json
{
  "message": "Unauthenticated."
}
```

- `message` (`getTemplate.response.401.message`; string, required)

### 403

The resource exists but does not belong to you, or you lack permission.

#### Example

```json
{
  "message": "This action is unauthorized."
}
```

- `message` (`getTemplate.response.403.message`; string, required)

### 404

The resource does not exist.

#### Example

```json
{
  "message": "Not Found"
}
```

- `message` (`getTemplate.response.404.message`; string, required)


Source: https://dev.touchsms.com.au/api/templates/get/index.md
