Archive email message
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive \
--header 'Authorization: Bearer <token>' \
--header 'Team-SID: <api-key>'import requests
url = "https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive"
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Team-SID': '<api-key>'}
};
fetch('https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive', 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-messages/{sid}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
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-messages/{sid}/archive")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive")
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>'
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "action",
"action": "<string>",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_account_sid": "<string>",
"email_thread_sid": "<string>",
"internet_message_id": "<string>",
"provider_message_id": "<string>",
"direction": "inbound",
"status": "received",
"kind": "regular",
"in_reply_to_email_message_sid": "<string>",
"bounce_type": "hard",
"bounce_code": "<string>",
"bounce_diagnostic": "<string>",
"from": {
"email": "<string>",
"display_name": "<string>"
},
"to": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"cc": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"bcc": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"reply_to": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"subject": "<string>",
"snippet": "<string>",
"is_body_synced": true,
"attachments": [
{
"id": "<string>",
"name": "<string>",
"mime": "<string>",
"size": 1,
"content_id": "<string>",
"is_inline": true
}
],
"has_attachments": true,
"email_folder_sids": [
"<string>"
],
"folder_role": "inbox",
"is_read": true,
"client_reference": "<string>",
"first_opened_at": "<string>",
"opens_count": 123,
"first_clicked_at": "<string>",
"clicks_count": 123,
"unsubscribed_at": "<string>",
"sent_at": "<string>",
"scheduled_at": "<string>",
"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>"
},
"body_html": "<string>",
"body_text": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"body_html_sanitized": "<string>",
"body_text_unquoted": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"is_flagged": true,
"is_answered": true,
"deleted_at": "<string>"
},
"result": {
"email_folder_sids": [
"<string>"
],
"folder_role": "inbox"
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}
email_messages
Archive email message
Take a message out of the inbox the way its provider does it: Gmail drops the Inbox label and keeps the others, Microsoft and IMAP move it to the archive folder. Nothing is deleted. result carries the folders after the move. Archiving twice changes nothing. A scheduled message is in no folder yet (422); an IMAP mailbox with no archive folder answers 409 archive_folder_missing: move it with update_email_message instead. Many at once: bulk_update_email_messages with archive true. Requires can_act_email_messages.
Contract:
- MCP tool
archive_email_message, registry packagemcp.email/email_messages, mountemail.messaging. - Operation
action, response envelopeaction. - Flags: none.
POST
/
api
/
email-messages
/
{sid}
/
archive
Archive email message
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive \
--header 'Authorization: Bearer <token>' \
--header 'Team-SID: <api-key>'import requests
url = "https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive"
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Team-SID': '<api-key>'}
};
fetch('https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive', 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-messages/{sid}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
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-messages/{sid}/archive")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-messages/{sid}/archive")
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>'
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "action",
"action": "<string>",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_account_sid": "<string>",
"email_thread_sid": "<string>",
"internet_message_id": "<string>",
"provider_message_id": "<string>",
"direction": "inbound",
"status": "received",
"kind": "regular",
"in_reply_to_email_message_sid": "<string>",
"bounce_type": "hard",
"bounce_code": "<string>",
"bounce_diagnostic": "<string>",
"from": {
"email": "<string>",
"display_name": "<string>"
},
"to": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"cc": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"bcc": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"reply_to": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"subject": "<string>",
"snippet": "<string>",
"is_body_synced": true,
"attachments": [
{
"id": "<string>",
"name": "<string>",
"mime": "<string>",
"size": 1,
"content_id": "<string>",
"is_inline": true
}
],
"has_attachments": true,
"email_folder_sids": [
"<string>"
],
"folder_role": "inbox",
"is_read": true,
"client_reference": "<string>",
"first_opened_at": "<string>",
"opens_count": 123,
"first_clicked_at": "<string>",
"clicks_count": 123,
"unsubscribed_at": "<string>",
"sent_at": "<string>",
"scheduled_at": "<string>",
"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>"
},
"body_html": "<string>",
"body_text": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"body_html_sanitized": "<string>",
"body_text_unquoted": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"is_flagged": true,
"is_answered": true,
"deleted_at": "<string>"
},
"result": {
"email_folder_sids": [
"<string>"
],
"folder_role": "inbox"
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}
Authorizations
Headers
Response
action success envelope.