curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"filter": {
"sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"email_account_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"sync_type": {
"in": []
},
"sync_mode": {},
"triggered_by": {
"in": []
},
"status": {
"in": []
},
"started_at": {
"gte": "<string>",
"lte": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": true
},
"created_at": {
"gte": "<string>",
"lte": "<string>"
}
},
"include": [
"email_account"
],
"page_size": 250,
"cursor": "<string>"
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search"
payload = {
"filter": {
"sid": {
"eq": "<string>",
"in": ["<string>"]
},
"email_account_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"sync_type": { "in": [] },
"sync_mode": {},
"triggered_by": { "in": [] },
"status": { "in": [] },
"started_at": {
"gte": "<string>",
"lte": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": True
},
"created_at": {
"gte": "<string>",
"lte": "<string>"
}
},
"include": ["email_account"],
"page_size": 250,
"cursor": "<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({
filter: {
sid: {eq: '<string>', in: ['<string>']},
email_account_sid: {eq: '<string>', in: ['<string>']},
sync_type: {in: []},
sync_mode: {},
triggered_by: {in: []},
status: {in: []},
started_at: {gte: '<string>', lte: '<string>'},
finished_at: {gte: '<string>', lte: '<string>', is_null: true},
created_at: {gte: '<string>', lte: '<string>'}
},
include: ['email_account'],
page_size: 250,
cursor: '<string>'
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search', 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-account-sync-runs/search",
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([
'filter' => [
'sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'email_account_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'sync_type' => [
'in' => [
]
],
'sync_mode' => [
],
'triggered_by' => [
'in' => [
]
],
'status' => [
'in' => [
]
],
'started_at' => [
'gte' => '<string>',
'lte' => '<string>'
],
'finished_at' => [
'gte' => '<string>',
'lte' => '<string>',
'is_null' => true
],
'created_at' => [
'gte' => '<string>',
'lte' => '<string>'
]
],
'include' => [
'email_account'
],
'page_size' => 250,
'cursor' => '<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-account-sync-runs/search"
payload := strings.NewReader("{\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"email_account_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sync_type\": {\n \"in\": []\n },\n \"sync_mode\": {},\n \"triggered_by\": {\n \"in\": []\n },\n \"status\": {\n \"in\": []\n },\n \"started_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n }\n },\n \"include\": [\n \"email_account\"\n ],\n \"page_size\": 250,\n \"cursor\": \"<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-account-sync-runs/search")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"email_account_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sync_type\": {\n \"in\": []\n },\n \"sync_mode\": {},\n \"triggered_by\": {\n \"in\": []\n },\n \"status\": {\n \"in\": []\n },\n \"started_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n }\n },\n \"include\": [\n \"email_account\"\n ],\n \"page_size\": 250,\n \"cursor\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search")
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 \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"email_account_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sync_type\": {\n \"in\": []\n },\n \"sync_mode\": {},\n \"triggered_by\": {\n \"in\": []\n },\n \"status\": {\n \"in\": []\n },\n \"started_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n }\n },\n \"include\": [\n \"email_account\"\n ],\n \"page_size\": 250,\n \"cursor\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "search",
"items": [
{
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_account_sid": "<string>",
"sync_type": "messages",
"sync_mode": "initial",
"triggered_by": "bootstrap",
"next_cursor": "<string>",
"status": "pending",
"messages_upserted": 123,
"messages_deleted": 123,
"folders_synced": 123,
"pages_fetched": 123,
"last_progress_at": "<string>",
"next_attempt_at": "<string>",
"wait_reason": "provider_throttle",
"started_at": "<string>",
"finished_at": "<string>",
"error_message": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"included": {
"email_account": {
"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>"
}
}
}
],
"pagination": {
"next_cursor": "<string>",
"has_more": true,
"total_count": 123
},
"applied_filters": {},
"includes": [
"<string>"
],
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
},
"counts": {
"total_count": 123,
"groups": {
"status": {},
"sync_mode": {}
}
}
}Search email account sync runs
List the sync runs of the team’s mailboxes: one run is one drain of a mailbox’s messages or folders, with its status (pending, in_progress, completed, cancelled; there is no failed), its counters and, while it waits, wait_reason and next_attempt_at. Use it to poll the run sync_email_account started (filter sid, page_size 1, until completed or cancelled), to see what is still syncing or how far the first import of a new mailbox is (sync_mode initial, messages_upserted), and why data is stale. A cancelled run says why in error_message; auth_dead means the mailbox needs a reconnect. Not for how fresh a mailbox is: read last_messages_sync_at on the mailbox. Requires can_view_email_accounts.
Contract:
- MCP tool
search_email_account_sync_runs, registry packagemcp.email/email_account_sync_runs, mountemail.accounts. - Operation
search, response envelopesearch. - Flags: read only.
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"filter": {
"sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"email_account_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"sync_type": {
"in": []
},
"sync_mode": {},
"triggered_by": {
"in": []
},
"status": {
"in": []
},
"started_at": {
"gte": "<string>",
"lte": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": true
},
"created_at": {
"gte": "<string>",
"lte": "<string>"
}
},
"include": [
"email_account"
],
"page_size": 250,
"cursor": "<string>"
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search"
payload = {
"filter": {
"sid": {
"eq": "<string>",
"in": ["<string>"]
},
"email_account_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"sync_type": { "in": [] },
"sync_mode": {},
"triggered_by": { "in": [] },
"status": { "in": [] },
"started_at": {
"gte": "<string>",
"lte": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": True
},
"created_at": {
"gte": "<string>",
"lte": "<string>"
}
},
"include": ["email_account"],
"page_size": 250,
"cursor": "<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({
filter: {
sid: {eq: '<string>', in: ['<string>']},
email_account_sid: {eq: '<string>', in: ['<string>']},
sync_type: {in: []},
sync_mode: {},
triggered_by: {in: []},
status: {in: []},
started_at: {gte: '<string>', lte: '<string>'},
finished_at: {gte: '<string>', lte: '<string>', is_null: true},
created_at: {gte: '<string>', lte: '<string>'}
},
include: ['email_account'],
page_size: 250,
cursor: '<string>'
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search', 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-account-sync-runs/search",
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([
'filter' => [
'sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'email_account_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'sync_type' => [
'in' => [
]
],
'sync_mode' => [
],
'triggered_by' => [
'in' => [
]
],
'status' => [
'in' => [
]
],
'started_at' => [
'gte' => '<string>',
'lte' => '<string>'
],
'finished_at' => [
'gte' => '<string>',
'lte' => '<string>',
'is_null' => true
],
'created_at' => [
'gte' => '<string>',
'lte' => '<string>'
]
],
'include' => [
'email_account'
],
'page_size' => 250,
'cursor' => '<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-account-sync-runs/search"
payload := strings.NewReader("{\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"email_account_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sync_type\": {\n \"in\": []\n },\n \"sync_mode\": {},\n \"triggered_by\": {\n \"in\": []\n },\n \"status\": {\n \"in\": []\n },\n \"started_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n }\n },\n \"include\": [\n \"email_account\"\n ],\n \"page_size\": 250,\n \"cursor\": \"<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-account-sync-runs/search")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"email_account_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sync_type\": {\n \"in\": []\n },\n \"sync_mode\": {},\n \"triggered_by\": {\n \"in\": []\n },\n \"status\": {\n \"in\": []\n },\n \"started_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n }\n },\n \"include\": [\n \"email_account\"\n ],\n \"page_size\": 250,\n \"cursor\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-account-sync-runs/search")
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 \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"email_account_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sync_type\": {\n \"in\": []\n },\n \"sync_mode\": {},\n \"triggered_by\": {\n \"in\": []\n },\n \"status\": {\n \"in\": []\n },\n \"started_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n }\n },\n \"include\": [\n \"email_account\"\n ],\n \"page_size\": 250,\n \"cursor\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "search",
"items": [
{
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_account_sid": "<string>",
"sync_type": "messages",
"sync_mode": "initial",
"triggered_by": "bootstrap",
"next_cursor": "<string>",
"status": "pending",
"messages_upserted": 123,
"messages_deleted": 123,
"folders_synced": 123,
"pages_fetched": 123,
"last_progress_at": "<string>",
"next_attempt_at": "<string>",
"wait_reason": "provider_throttle",
"started_at": "<string>",
"finished_at": "<string>",
"error_message": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"included": {
"email_account": {
"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>"
}
}
}
],
"pagination": {
"next_cursor": "<string>",
"has_more": true,
"total_count": 123
},
"applied_filters": {},
"includes": [
"<string>"
],
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
},
"counts": {
"total_count": 123,
"groups": {
"status": {},
"sync_mode": {}
}
}
}Authorizations
Headers
Body
Request body of search_email_account_sync_runs.
Response
search success envelope.