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

# Lemlist: Get Message Templates

> List or search your team's Lemlist message templates by name, tag or creator. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

List or search your team's Lemlist message templates by name, tag or creator.

> [!NOTE]
>
> Tool ID: `lemlist_get_message_templates`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'lemlist_get_message_templates',
  {
    "search": "software companies hiring engineers",
    "tags": "example",
    "userIds": "user_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute lemlist_get_message_templates --input '{
  "search": "software companies hiring engineers",
  "tags": "example",
  "userIds": "user_123"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "data": [
      {
        "_id": "_123",
        "name": "Example",
        "subject": "Introduction"
      }
    ],
    "meta": {
      "pagination": {
        "page": 123,
        "limit": 123,
        "totalRecords": 123
      }
    }
  }
}
```

Use `deepline describe lemlist_get_message_templates --json` for the latest machine-readable contract.

## Input reference

Lists the team's library message templates (the templates of the Templates page), newest first, with the page's own filters: a name search, tags and creators. Campaign step bodies are not templates: read them from GET /campaigns/\{campaignId}/sequences.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.search` | `string` | No | — | Substring of the name, case-insensitive. Accented a, c, e, i, n, o, u, y match their plain letters (`relance` finds `Rélance`). Names only: bodies and subjects are not searched. Maximum 100 characters. A blank value is no filter. Maximum length: 100. |
| `payload.tags` | `string` | No | — | Keep the templates carrying any of these tags. Comma-separated. The parameter may also be repeated (`?tags=a&tags=b`), which keeps a comma inside a tag reachable. Tags are matched trimmed and lowercased, as the library stores them. Maximum 20. |
| `payload.userIds` | `string` | No | — | Keep the items created by any of these users (`usr_` ids, see GET /team/members). Comma-separated. The parameter may also be repeated. Maximum 100. Omit for every creator. |
| `payload.page` | `integer` | No | `1` | Page number to retrieve, starting at 1 Minimum: 1. |
| `payload.limit` | `integer` | No | `50` | Number of items per page. Maximum value: 100 Minimum: 1. Maximum: 100. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Lists the team's library message templates (the templates of the Templates page), newest first, with the page's own filters: a name search, tags and creators. Campaign step bodies are not templates: read them from GET /campaigns/{campaignId}/sequences.",
    "properties": {
      "search": {
        "type": "string",
        "description": "Substring of the name, case-insensitive. Accented a, c, e, i, n, o, u, y match their plain letters (`relance` finds `Rélance`). Names only: bodies and subjects are not searched. Maximum 100 characters; a blank value is no filter.",
        "maxLength": 100
      },
      "tags": {
        "type": "string",
        "description": "Keep the templates carrying any of these tags. Comma-separated; the parameter may also be repeated (`?tags=a&tags=b`), which keeps a comma inside a tag reachable. Tags are matched trimmed and lowercased, as the library stores them. Maximum 20."
      },
      "userIds": {
        "type": "string",
        "description": "Keep the items created by any of these users (`usr_` ids, see GET /team/members). Comma-separated; the parameter may also be repeated. Maximum 100. Omit for every creator."
      },
      "page": {
        "type": "integer",
        "description": "Page number to retrieve, starting at 1",
        "default": 1,
        "minimum": 1
      },
      "limit": {
        "type": "integer",
        "description": "Number of items per page. Maximum value: 100",
        "default": 50,
        "minimum": 1,
        "maximum": 100
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.data` | `array` | No | — | — |
| `result.data.data[]._id` | `string` | No | — | Template identifier (`etp_`) |
| `result.data.data[].name` | `string` | No | — | Name shown on the Templates page |
| `result.data.data[].subject` | `string` | No | — | Subject line. `""` when none was set |
| `result.data.data[].message` | `string` | No | — | HTML body, variables left as `&#123;&#123;variable&#125;&#125;` |
| `result.data.data[].cc` | `array` | No | — | CC addresses. `[]` when none was set |
| `result.data.data[].tags` | `array` | No | — | Tags, trimmed and lowercased. `[]` when none was set |
| `result.data.data[].createdBy` | `string` | No | — | Creator user id (`usr_`), see GET /team/members |
| `result.data.data[].createdAt` | `string` | No | — | Creation date Format: `date-time`. |
| `result.data.meta` | `object` | No | — | Pagination block of a list response. `totalPages` is at least 1: an empty result is page 1 of 1. |
| `result.data.meta.pagination` | `object` | No | — | — |
| `result.data.meta.pagination.page` | `integer` | No | — | Current page number |
| `result.data.meta.pagination.limit` | `integer` | No | — | Number of records per page |
| `result.data.meta.pagination.totalRecords` | `integer` | No | — | Total records matching the filters |
| `result.data.meta.pagination.totalPages` | `integer` | No | — | Total number of pages, at least 1 |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A library message template: a whole reusable message a user saved from the Templates page or an editor, usable as a step on any channel. Bodies are HTML as stored, with `{{variables}}` left raw.",
              "properties": {
                "_id": {
                  "type": "string",
                  "description": "Template identifier (`etp_`)"
                },
                "name": {
                  "type": "string",
                  "description": "Name shown on the Templates page"
                },
                "subject": {
                  "type": "string",
                  "description": "Subject line; `\"\"` when none was set"
                },
                "message": {
                  "type": "string",
                  "description": "HTML body, variables left as `{{variable}}`"
                },
                "cc": {
                  "type": "array",
                  "description": "CC addresses; `[]` when none was set",
                  "items": {
                    "type": "string"
                  }
                },
                "tags": {
                  "type": "array",
                  "description": "Tags, trimmed and lowercased; `[]` when none was set",
                  "items": {
                    "type": "string"
                  }
                },
                "createdBy": {
                  "type": "string",
                  "description": "Creator user id (`usr_`), see GET /team/members"
                },
                "createdAt": {
                  "type": "string",
                  "description": "Creation date",
                  "format": "date-time"
                }
              },
              "additionalProperties": false
            }
          },
          "meta": {
            "type": "object",
            "description": "Pagination block of a list response. `totalPages` is at least 1: an empty result is page 1 of 1.",
            "properties": {
              "pagination": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "integer",
                    "description": "Current page number"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Number of records per page"
                  },
                  "totalRecords": {
                    "type": "integer",
                    "description": "Total records matching the filters"
                  },
                  "totalPages": {
                    "type": "integer",
                    "description": "Total number of pages, at least 1"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Lemlist provider guide](https://deepline.com/docs/providers/lemlist/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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