curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"email_oauth_app_sid": "<string>",
"addresses": [
"jsmith@example.com"
],
"backfill_days": 1825
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create"
payload = {
"email_oauth_app_sid": "<string>",
"addresses": ["jsmith@example.com"],
"backfill_days": 1825
}
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({
email_oauth_app_sid: '<string>',
addresses: ['jsmith@example.com'],
backfill_days: 1825
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create', 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/bulk-create",
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([
'email_oauth_app_sid' => '<string>',
'addresses' => [
'jsmith@example.com'
],
'backfill_days' => 1825
]),
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/bulk-create"
payload := strings.NewReader("{\n \"email_oauth_app_sid\": \"<string>\",\n \"addresses\": [\n \"jsmith@example.com\"\n ],\n \"backfill_days\": 1825\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/bulk-create")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email_oauth_app_sid\": \"<string>\",\n \"addresses\": [\n \"jsmith@example.com\"\n ],\n \"backfill_days\": 1825\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create")
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 \"email_oauth_app_sid\": \"<string>\",\n \"addresses\": [\n \"jsmith@example.com\"\n ],\n \"backfill_days\": 1825\n}"
response = http.request(request)
puts response.read_bodyBulk create email accounts
Connect up to 100 mailboxes of one organisation in a call, with no consent screen and no password: through a sign-in application of kind service_account (a Google service account with domain-wide delegation) or app_only (a Microsoft app registration), which holds the credential (search_email_oauth_apps; an oauth_client application is refused). You name the addresses. Each is answered on its own in result.items: ok true with the mailbox, or ok false with the reason (mailbox_not_found, delegation_not_authorized, no_mailbox_license, account_bound_other_team and the like); one bad address never fails the others. The same list again answers already_exists true. With no free seat on the server a mailbox lands held. Requires can_manage_email_accounts.
Contract:
- MCP tool
bulk_create_email_accounts, registry packagemcp.email/email_accounts, mountemail.accounts. - Operation
action, response envelopeaction. - Flags: none.
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"email_oauth_app_sid": "<string>",
"addresses": [
"jsmith@example.com"
],
"backfill_days": 1825
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create"
payload = {
"email_oauth_app_sid": "<string>",
"addresses": ["jsmith@example.com"],
"backfill_days": 1825
}
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({
email_oauth_app_sid: '<string>',
addresses: ['jsmith@example.com'],
backfill_days: 1825
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create', 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/bulk-create",
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([
'email_oauth_app_sid' => '<string>',
'addresses' => [
'jsmith@example.com'
],
'backfill_days' => 1825
]),
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/bulk-create"
payload := strings.NewReader("{\n \"email_oauth_app_sid\": \"<string>\",\n \"addresses\": [\n \"jsmith@example.com\"\n ],\n \"backfill_days\": 1825\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/bulk-create")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email_oauth_app_sid\": \"<string>\",\n \"addresses\": [\n \"jsmith@example.com\"\n ],\n \"backfill_days\": 1825\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts/bulk-create")
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 \"email_oauth_app_sid\": \"<string>\",\n \"addresses\": [\n \"jsmith@example.com\"\n ],\n \"backfill_days\": 1825\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Headers
Body
Request body of bulk_create_email_accounts.