Email account daily sends
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": {
"email_account_sid": {
"in": [
"<string>"
]
}
}
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends"
payload = {
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": { "email_account_sid": { "in": ["<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({
period: {from: '<string>', to: '<string>'},
filter: {email_account_sid: {in: ['<string>']}}
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends', 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/daily-sends",
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([
'period' => [
'from' => '<string>',
'to' => '<string>'
],
'filter' => [
'email_account_sid' => [
'in' => [
'<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/daily-sends"
payload := strings.NewReader("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"email_account_sid\": {\n \"in\": [\n \"<string>\"\n ]\n }\n }\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/daily-sends")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"email_account_sid\": {\n \"in\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends")
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 \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"email_account_sid\": {\n \"in\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "metrics",
"metrics": {
"period": {
"from": "<string>",
"to": "<string>",
"time_zone": "<string>"
}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
},
"items": [
{
"date": "<string>",
"email_account_sid": "<string>",
"sent": 123,
"bounced": 123
}
],
"applied_filters": {}
}email_accounts
Email account daily sends
Outbound mail per mailbox per calendar day, for a chart or a pacing check: items holds one entry per mailbox per day that sent, with sent (what left) and bounced (the part of it that came back); a day with nothing sent has no entry. period is two dates, both included, at most 31 days, read in the server’s time zone (metrics.period.time_zone says which), so the days of different mailboxes line up. filter.email_account_sid.in narrows it to named mailboxes. Today’s count against today’s cap is on the mailbox itself (sent_today, daily_cap_today). Requires can_view_email_accounts.
Contract:
- MCP tool
get_email_accounts_daily_sends, registry packagemcp.email/email_accounts, mountemail.accounts. - Operation
metrics, response envelopemetrics. - Flags: read only.
POST
/
api
/
email-accounts
/
daily-sends
Email account daily sends
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": {
"email_account_sid": {
"in": [
"<string>"
]
}
}
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends"
payload = {
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": { "email_account_sid": { "in": ["<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({
period: {from: '<string>', to: '<string>'},
filter: {email_account_sid: {in: ['<string>']}}
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends', 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/daily-sends",
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([
'period' => [
'from' => '<string>',
'to' => '<string>'
],
'filter' => [
'email_account_sid' => [
'in' => [
'<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/daily-sends"
payload := strings.NewReader("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"email_account_sid\": {\n \"in\": [\n \"<string>\"\n ]\n }\n }\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/daily-sends")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"email_account_sid\": {\n \"in\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts/daily-sends")
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 \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"email_account_sid\": {\n \"in\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "metrics",
"metrics": {
"period": {
"from": "<string>",
"to": "<string>",
"time_zone": "<string>"
}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
},
"items": [
{
"date": "<string>",
"email_account_sid": "<string>",
"sent": 123,
"bounced": 123
}
],
"applied_filters": {}
}Authorizations
Headers
Body
application/json
Response
metrics success envelope.