curl --request GET \
--url https://api.kit.com/v4/email_templates \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/email_templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyconst options = {method: 'GET', headers: {'X-Kit-Api-Key': '<api-key>'}};
fetch('https://api.kit.com/v4/email_templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/email_templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/email_templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/email_templates"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"email_templates": [
{
"id": 36,
"name": "Custom HTML Template",
"is_default": false,
"category": "HTML"
},
{
"id": 35,
"name": "Story",
"is_default": false,
"category": "Starting point"
},
{
"id": 6,
"name": "Text Only",
"is_default": true,
"category": "HTML"
},
{
"id": 4,
"name": "Modern",
"is_default": false,
"category": "HTML"
},
{
"id": 2,
"name": "Classic",
"is_default": false,
"category": "HTML"
},
{
"id": 1,
"name": "Card",
"is_default": false,
"category": "HTML"
}
],
"pagination": {
"has_previous_page": false,
"has_next_page": false,
"start_cursor": "WzM2XQ==",
"end_cursor": "WzFd",
"per_page": 500
}
}{
"errors": [
"The access token is invalid"
]
}List email templates
Returns a cursor-paginated list of the account’s email templates with each template’s id, name, is_default flag, and category (for example HTML or Starting point).
Use a template’s id as the email_template_id when creating or updating a broadcast. Note: templates in the Starting point category are generally not supported when creating broadcasts via the API — using one returns a Starting point email template is not supported error unless your app has been enabled for it. See Create a broadcast.
curl --request GET \
--url https://api.kit.com/v4/email_templates \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/email_templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyconst options = {method: 'GET', headers: {'X-Kit-Api-Key': '<api-key>'}};
fetch('https://api.kit.com/v4/email_templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/email_templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/email_templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/email_templates"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"email_templates": [
{
"id": 36,
"name": "Custom HTML Template",
"is_default": false,
"category": "HTML"
},
{
"id": 35,
"name": "Story",
"is_default": false,
"category": "Starting point"
},
{
"id": 6,
"name": "Text Only",
"is_default": true,
"category": "HTML"
},
{
"id": 4,
"name": "Modern",
"is_default": false,
"category": "HTML"
},
{
"id": 2,
"name": "Classic",
"is_default": false,
"category": "HTML"
},
{
"id": 1,
"name": "Card",
"is_default": false,
"category": "HTML"
}
],
"pagination": {
"has_previous_page": false,
"has_next_page": false,
"start_cursor": "WzM2XQ==",
"end_cursor": "WzFd",
"per_page": 500
}
}{
"errors": [
"The access token is invalid"
]
}Authorizations
Authenticate API requests via an API Key
Query Parameters
To fetch next page of results, use ?after=<end_cursor>
To fetch previous page of results, use ?before=<start_cursor>
Set to true to include the total_count in the response. This option can cause slow responses; if paging through results, request it only on the first page and reuse the value for subsequent pages.
Number of results per page. Default 500, maximum 1000.
Was this page helpful?