# 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 { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Templates.list
```

**PHP**

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

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Templates.list()
```

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

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

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.templates().list();
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

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

**cURL**

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

**CLI**

```bash
sendping 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.sendping.co/docs/api/errors) and [Pagination](https://www.sendping.co/docs/api/pagination).
