Create an email template group
curl --request POST \
--url https://api.heymilo.ai/api/v2/email-template-groups \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Acme Corp emails",
"template_mappings": {
"WEB_INTERVIEW_INVITATION": "B31EB9E73BEE"
},
"sender_email_id": "1BF9F7881AC8",
"fallback_to_system_defaults": true
}
'import requests
url = "https://api.heymilo.ai/api/v2/email-template-groups"
payload = {
"name": "Acme Corp emails",
"template_mappings": { "WEB_INTERVIEW_INVITATION": "B31EB9E73BEE" },
"sender_email_id": "1BF9F7881AC8",
"fallback_to_system_defaults": 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({
name: 'Acme Corp emails',
template_mappings: {WEB_INTERVIEW_INVITATION: 'B31EB9E73BEE'},
sender_email_id: '1BF9F7881AC8',
fallback_to_system_defaults: true
})
};
fetch('https://api.heymilo.ai/api/v2/email-template-groups', 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-template-groups",
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([
'name' => 'Acme Corp emails',
'template_mappings' => [
'WEB_INTERVIEW_INVITATION' => 'B31EB9E73BEE'
],
'sender_email_id' => '1BF9F7881AC8',
'fallback_to_system_defaults' => 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-template-groups"
payload := strings.NewReader("{\n \"name\": \"Acme Corp emails\",\n \"template_mappings\": {\n \"WEB_INTERVIEW_INVITATION\": \"B31EB9E73BEE\"\n },\n \"sender_email_id\": \"1BF9F7881AC8\",\n \"fallback_to_system_defaults\": true\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-template-groups")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp emails\",\n \"template_mappings\": {\n \"WEB_INTERVIEW_INVITATION\": \"B31EB9E73BEE\"\n },\n \"sender_email_id\": \"1BF9F7881AC8\",\n \"fallback_to_system_defaults\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heymilo.ai/api/v2/email-template-groups")
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 \"name\": \"Acme Corp emails\",\n \"template_mappings\": {\n \"WEB_INTERVIEW_INVITATION\": \"B31EB9E73BEE\"\n },\n \"sender_email_id\": \"1BF9F7881AC8\",\n \"fallback_to_system_defaults\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "E629E33BC4AD",
"name": "Engineering Hiring Emails",
"template_mappings": {
"WEB_INTERVIEW_INVITATION": "B31EB9E73BEE",
"WEB_INTERVIEW_NUDGE": "637CE3438ACA"
},
"created_at": 1739612400,
"updated_at": 1739617200,
"object": "email_template_group",
"sender_email_id": "1BF9F7881AC8",
"fallback_to_system_defaults": true,
"is_default": false
},
"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"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"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 group
Create a group that maps each email type to a template, plus an optional sender address. Set the group’s ID as an interviewer’s email_template_group_id to send its templates to that interviewer’s candidates.
Each template must belong to this workspace and have the template_key it is mapped under; otherwise the request returns 400.
POST
/
api
/
v2
/
email-template-groups
Create an email template group
curl --request POST \
--url https://api.heymilo.ai/api/v2/email-template-groups \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Acme Corp emails",
"template_mappings": {
"WEB_INTERVIEW_INVITATION": "B31EB9E73BEE"
},
"sender_email_id": "1BF9F7881AC8",
"fallback_to_system_defaults": true
}
'import requests
url = "https://api.heymilo.ai/api/v2/email-template-groups"
payload = {
"name": "Acme Corp emails",
"template_mappings": { "WEB_INTERVIEW_INVITATION": "B31EB9E73BEE" },
"sender_email_id": "1BF9F7881AC8",
"fallback_to_system_defaults": 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({
name: 'Acme Corp emails',
template_mappings: {WEB_INTERVIEW_INVITATION: 'B31EB9E73BEE'},
sender_email_id: '1BF9F7881AC8',
fallback_to_system_defaults: true
})
};
fetch('https://api.heymilo.ai/api/v2/email-template-groups', 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-template-groups",
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([
'name' => 'Acme Corp emails',
'template_mappings' => [
'WEB_INTERVIEW_INVITATION' => 'B31EB9E73BEE'
],
'sender_email_id' => '1BF9F7881AC8',
'fallback_to_system_defaults' => 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-template-groups"
payload := strings.NewReader("{\n \"name\": \"Acme Corp emails\",\n \"template_mappings\": {\n \"WEB_INTERVIEW_INVITATION\": \"B31EB9E73BEE\"\n },\n \"sender_email_id\": \"1BF9F7881AC8\",\n \"fallback_to_system_defaults\": true\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-template-groups")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp emails\",\n \"template_mappings\": {\n \"WEB_INTERVIEW_INVITATION\": \"B31EB9E73BEE\"\n },\n \"sender_email_id\": \"1BF9F7881AC8\",\n \"fallback_to_system_defaults\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heymilo.ai/api/v2/email-template-groups")
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 \"name\": \"Acme Corp emails\",\n \"template_mappings\": {\n \"WEB_INTERVIEW_INVITATION\": \"B31EB9E73BEE\"\n },\n \"sender_email_id\": \"1BF9F7881AC8\",\n \"fallback_to_system_defaults\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "E629E33BC4AD",
"name": "Engineering Hiring Emails",
"template_mappings": {
"WEB_INTERVIEW_INVITATION": "B31EB9E73BEE",
"WEB_INTERVIEW_NUDGE": "637CE3438ACA"
},
"created_at": 1739612400,
"updated_at": 1739617200,
"object": "email_template_group",
"sender_email_id": "1BF9F7881AC8",
"fallback_to_system_defaults": true,
"is_default": false
},
"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"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"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
application/json
Request body for creating an email template group.
Response
Successful Response
Was this page helpful?