Approve an email template
curl --request POST \
--url https://api.tented.ai/v1/email-templates/{templateId}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"version": 2
}'import requests
url = "https://api.tented.ai/v1/email-templates/{templateId}/approve"
payload = { "version": 2 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: 2})
};
fetch('https://api.tented.ai/v1/email-templates/{templateId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tented.ai/v1/email-templates/{templateId}/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tented.ai/v1/email-templates/{templateId}/approve"
payload := strings.NewReader("{\n \"version\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tented.ai/v1/email-templates/{templateId}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tented.ai/v1/email-templates/{templateId}/approve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 2\n}"
response = http.request(request)
puts response.read_body{
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "draft",
"current_version": 123,
"source_type": "upload",
"source_email_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_subject": "<string>",
"default_preview_text": "<string>",
"default_from_name": "<string>",
"default_from_address": "<string>",
"default_reply_to_email": "<string>",
"approved_version": 123,
"number_of_iterations": 123,
"plain_text_overridden": true,
"plain_text_overridden_at": "2023-11-07T05:31:56Z",
"plain_text_stale_after_html_iteration": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_name": "<string>",
"latest_generation_status": "generating",
"content_path": "<string>",
"plain_text_path": "<string>"
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}Email Templates
Approve an email template
Mark the newest completed version as approved and usable for seeding new emails via POST /v1/emails with template_id. Requires at least one completed generation (409 template_not_ready); unlike emails there is no required-sender-header gate — the default header fields are optional. Pass version as an optimistic-concurrency precondition; a mismatch with the newest completed version fails with 409 approval_version_stale. While a generation is running, an approve without version fails with 409 generation_in_progress; a version-pinned approve still succeeds.
POST
/
v1
/
email-templates
/
{templateId}
/
approve
Approve an email template
curl --request POST \
--url https://api.tented.ai/v1/email-templates/{templateId}/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"version": 2
}'import requests
url = "https://api.tented.ai/v1/email-templates/{templateId}/approve"
payload = { "version": 2 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: 2})
};
fetch('https://api.tented.ai/v1/email-templates/{templateId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tented.ai/v1/email-templates/{templateId}/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tented.ai/v1/email-templates/{templateId}/approve"
payload := strings.NewReader("{\n \"version\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tented.ai/v1/email-templates/{templateId}/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tented.ai/v1/email-templates/{templateId}/approve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 2\n}"
response = http.request(request)
puts response.read_body{
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "draft",
"current_version": 123,
"source_type": "upload",
"source_email_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_subject": "<string>",
"default_preview_text": "<string>",
"default_from_name": "<string>",
"default_from_address": "<string>",
"default_reply_to_email": "<string>",
"approved_version": 123,
"number_of_iterations": 123,
"plain_text_overridden": true,
"plain_text_overridden_at": "2023-11-07T05:31:56Z",
"plain_text_stale_after_html_iteration": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_name": "<string>",
"latest_generation_status": "generating",
"content_path": "<string>",
"plain_text_path": "<string>"
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}Authorizations
Response
Approved.
Full email template object.