> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://mailchimp.com/developer/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mailchimp.com/developer/_mcp/server.

# List templates

GET https://api.mailchimp.com/3.0/templates

Get a list of an account's available templates.

Reference: https://mailchimp.com/developer/marketing/api/templates/list

## Authentication

- `Authorization` header (bearer token, required) — Authorization using a Mailchimp API key (a.k.a. Bearer token)
- `Authorization` header (bearer token, required) — Authorization using OAuth

## Request

### Query parameters

- `fields` (list of string, optional) — A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
- `exclude_fields` (list of string, optional) — A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
- `count` (integer, optional, default: 10) — The number of records to return. Default value is 10. Maximum value is 1000
- `offset` (integer, optional, default: 0) — Used for [pagination](https://mailchimp.com/developer/marketing/docs/methods-parameters/#pagination), this is the number of records from a collection to skip. Default value is 0.
- `created_by` (string, optional) — The Mailchimp account user who created the template.
- `since_date_created` (string, optional) — Restrict the response to templates created after the set date. Uses ISO 8601 time format: 2015-10-21T15:41:36+00:00.
- `before_date_created` (string, optional) — Restrict the response to templates created before the set date. Uses ISO 8601 time format: 2015-10-21T15:41:36+00:00.
- `type` (string, optional) — Limit results based on template type.
- `category` (string, optional) — Limit results based on category.
- `folder_id` (string, optional) — The unique folder id.
- `sort_field` (enum, optional) — Returns user templates sorted by the specified field.
  - Allowed values: `date_created`, `date_edited`, `name`
- `content_type` (enum, optional) — Limit results based on how the template's content is put together. Only templates of type `user` can be filtered by `content_type`. If you want to retrieve saved templates created with the legacy email editor, then filter `content_type` to `template`. If you'd rather pull your saved templates for the new editor, filter to `multichannel`. For code your own templates, filter to `html`.
  - Allowed values: `html`, `template`, `multichannel`
- `sort_dir` (enum, optional) — Determines the order direction for sorted results.
  - Allowed values: `ASC`, `DESC`

## Response

### 200

- `_links` (list of 30TemplatesGetResponsesContentApplicationJsonSchemaLinksItems, optional) — A list of link types and descriptions for the API schema documents.
- `templates` (list of TemplateInstance, optional) — All of an account's saved or custom templates.
- `total_items` (integer, optional) — The total number of items matching the query regardless of pagination.

## Types

### 30TemplatesGetResponsesContentApplicationJsonSchemaLinksItems

This object represents a link from the resource where it is found to another resource or action that may be performed.

- `href` (string, optional) — This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
- `method` (enum, optional) — The HTTP method that should be used when accessing the URL defined in 'href'.
  - Allowed values: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`
- `rel` (string, optional) — As with an HTML 'rel' attribute, this describes the type of link.
- `schema` (string, optional) — For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
- `targetSchema` (string, optional) — For GETs, this is a URL representing the schema that the response should conform to.

### TemplateInstance

Information about a specific template.

- `_links` (list of TemplateInstanceLinksItems, optional) — A list of link types and descriptions for the API schema documents.
- `active` (boolean, optional) — User templates are not 'deleted,' but rather marked as 'inactive.' Returns whether the template is still active.
- `category` (string, optional) — If available, the category the template is listed in.
- `content_type` (enum, optional) — How the template's content is put together.
  - Allowed values: `template`, `multichannel`, `html`
- `created_by` (string, optional) — The login name for template's creator.
- `date_created` (datetime, optional) — The date and time the template was created in ISO 8601 format.
- `date_edited` (datetime, optional) — The date and time the template was edited in ISO 8601 format.
- `drag_and_drop` (boolean, optional) — Whether the template uses the drag and drop editor.
- `edited_by` (string, optional) — The login name who last edited the template.
- `folder_id` (string, optional) — The id of the folder the template is currently in.
- `id` (integer, optional) — The individual id for the template.
- `name` (string, optional) — The name of the template.
- `responsive` (boolean, optional) — Whether the template contains media queries to make it responsive.
- `share_url` (string, optional) — The URL used for [template sharing](https://mailchimp.com/help/share-a-template/).
- `thumbnail` (string, optional) — If available, the URL for a thumbnail of the template.
- `type` (string, optional) — The type of template (user, base, or gallery).

### TemplateInstanceLinksItems

This object represents a link from the resource where it is found to another resource or action that may be performed.

- `href` (string, optional) — This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
- `method` (enum, optional) — The HTTP method that should be used when accessing the URL defined in 'href'.
  - Allowed values: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`
- `rel` (string, optional) — As with an HTML 'rel' attribute, this describes the type of link.
- `schema` (string, optional) — For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
- `targetSchema` (string, optional) — For GETs, this is a URL representing the schema that the response should conform to.

## Examples

**Response**

```json
{
  "_links": [
    {
      "href": "string",
      "method": "GET",
      "rel": "string",
      "schema": "string",
      "targetSchema": "string"
    }
  ],
  "templates": [
    {
      "_links": [
        {
          "href": "string",
          "method": "GET",
          "rel": "string",
          "schema": "string",
          "targetSchema": "string"
        }
      ],
      "active": true,
      "category": "string",
      "content_type": "template",
      "created_by": "string",
      "date_created": "2024-01-15T09:30:00Z",
      "date_edited": "2024-01-15T09:30:00Z",
      "drag_and_drop": true,
      "edited_by": "string",
      "folder_id": "string",
      "id": 1,
      "name": "string",
      "responsive": true,
      "share_url": "string",
      "thumbnail": "string",
      "type": "string"
    }
  ],
  "total_items": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.mailchimp.com/3.0/templates"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.mailchimp.com/3.0/templates';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mailchimp.com/3.0/templates"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.mailchimp.com/3.0/templates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.mailchimp.com/3.0/templates")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.mailchimp.com/3.0/templates', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.mailchimp.com/3.0/templates");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.mailchimp.com/3.0/templates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```