curl --request POST \
--url https://api.heymilo.ai/api/v2/email-templates \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"template_key": "WEB_INTERVIEW_INVITATION",
"name": "Acme interview invitation",
"subject": "Your interview for {{job_title}} at {{company_name}}",
"content": "<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\"{{interview_link}}\">{{interview_link}}</a></p>",
"blackout_period": {
"timezone": "Europe/Berlin",
"start_hour": 22,
"end_hour": 7,
"enabled": true
}
}
'import requests
url = "https://api.heymilo.ai/api/v2/email-templates"
payload = {
"template_key": "WEB_INTERVIEW_INVITATION",
"name": "Acme interview invitation",
"subject": "Your interview for {{job_title}} at {{company_name}}",
"content": "<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\"{{interview_link}}\">{{interview_link}}</a></p>",
"blackout_period": {
"timezone": "Europe/Berlin",
"start_hour": 22,
"end_hour": 7,
"enabled": True
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_key: 'WEB_INTERVIEW_INVITATION',
name: 'Acme interview invitation',
subject: 'Your interview for {{job_title}} at {{company_name}}',
content: '<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href="{{interview_link}}">{{interview_link}}</a></p>',
blackout_period: {timezone: 'Europe/Berlin', start_hour: 22, end_hour: 7, enabled: true}
})
};
fetch('https://api.heymilo.ai/api/v2/email-templates', 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.heymilo.ai/api/v2/email-templates",
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([
'template_key' => 'WEB_INTERVIEW_INVITATION',
'name' => 'Acme interview invitation',
'subject' => 'Your interview for {{job_title}} at {{company_name}}',
'content' => '<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href="{{interview_link}}">{{interview_link}}</a></p>',
'blackout_period' => [
'timezone' => 'Europe/Berlin',
'start_hour' => 22,
'end_hour' => 7,
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.heymilo.ai/api/v2/email-templates"
payload := strings.NewReader("{\n \"template_key\": \"WEB_INTERVIEW_INVITATION\",\n \"name\": \"Acme interview invitation\",\n \"subject\": \"Your interview for {{job_title}} at {{company_name}}\",\n \"content\": \"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\\\"{{interview_link}}\\\">{{interview_link}}</a></p>\",\n \"blackout_period\": {\n \"timezone\": \"Europe/Berlin\",\n \"start_hour\": 22,\n \"end_hour\": 7,\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.heymilo.ai/api/v2/email-templates")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template_key\": \"WEB_INTERVIEW_INVITATION\",\n \"name\": \"Acme interview invitation\",\n \"subject\": \"Your interview for {{job_title}} at {{company_name}}\",\n \"content\": \"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\\\"{{interview_link}}\\\">{{interview_link}}</a></p>\",\n \"blackout_period\": {\n \"timezone\": \"Europe/Berlin\",\n \"start_hour\": 22,\n \"end_hour\": 7,\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heymilo.ai/api/v2/email-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_key\": \"WEB_INTERVIEW_INVITATION\",\n \"name\": \"Acme interview invitation\",\n \"subject\": \"Your interview for {{job_title}} at {{company_name}}\",\n \"content\": \"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\\\"{{interview_link}}\\\">{{interview_link}}</a></p>\",\n \"blackout_period\": {\n \"timezone\": \"Europe/Berlin\",\n \"start_hour\": 22,\n \"end_hour\": 7,\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "B31EB9E73BEE",
"template_key": "WEB_INTERVIEW_INVITATION",
"name": "Custom Interview Invitation",
"subject": "Interview Confirmation for {{job_title}} at {{company_name}}",
"content": "<p>Hello {{candidate_name}}, ...</p>",
"created_at": 1739612400,
"updated_at": 1739617200,
"object": "email_template",
"blackout_period": {
"enabled": true,
"timezone": "America/New_York",
"start_hour": 22,
"end_hour": 7
},
"content_warnings": [
{}
]
},
"meta": {}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}Create an email template
Create a template for one candidate email, such as the interview invitation. A template is only sent once it is mapped into an email template group and that group is set on an interviewer (email_template_group_id).
Content is screened before it is saved: content that breaks policy returns 422, and softer issues come back in content_warnings.
curl --request POST \
--url https://api.heymilo.ai/api/v2/email-templates \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"template_key": "WEB_INTERVIEW_INVITATION",
"name": "Acme interview invitation",
"subject": "Your interview for {{job_title}} at {{company_name}}",
"content": "<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\"{{interview_link}}\">{{interview_link}}</a></p>",
"blackout_period": {
"timezone": "Europe/Berlin",
"start_hour": 22,
"end_hour": 7,
"enabled": true
}
}
'import requests
url = "https://api.heymilo.ai/api/v2/email-templates"
payload = {
"template_key": "WEB_INTERVIEW_INVITATION",
"name": "Acme interview invitation",
"subject": "Your interview for {{job_title}} at {{company_name}}",
"content": "<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\"{{interview_link}}\">{{interview_link}}</a></p>",
"blackout_period": {
"timezone": "Europe/Berlin",
"start_hour": 22,
"end_hour": 7,
"enabled": True
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_key: 'WEB_INTERVIEW_INVITATION',
name: 'Acme interview invitation',
subject: 'Your interview for {{job_title}} at {{company_name}}',
content: '<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href="{{interview_link}}">{{interview_link}}</a></p>',
blackout_period: {timezone: 'Europe/Berlin', start_hour: 22, end_hour: 7, enabled: true}
})
};
fetch('https://api.heymilo.ai/api/v2/email-templates', 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.heymilo.ai/api/v2/email-templates",
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([
'template_key' => 'WEB_INTERVIEW_INVITATION',
'name' => 'Acme interview invitation',
'subject' => 'Your interview for {{job_title}} at {{company_name}}',
'content' => '<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href="{{interview_link}}">{{interview_link}}</a></p>',
'blackout_period' => [
'timezone' => 'Europe/Berlin',
'start_hour' => 22,
'end_hour' => 7,
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.heymilo.ai/api/v2/email-templates"
payload := strings.NewReader("{\n \"template_key\": \"WEB_INTERVIEW_INVITATION\",\n \"name\": \"Acme interview invitation\",\n \"subject\": \"Your interview for {{job_title}} at {{company_name}}\",\n \"content\": \"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\\\"{{interview_link}}\\\">{{interview_link}}</a></p>\",\n \"blackout_period\": {\n \"timezone\": \"Europe/Berlin\",\n \"start_hour\": 22,\n \"end_hour\": 7,\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.heymilo.ai/api/v2/email-templates")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template_key\": \"WEB_INTERVIEW_INVITATION\",\n \"name\": \"Acme interview invitation\",\n \"subject\": \"Your interview for {{job_title}} at {{company_name}}\",\n \"content\": \"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\\\"{{interview_link}}\\\">{{interview_link}}</a></p>\",\n \"blackout_period\": {\n \"timezone\": \"Europe/Berlin\",\n \"start_hour\": 22,\n \"end_hour\": 7,\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heymilo.ai/api/v2/email-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_key\": \"WEB_INTERVIEW_INVITATION\",\n \"name\": \"Acme interview invitation\",\n \"subject\": \"Your interview for {{job_title}} at {{company_name}}\",\n \"content\": \"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\\\"{{interview_link}}\\\">{{interview_link}}</a></p>\",\n \"blackout_period\": {\n \"timezone\": \"Europe/Berlin\",\n \"start_hour\": 22,\n \"end_hour\": 7,\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "B31EB9E73BEE",
"template_key": "WEB_INTERVIEW_INVITATION",
"name": "Custom Interview Invitation",
"subject": "Interview Confirmation for {{job_title}} at {{company_name}}",
"content": "<p>Hello {{candidate_name}}, ...</p>",
"created_at": 1739612400,
"updated_at": 1739617200,
"object": "email_template",
"blackout_period": {
"enabled": true,
"timezone": "America/New_York",
"start_hour": 22,
"end_hour": 7
},
"content_warnings": [
{}
]
},
"meta": {}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "The request body failed validation",
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"code": "invalid_param",
"message": "title must be between 3 and 200 characters",
"param": "title"
}
]
}
}Authorizations
Body
Request body for creating an email template.
Which email this template replaces. Cannot be changed later.
WEB_INTERVIEW_INVITATION, WEB_INTERVIEW_NUDGE, WEB_INTERVIEW_FINAL_NUDGE, RESUME_INVITATION, RESUME_NUDGE, FORM_INVITATION, FORM_NUDGE, SCHEDULING_LINK_EMAIL, REPORT_READY_EMAIL, RETAKE_AVAILABLE_EMAIL, INTERVIEW_COMPLETION, LLM_SCENARIO_INVITATION, LLM_SCENARIO_NUDGE, BOOKING_CONFIRMED_EMAIL, BOOKING_RESCHEDULED_EMAIL, BOOKING_CANCELLED_EMAIL, BOOKING_REMINDER_EMAIL "WEB_INTERVIEW_INVITATION"
Email HTML body. Supports {{variable}} placeholders; invitation emails should include {{interview_link}}. A template whose placeholders cannot be filled when sending falls back to HeyMilo's default email.
1 - 100000"<p>Hi {{candidate_name}},</p><p>Start your interview here: <a href=\"{{interview_link}}\">{{interview_link}}</a></p>"
Response
Successful Response
Was this page helpful?