curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"q": "<string>",
"email_folder_sid": "<string>",
"since": "<string>",
"before": "<string>",
"limit": 25
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider"
payload = {
"q": "<string>",
"email_folder_sid": "<string>",
"since": "<string>",
"before": "<string>",
"limit": 25
}
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({
q: '<string>',
email_folder_sid: '<string>',
since: '<string>',
before: '<string>',
limit: 25
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider', 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/{sid}/search-provider",
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([
'q' => '<string>',
'email_folder_sid' => '<string>',
'since' => '<string>',
'before' => '<string>',
'limit' => 25
]),
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/{sid}/search-provider"
payload := strings.NewReader("{\n \"q\": \"<string>\",\n \"email_folder_sid\": \"<string>\",\n \"since\": \"<string>\",\n \"before\": \"<string>\",\n \"limit\": 25\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/{sid}/search-provider")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"<string>\",\n \"email_folder_sid\": \"<string>\",\n \"since\": \"<string>\",\n \"before\": \"<string>\",\n \"limit\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider")
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 \"q\": \"<string>\",\n \"email_folder_sid\": \"<string>\",\n \"since\": \"<string>\",\n \"before\": \"<string>\",\n \"limit\": 25\n}"
response = http.request(request)
puts response.read_bodySearch email account at provider
Search one mailbox at its provider (Gmail, Microsoft or the IMAP server) for mail the mirror may not hold: older than the backfill window, or matched by words of the body. The hits are mirrored by the call, so each is a normal message afterwards: read it with get_email_message, answer it with send_email_message. result.items are the messages without bodies, in the provider’s order, at most 50; truncated says the provider had more; sources says which were already mirrored. search_email_messages stays the cheap search of what is mirrored: try it first. An inactive or hosted mailbox answers 409 account_not_searchable; 503 provider_unavailable carries retry_after. Requires can_view_email_accounts.
Contract:
- MCP tool
search_email_account_provider, 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/{sid}/search-provider \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"q": "<string>",
"email_folder_sid": "<string>",
"since": "<string>",
"before": "<string>",
"limit": 25
}
'import requests
url = "https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider"
payload = {
"q": "<string>",
"email_folder_sid": "<string>",
"since": "<string>",
"before": "<string>",
"limit": 25
}
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({
q: '<string>',
email_folder_sid: '<string>',
since: '<string>',
before: '<string>',
limit: 25
})
};
fetch('https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider', 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/{sid}/search-provider",
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([
'q' => '<string>',
'email_folder_sid' => '<string>',
'since' => '<string>',
'before' => '<string>',
'limit' => 25
]),
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/{sid}/search-provider"
payload := strings.NewReader("{\n \"q\": \"<string>\",\n \"email_folder_sid\": \"<string>\",\n \"since\": \"<string>\",\n \"before\": \"<string>\",\n \"limit\": 25\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/{sid}/search-provider")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"<string>\",\n \"email_folder_sid\": \"<string>\",\n \"since\": \"<string>\",\n \"before\": \"<string>\",\n \"limit\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-accounts/{sid}/search-provider")
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 \"q\": \"<string>\",\n \"email_folder_sid\": \"<string>\",\n \"since\": \"<string>\",\n \"before\": \"<string>\",\n \"limit\": 25\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Headers
Body
Request body of search_email_account_provider.
Response
action success envelope.