Create email account
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"address": "jsmith@example.com",
"display_name": "<string>",
"label": "<string>",
"backfill_days": 1825,
"email_oauth_app_sid": "<string>",
"oauth_refresh_token": "<string>",
"imap_password": "<string>",
"smtp_password": "<string>",
"email_sending_domain_sid": "<string>"
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts"
payload = {
"address": "jsmith@example.com",
"display_name": "<string>",
"label": "<string>",
"backfill_days": 1825,
"email_oauth_app_sid": "<string>",
"oauth_refresh_token": "<string>",
"imap_password": "<string>",
"smtp_password": "<string>",
"email_sending_domain_sid": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: 'jsmith@example.com',
display_name: '<string>',
label: '<string>',
backfill_days: 1825,
email_oauth_app_sid: '<string>',
oauth_refresh_token: '<string>',
imap_password: '<string>',
smtp_password: '<string>',
email_sending_domain_sid: '<string>'
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts', 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://app.gtm-api.com/email/v4/api/email-accounts",
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([
'address' => 'jsmith@example.com',
'display_name' => '<string>',
'label' => '<string>',
'backfill_days' => 1825,
'email_oauth_app_sid' => '<string>',
'oauth_refresh_token' => '<string>',
'imap_password' => '<string>',
'smtp_password' => '<string>',
'email_sending_domain_sid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <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://app.gtm-api.com/email/v4/api/email-accounts"
payload := strings.NewReader("{\n \"address\": \"jsmith@example.com\",\n \"display_name\": \"<string>\",\n \"label\": \"<string>\",\n \"backfill_days\": 1825,\n \"email_oauth_app_sid\": \"<string>\",\n \"oauth_refresh_token\": \"<string>\",\n \"imap_password\": \"<string>\",\n \"smtp_password\": \"<string>\",\n \"email_sending_domain_sid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<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://app.gtm-api.com/email/v4/api/email-accounts")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"jsmith@example.com\",\n \"display_name\": \"<string>\",\n \"label\": \"<string>\",\n \"backfill_days\": 1825,\n \"email_oauth_app_sid\": \"<string>\",\n \"oauth_refresh_token\": \"<string>\",\n \"imap_password\": \"<string>\",\n \"smtp_password\": \"<string>\",\n \"email_sending_domain_sid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"jsmith@example.com\",\n \"display_name\": \"<string>\",\n \"label\": \"<string>\",\n \"backfill_days\": 1825,\n \"email_oauth_app_sid\": \"<string>\",\n \"oauth_refresh_token\": \"<string>\",\n \"imap_password\": \"<string>\",\n \"smtp_password\": \"<string>\",\n \"email_sending_domain_sid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_sending_domain_sid": "<string>",
"provider": "google",
"address": "<string>",
"display_name": "<string>",
"aliases": [
"<string>"
],
"status": "connecting",
"sending_paused_at": "<string>",
"sending_paused_reason": "manual",
"connection": {
"imap_host": "<string>",
"imap_port": 123,
"imap_encryption": "ssl",
"imap_username": "<string>",
"smtp_host": "<string>",
"smtp_port": 123,
"smtp_encryption": "ssl",
"smtp_username": "<string>"
},
"sending_limits": {
"daily_limit": 123,
"min_interval_seconds": 123,
"sending_window": {
"time_zone": "<string>",
"days": [
123
],
"start": "<string>",
"end": "<string>"
}
},
"warmup_config": {
"enabled": true,
"ramp_start_daily": 123,
"ramp_step_per_day": 123,
"target_daily": 123
},
"signature_html": "<string>",
"track_opens": true,
"track_clicks": true,
"email_tracking_domain_sid": "<string>",
"email_oauth_app_sid": "<string>",
"backfill_days": 123,
"last_messages_sync_at": "<string>",
"last_folders_sync_at": "<string>",
"connected_at": "<string>",
"reconnect_required_at": "<string>",
"sync_config": {},
"webhook_config": {},
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"sending_paused_until": "<string>",
"reconnect_reason": "<string>",
"email_box_sid": "<string>",
"label": "<string>",
"address_domain": "<string>",
"sent_today": 123,
"daily_cap_today": 123,
"warmup_day": 123,
"auth_suspect": {
"since": "<string>",
"failures": 123,
"next_try_at": "<string>",
"source": "<string>"
},
"subscription_hold_reason": "server_full",
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}email_accounts
Create email account
Connect a mailbox with credentials you hold, or mint a hosted one. Four forms by provider: google or microsoft with oauth_refresh_token and the application that issued it; google or microsoft with an address under a service_account or app_only application (no consent); imap_smtp with the servers and both passwords; gtm_hosted on a verified sending domain. The credential is probed before the row is written. A mailbox already connected by this team is answered with already_exists true; one bound to another team is 409 account_bound_other_team. With no free seat on the server the mailbox lands held (subscription_required). Requires can_manage_email_accounts.
Contract:
- REST only: no MCP tool serves this route (registry package
mcp.email/email_accounts, surface api). - Operation
create, response envelopecreate. - Flags: none.
POST
/
api
/
email-accounts
Create email account
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"address": "jsmith@example.com",
"display_name": "<string>",
"label": "<string>",
"backfill_days": 1825,
"email_oauth_app_sid": "<string>",
"oauth_refresh_token": "<string>",
"imap_password": "<string>",
"smtp_password": "<string>",
"email_sending_domain_sid": "<string>"
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts"
payload = {
"address": "jsmith@example.com",
"display_name": "<string>",
"label": "<string>",
"backfill_days": 1825,
"email_oauth_app_sid": "<string>",
"oauth_refresh_token": "<string>",
"imap_password": "<string>",
"smtp_password": "<string>",
"email_sending_domain_sid": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: 'jsmith@example.com',
display_name: '<string>',
label: '<string>',
backfill_days: 1825,
email_oauth_app_sid: '<string>',
oauth_refresh_token: '<string>',
imap_password: '<string>',
smtp_password: '<string>',
email_sending_domain_sid: '<string>'
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts', 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://app.gtm-api.com/email/v4/api/email-accounts",
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([
'address' => 'jsmith@example.com',
'display_name' => '<string>',
'label' => '<string>',
'backfill_days' => 1825,
'email_oauth_app_sid' => '<string>',
'oauth_refresh_token' => '<string>',
'imap_password' => '<string>',
'smtp_password' => '<string>',
'email_sending_domain_sid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <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://app.gtm-api.com/email/v4/api/email-accounts"
payload := strings.NewReader("{\n \"address\": \"jsmith@example.com\",\n \"display_name\": \"<string>\",\n \"label\": \"<string>\",\n \"backfill_days\": 1825,\n \"email_oauth_app_sid\": \"<string>\",\n \"oauth_refresh_token\": \"<string>\",\n \"imap_password\": \"<string>\",\n \"smtp_password\": \"<string>\",\n \"email_sending_domain_sid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<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://app.gtm-api.com/email/v4/api/email-accounts")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"jsmith@example.com\",\n \"display_name\": \"<string>\",\n \"label\": \"<string>\",\n \"backfill_days\": 1825,\n \"email_oauth_app_sid\": \"<string>\",\n \"oauth_refresh_token\": \"<string>\",\n \"imap_password\": \"<string>\",\n \"smtp_password\": \"<string>\",\n \"email_sending_domain_sid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"jsmith@example.com\",\n \"display_name\": \"<string>\",\n \"label\": \"<string>\",\n \"backfill_days\": 1825,\n \"email_oauth_app_sid\": \"<string>\",\n \"oauth_refresh_token\": \"<string>\",\n \"imap_password\": \"<string>\",\n \"smtp_password\": \"<string>\",\n \"email_sending_domain_sid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "create",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_sending_domain_sid": "<string>",
"provider": "google",
"address": "<string>",
"display_name": "<string>",
"aliases": [
"<string>"
],
"status": "connecting",
"sending_paused_at": "<string>",
"sending_paused_reason": "manual",
"connection": {
"imap_host": "<string>",
"imap_port": 123,
"imap_encryption": "ssl",
"imap_username": "<string>",
"smtp_host": "<string>",
"smtp_port": 123,
"smtp_encryption": "ssl",
"smtp_username": "<string>"
},
"sending_limits": {
"daily_limit": 123,
"min_interval_seconds": 123,
"sending_window": {
"time_zone": "<string>",
"days": [
123
],
"start": "<string>",
"end": "<string>"
}
},
"warmup_config": {
"enabled": true,
"ramp_start_daily": 123,
"ramp_step_per_day": 123,
"target_daily": 123
},
"signature_html": "<string>",
"track_opens": true,
"track_clicks": true,
"email_tracking_domain_sid": "<string>",
"email_oauth_app_sid": "<string>",
"backfill_days": 123,
"last_messages_sync_at": "<string>",
"last_folders_sync_at": "<string>",
"connected_at": "<string>",
"reconnect_required_at": "<string>",
"sync_config": {},
"webhook_config": {},
"created_by": {
"actor_type": "user",
"actor_sid": "<string>",
"team_sid": "<string>",
"permissions": {},
"actor_name": "<string>",
"oauth_client_sid": "<string>",
"reason": "<string>",
"cluster_id": 123,
"trace_id": "<string>"
},
"sending_paused_until": "<string>",
"reconnect_reason": "<string>",
"email_box_sid": "<string>",
"label": "<string>",
"address_domain": "<string>",
"sent_today": 123,
"daily_cap_today": 123,
"warmup_day": 123,
"auth_suspect": {
"since": "<string>",
"failures": 123,
"next_try_at": "<string>",
"source": "<string>"
},
"subscription_hold_reason": "server_full",
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"already_exists": true,
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}Authorizations
Headers
Body
application/json
Request body of create_email_account.