# List templates

> GET /templates — list your templates.

`GET /templates`

Returns your templates, newest first, as a paginated list. This endpoint is always paginated: `limit` defaults to `20` even when you do not send it, so an account with more templates than that gets one page plus `has_more: true`. Page through the rest with `after`.

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | No | Number of templates to retrieve. Minimum `1`, maximum `100`, default `20`. |
| `after` | string | No | The template `id` after which to retrieve more templates (the next page). Not included in the result. Cannot be combined with `before`. |
| `before` | string | No | The template `id` before which to retrieve more templates (the previous page). Not included in the result. Cannot be combined with `after`. |

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.templates.list();
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Templates.list
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendDart\SendDart;

$senddart = SendDart::client('mb_xxxxxxxxx');

$senddart->templates->list();
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Templates.list()
```

**Go**

```go
import "github.com/shekhu10/senddart-sdks/senddart-go"

client := senddart.NewClient("mb_xxxxxxxxx")

templates, err := client.Templates.List(nil)
```

**Rust**

```rust
use senddart::SendDart;

let mb = SendDart::new("mb_xxxxxxxxx");

let _templates = mb.templates.list(None).await?;
```

**Java**

```java
import com.senddart.SendDart;
import com.senddart.SendDartResponse;

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.templates().list();
```

**.NET**

```csharp
using SendDart;

ISendDart senddart = SendDartClient.Create("mb_xxxxxxxxx");

var resp = await senddart.TemplateListAsync();
```

**cURL**

```bash
curl -X GET 'https://www.senddart.com/api/templates' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart templates list
```

### Response

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "43f68331-0622-4e15-8202-246a0388854b",
      "name": "Welcome email",
      "subject": "Welcome, {{first_name}}!",
      "html": "<h1>Hi {{first_name}}</h1>",
      "status": "draft",
      "published_at": null,
      "alias": null,
      "created_at": "2026-06-23T10:00:00.000Z",
      "updated_at": "2026-06-23T10:00:00.000Z"
    }
  ]
}
```

Returns `validation_error` if `limit` is outside 1–100 or if both `after` and `before` are supplied. See [Errors](https://www.senddart.com/docs/api/errors) and [Pagination](https://www.senddart.com/docs/api/pagination).
