Get Email Templates
GET
/v1/templates
Retrieves a list of email templates.
This method is suitable for production usage and allows you to manage your email templates.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”A list of email templates.
Array<object>
object
template_id
The unique identifier of the template.
string
name
The name of the template.
string
subject
The subject of the template.
string
from_name
The email address of the sender.
string
John Doe
from_email
The email address of the sender.
string format: email
john@doe.com
status
Indicates whether the template is active or not.
boolean
true
Examples
Example response
[ { "template_id": "template123", "name": "Welcome Email", "subject": "Welcome to Our Service", "from_name": "John Doe", "from_email": "john@doe.com" }]
Your key auth is not valid
object
status
boolean
error
boolean
true
message
string
Your key auth is not valid, please check with your administrator to get the new key
Example
{ "status": false, "error": true, "description": "Your key auth is not valid, please check with your administrator to get the new key"}
Your account dont have credits availables for send
object
status
boolean
error
boolean
true
message
string
Your account dont have credits availables for send this, please contact your administrator
Example
{ "status": false, "error": true, "description": "Your account dont have credits availables for send this, please contact your administrator"}
Missing required parameters
object
status
boolean
error
boolean
true
message
string
Missing params, please verify or contact to support
Example
{ "status": false, "error": true, "description": "Missing params, please verify or contact to support"}
Examples
Section titled “Examples ”Useful for guiding users to view code examples in different developer languages.
curl -X GET "https://api.example.com/v1/templates" \ -H "Accept: application/json" \ -H "Connection: keep-alive" \ -H "Authorization: Bearer <your-token>"
const fetch = require('node-fetch');
fetch("https://api.example.com/v1/templates", { method: "GET", headers: { "Accept": "application/json", "Connection": "keep-alive", "Authorization": "Bearer <your-token>"} }) .then(res => res.json()) .then(console.log) .catch(console.error);
<?php $curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.example.com/v1/templates", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Accept: application/json", "Connection: keep-alive", "Authorization: Bearer <your-token>" ] ]);
$response = curl_exec($curl); curl_close($curl); echo $response; ?>
using System.Net.Http; using System.Text; using System.Threading.Tasks;
var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.GET, "https://api.example.com/v1/templates"); request.Headers.Add("Accept", "application/json");request.Headers.Add("Connection", "keep-alive");request.Headers.Add("Authorization", "Bearer <your-token>"); var response = await client.SendAsync(request); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody);
import requests import json
url = "https://api.example.com/v1/templates" headers = { "Accept": "application/json", "Connection": "keep-alive", "Authorization": "Bearer <your-token>" }
response = requests.get(url, headers=headers) print(response.text)
import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets;
public class ApiExample { public static void main(String[] args) throws Exception { URL url = new URL("https://api.example.com/v1/templates"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Connection", "keep-alive"); conn.setRequestProperty("Authorization", "Bearer <your-token>");
int code = conn.getResponseCode(); System.out.println("Response code: " + code); } }