> For the complete documentation index, see [llms.txt](https://docs.delos.financial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delos.financial/messages/get-templates-list.md).

# Get templates list

Retrieves a paginated list of message templates with their configuration, triggers, and associated events. Templates are used for automated notifications (email, SMS, etc.) triggered by system events.

**Endpoint**

`GET/v2/messages/templates`

**Link**

{% embed url="<https://partner.sandbox.delos.financial/openapi/v2.html#/operations/Messages_GetTemplates>" %}

### **Request**

#### **Query Parameters**

| Parameter           | Type      | Description                  | Required | Example |
| ------------------- | --------- | ---------------------------- | -------- | ------- |
| **`meta.page`**     | `integer` | Page number (starts from 0). | No       | `0`     |
| **`meta.pageSize`** | `integer` | Number of items per page.    | No       | `20`    |

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `<JWT>`            | Yes      |
| `Accept`        | `application/json` | Yes      |

***

### **Response (200 OK)**

Returns a paginated list of message templates with detailed configuration.

#### **Response Fields**

**1. Meta Object**

| Field          | Type      | Description                | Example |
| -------------- | --------- | -------------------------- | ------- |
| **`pageSize`** | `integer` | Items per page.            | `20`    |
| **`page`**     | `integer` | Current page number.       | `0`     |
| **`total`**    | `string`  | Total templates available. | `"15"`  |

**2. Template Object (`items[]`)**

| Field           | Type      | Description                               | Example                                    |
| --------------- | --------- | ----------------------------------------- | ------------------------------------------ |
| **`id`**        | `string`  | **Unique template identifier**.           | `"tpl_12345"`                              |
| **`partnerId`** | `string`  | **Partner ID** that owns the template.    | `"ptn_67890"`                              |
| **`typeId`**    | `integer` | **Template type** (1=Email, 2=SMS, etc.). | `1`                                        |
| **`subject`**   | `string`  | **Email subject** or message title.       | `"Welcome to Our Platform!"`               |
| **`title`**     | `string`  | **Message title** (for display).          | `"Account Created"`                        |
| **`content`**   | `string`  | **Message body** with variables.          | `"Hello {{name}}, your account is ready!"` |
| **`button`**    | `string`  | **Button text** (for emails).             | `"Login Now"`                              |
| **`link`**      | `string`  | **Button URL** (for emails).              | `"https://app.example.com/login"`          |
| **`updatedAt`** | `string`  | Last update timestamp (ISO 8601).         | `"2024-05-20T14:30:00Z"`                   |
| **`createdAt`** | `string`  | Creation timestamp (ISO 8601).            | `"2024-01-15T10:00:00Z"`                   |
| **`deletedAt`** | `string`  | Deletion timestamp (if soft-deleted).     | `null`                                     |
| **`delay`**     | `string`  | **Delivery delay** after trigger.         | `"5m"` (5 minutes)                         |
| **`isActive`**  | `boolean` | **Template status**. `true` = active.     | `true`                                     |
| **`showTime`**  | `string`  | **Preferred sending time**.               | `"09:00"`                                  |
| **`triggers`**  | `array`   | **Events that trigger this template**.    | -                                          |

**3. Trigger Object**

| Field            | Type      | Description                              | Example |
| ---------------- | --------- | ---------------------------------------- | ------- |
| **`eventId`**    | `integer` | **Event ID** that triggers the template. | `101`   |
| **`templateId`** | `integer` | **Template ID** reference.               | `1`     |
| **`event`**      | `object`  | **Event details** (see below).           | -       |

**4. Event Object**

| Field           | Type      | Description                             | Example              |
| --------------- | --------- | --------------------------------------- | -------------------- |
| **`id`**        | `integer` | **Event ID**.                           | `101`                |
| **`Name`**      | `string`  | **Event name**.                         | `"customer.created"` |
| **`variables`** | `array`   | **Available variables** for this event. | -                    |

**5. Variable Object**

| Field      | Type     | Description                         | Example          |
| ---------- | -------- | ----------------------------------- | ---------------- |
| **`name`** | `string` | **Variable name** for template use. | `"customerName"` |

**Example Response:**

json

```
{
  "items": [
    {
      "id": "tpl_12345",
      "partnerId": "ptn_67890",
      "typeId": 1,
      "subject": "Welcome to Acme Payments!",
      "title": "Account Created Successfully",
      "content": "Hello {{customerName}}, your account has been created. Your customer ID is {{customerId}}.",
      "button": "Access Your Account",
      "link": "https://app.acme.com/login",
      "updatedAt": "2024-05-20T14:30:00Z",
      "createdAt": "2024-01-15T10:00:00Z",
      "deletedAt": null,
      "delay": "0s",
      "isActive": true,
      "showTime": "09:00",
      "triggers": [
        {
          "eventId": 101,
          "templateId": 1,
          "event": {
            "id": 101,
            "Name": "customer.created",
            "variables": [
              {"name": "customerId"},
              {"name": "customerName"},
              {"name": "email"}
            ]
          }
        }
      ]
    }
  ],
  "meta": {
    "pageSize": 20,
    "page": 0,
    "total": "15"
  }
}
```

***

### **Examples**

#### **Request**

bash

```
curl -X GET 'https://stagep.tst-apidmndelss.com/v2/messages/templates?meta.page=0&meta.pageSize=10' \
  -H 'Authorization: Bearer eyJhbGci...wNLGA' \
  -H 'Accept: application/json'
```

#### **SMS Template Example**

json

```
{
  "id": "tpl_67890",
  "partnerId": "ptn_12345",
  "typeId": 2,
  "subject": "",
  "title": "Security Alert",
  "content": "Acme: Login detected from new device. If this wasn't you, contact support immediately.",
  "button": "",
  "link": "",
  "updatedAt": "2024-05-18T16:20:00Z",
  "createdAt": "2024-02-10T11:30:00Z",
  "deletedAt": null,
  "delay": "0s",
  "isActive": true,
  "showTime": "00:00",
  "triggers": [
    {
      "eventId": 205,
      "templateId": 2,
      "event": {
        "id": 205,
        "Name": "security.login.unusual",
        "variables": [
          {"name": "deviceType"},
          {"name": "location"},
          {"name": "timestamp"}
        ]
      }
    }
  ]
}
```

***

### **Error Responses**

1. **Unauthorized**:

   json

   ```
   { "error": "Unauthorized" }
   ```

***

### **Notes**

* **Template Types**:
  * `1`: Email templates
  * `2`: SMS templates
  * `3`: Push notifications
* **Variable Usage**: Use `{{variableName}}` syntax in content.
* **Delivery Timing**: `showTime` uses 24-hour format, `delay` uses format like "5m", "2h", "1d".
* **Active Status**: Only templates with `isActive: true` will be triggered.

Real request sample:

```postman_json
Authorization:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxMTQwMDA2LCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.RxFCm8ucJR6zCl8yV-ThznmBuz8pls95zb2oPScWd6w

```

Real response sample:

200 OK

```postman_json
{
  "items": [
    {
      "id": "io75SdrpdBSW",
      "partnerId": "3354815d-1a23-4b1c-81ec-306388cddfa4",
      "typeId": 1,
      "subject": "Test",
      "title": "Test",
      "content": "TEst",
      "button": "Test",
      "link": "Test",
      "updatedAt": "2024-08-16T08:26:36Z",
      "createdAt": "2024-08-16T08:26:36Z",
      "deletedAt": "0001-01-01T00:00:00Z",
      "delay": null,
      "isActive": true,
      "showTime": null,
      "triggers": [
        {
          "eventId": 7,
          "templateId": 4,
          "event": {
            "id": 0,
            "Name": "",
            "variables": []
          }
        }
      ]
    }
  ],
  "meta": {
    "pageSize": 0,
    "page": 0,
    "total": "1"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.delos.financial/messages/get-templates-list.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
